skillfed

evdev

Bindings to the Linux input handling subsystem

evdev v1.9.3 1.1M downloads/30d#4,317 on PyPI386
Permissive license BSD-3-Clause Active released

What it is and what it does

evdev is a Python library that exposes the Linux kernel's input event subsystem to userspace programs. It provides two main capabilities: reading raw hardware input events (keyboard, mouse, joystick, touchscreen) from character devices in /dev/input/, and creating virtual input devices via uinput that can inject synthesized events back into the input subsystem. The package wraps the low-level C interfaces with Python bindings, eliminating the need to call ioctl directly.

Typical use cases include building custom input handlers, remapping hardware inputs, creating input event monitors, automating user input for testing, or building virtual device drivers. The package has no runtime dependencies but requires Linux and compilation against kernel headers at install time. It supports current Python versions (3.9+) and is marked as production-stable.

Use it for:

  • Monitor keyboard and mouse events in real time for accessibility tools or input logging.
  • Create virtual input devices to inject synthetic keyboard or mouse events for automation or testing.
  • Build custom input remapping or filtering layers for gaming or accessibility use cases.
  • Capture raw joystick or gamepad events for custom game controllers or input devices.
  • Implement input event recording and playback for testing or demonstration purposes.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python bindings to Linux's evdev and uinput input event interfaces, allowing programs to read hardware input events and create virtual input devices.

Yes, if you need direct access to Linux input events and can meet the build requirements. The package is stable, actively maintained, and has no known vulnerabilities. The high install friction (requires kernel headers and compilation) is a real constraint—verify your build environment is ready before attempting installation. Not suitable for cross-platform projects or systems without Linux development tools.

Install

evdev on PyPI

pip

pip install evdev

uv

uv add evdev

poetry

poetry add evdev

Installing evdev

Before you install

Installation requires compilation against Linux kernel headers; the package is actively maintained with a recent commit history, but the high install friction means you'll need a build environment and Linux development packages present.

License in practice

BSD-3-Clause is permissive and poses no restrictions on commercial or proprietary use; you may use, modify, and distribute this package freely provided you retain the license notice.

Quickstart

pip install evdev

from evdev import InputDevice, list_devices

devices = list_devices()
device = InputDevice(devices[0])
for event in device.read_loop():
    print(event)

Requires Linux with kernel headers and a build toolchain; must run on Linux (not macOS or Windows); typically requires root or appropriate /dev/input permissions to access input devices.

Verify before relying

  • Whether the package supports modern input protocols beyond basic evdev (e.g., multi-touch, force feedback details).
  • Performance characteristics when handling high-frequency input streams or many simultaneous devices.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 190 days since the last release
Last repo commit
First released
Downloads 1,132,147/month — #4,317 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: evdev-1.9.3.tar.gz

Keywords: evdev, input, uinput

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries

Tags

linux input event handlingkeyboard mouse event capturevirtual input device creationevdev bindings pythonuinput userspace inputdev/input character device
linux-specificinput-handlingsystem-interface

More Libraries packages