evdev
Bindings to the Linux input handling subsystem
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 evdevuv
uv add evdevpoetry
poetry add evdevInstalling 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
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
inputsProvides cross-platform Python access to…
permissive · top 15,000 on PyPI
pyudevpyudev is a pure Python binding for libudev…
copyleft · top 5,000 on PyPI
pynputPynput lets you programmatically control and…
copyleft · top 5,000 on PyPI
spidevProvides Python bindings to interact with SPI…
permissive · top 15,000 on PyPI
pynput-robocorp-forkControls and monitors mouse and keyboard input…
copyleft · top 15,000 on PyPI
ipyeventsipyevents provides a Jupyter widget that…
permissive · top 15,000 on PyPI
sshkeyboardCaptures keyboard input via callbacks in SSH…
permissive · top 15,000 on PyPI
keyboardHook global keyboard events, register hotkeys,…
permissive · top 5,000 on PyPI
PyDirectInputAutomates mouse and keyboard input on Windows…
permissive · top 15,000 on PyPI
pylibiioPython bindings for libiio, a library for…
copyleft · top 15,000 on PyPI