Changelog — Python-evdev
1.9.3 (Feb 05, 2025)
Fix several memory leaks in
input.c.Raise the minimum supported Python version to 3.9 and the setuptools version to 77.0.
1.9.2 (May 01, 2025)
Add the “–reproducible” build option which removes the build date and used headers from the generated
ecodes.c. Example usage:python -m build --config-setting=--build-option='build_ecodes --reproducible' -n
Use
Genericto set precise type forInputDevice.path.
1.9.1 (Feb 22, 2025)
Fix fox missing
UI_FFconstants in generatedecodes.py.More type annotations.
1.9.0 (Feb 08, 2025)
Fix for
CPATH/C_INCLUDE_PATHbeing ignored during build.Slightly faster reading of events in
device.read()anddevice.read_one().Fix FreeBSD support.
Drop deprecated
InputDevice.fn(useInputDevice.pathinstead).Improve type hint coverage and add a
py.typedfile to the sdist.
1.8.0 (Jan 25, 2025)
Binary wheels are now provided by the evdev-binary package. The package is compiled on manylinux_2_28 against kernel 4.18.
The
evdev.ecodesmodule is now generated at install time and contains only constants. This allows type checking and introspection of theevdev.ecodesmodule, without having to execute it first. The old module is available asevdev.ecodes_runtime. In case generation of the staticecodes.pyfails, the install process falls back to usingecodes_runtime.pyasecodes.py.Reverse mappings in
evdev.ecodesthat point to more than one value are now tuples instead of lists. For example:>>> ecodes.KEY[153] ('KEY_DIRECTION', 'KEY_ROTATE_DISPLAY')
Raise the minimum supported Python version to 3.8.
Fix keyboard delay and repeat being swapped (#227).
Move the
syn()convenience method fromInputDevicetoEventIO(#224).
1.7.1 (May 8, 2024)
Provide fallback value for
FF_MAX_EFFECTS, which fixes the build on EL 7 (#219).Add
#ifdefguards aroundUI_GET_SYSNAMEto improve kernel compatibility (#218) .Wait up to two seconds for uinput devices to appear. (#215)
1.7.0 (Feb 18, 2024)
Respect the
CPATH/C_INCLUDE_PATHenvironment variables during install.Add the uniq address to the string representation of
InputDevice.Improved method for finding the device node corresponding to a uinput device (#206).
Repository TLC (reformatted with ruff, fixed linting warnings, moved packaging metadata to
pyproject.tomletc.).
1.6.1 (Jan 20, 2023)
Fix generation of
ecodes.cwhen the path tosys.executablecontains spaces.
1.6.0 (Jul 17, 2022)
Fix Python 3.11 compatibility (#174).
1.5.0 (Mar 24, 2022)
Re-enable TTY echo at evtest exit (#155).
Fix
ImportError: sys.meta_path is None, Python is likely shutting down(#154).Closing the input device file descriptor in
InputDevice.close()now happens in the main thread, instead of in a new thread (reverts #146).Fix
util.find_ecodes_by_regexnot working across all supported Python versions (#152).
1.4.0 (Jan 16, 2021)
Fix
InputDevice.set_absinfoto allow setting parameters to zero.Fix off-by-one in
ioctl_EVIOCG_bits, which causes value at the end of the list to not be reported back (#131).Fix
set_absinfoto allow setting parameters to zero (#128).Fix leak when returning
BlockingIOErrorfrom a read (#143).Fix “There is no current event loop in thread” error for non asyncio code (#146).
Prevent
InputDevicedestructor from blocking (#145).Add missing return codes to
os.strerror()calls and fix force feedback example in docs (#138).Add the
util.find_ecodes_by_regex()helper function.
1.3.0 (Jan 12, 2020)
Fix build on 32bit arches with 64bit time_t
Add functionality to query device properties. See
InputDevice.input_propsand theinput_propsargument toUinput.KeyEventreceived anallow_unknownconstructor argument, which determines what will happen when an event code cannot be mapped to a keycode. The default and behavior so far has been to raiseKeyError. If set toTrue, the keycode will be set to the event code formatted as a hex number.Add
InputDevice.set_absinfo()andInputDevice.absinfo().Instruct the asyncio event loop to stop monitoring the fd of the input device when the device is closed.
1.2.0 (Apr 7, 2019)
Add UInput support for the resolution parameter in AbsInfo. This brings support for the new method of uinput device setup, which was introduced in Linux 4.5 (thanks to @LinusCDE).
Vendor and product identifiers can be greater or equal to 0x8000 (thanks @ivaradi).
1.1.2 (Sep 1, 2018)
Fix installation on kernels <= 4.4.
Fix uinput creation ignoring absinfo settings.
1.1.0 (Aug 27, 2018)
Add support for handling force-feedback effect uploads (many thanks to @ndreys).
Fix typo preventing ff effects that need left coefficients from working.
1.0.0 (Jun 02, 2018)
Prevent
Uinputdevice creation raisingObjects/longobject.c:415: bad argument to internal functionwhen a non-completeAbsInfostructure is passed. All missingAbsInfofields are set to 0.Fix
Uinputdevice creation raisingKeyErrorwhen a capability filtered by default is not present.The
InputDevice.fnattribute was deprecated in favor ofInputDevice.path. Using the former will show aDeprecationWarning, but would otherwise continue working as before.Fix
InputDevicecomparison raisingAttributeErrordue to a non-existantpathattribute.Fix asyncio support in Python 3.5+.
Uploading FF effect now works both on Python 2.7 and Python 3+.
Remove the
asyncoreexample from the tutorial.
0.8.1 (Mar 24, 2018)
Fix Python 2 compatibility issue in with
Uinput.from_device.Fix minor evdev.evtest formatting issue.
0.8.0 (Mar 22, 2018)
Fix
InputDevicecomparison on Python 2.The device path is now considered when comparing two devices.
Fix
UInput.from_devicenot correctly merging the capabilities of selected devices.The list of excluded event types in
UInput.from_deviceis now configurable. For example:UInput.from_device(dev, filtered_types=(EV_SYN, EV_FF))
In addition,
ecodes.EV_FFis now excluded by default.Add a context manager for grabbing access to a device -
InputDevice.grab_context. For example:with dev.grab_context(): pass
Add the
InputDevice.uniqattribute, which contains the unique identifier of the device. As withphys, this attribute may be empty (i.e. ‘’).
0.7.0 (Jun 16, 2017)
InputDevicenow accepts objects that support the path protocol. For example:pth = pathlib.Path('/dev/input/event0') dev = evdev.InputDevice(pth)
Support path protocol in
InputDevice. This means thatInputDeviceinstances can be passed to callers that expect aos.PathLikeobject.Exceptions raised during
InputDevice.async_read()(and similar) are now handled properly (i.e. an exception is set on the returned future instead of leaking that exception into the event loop) (Fixes #67).
0.6.4 (Oct 07, 2016)
Exclude
ecodes.cfrom source distribution (Fixes #63).
0.6.3 (Oct 06, 2016)
Add the
UInput.from_deviceclass method, which allows uinput device to be created with the capabiltiies of one or more existing input devices:ui = UInput.from_device('/dev/input1', '/dev/input2', **constructor_kwargs)
Add the
build_ecodesdistutils command, which generates theecodes.cextension module. The new way of overwriting the evdev header locations is:python setup.py build \ build_ecodes --evdev-headers path/input.h:path/input-event-codes.h \ build_ext --include-dirs path/ \ install
The
build*andinstallcommands no longer have to be part of the same command-line (i.e. runninginstallwill reuse the outputs of the lastbuild).
0.6.1 (Jun 04, 2016)
Disable tty echoing while evtest is running.
Allow evtest to listen to more than one devices.
The setup.py script now allows the location of the input header files to be overwritten. For example:
python setup.py build_ext \ --evdev-headers path/input.h:path/input-event-codes.h \ --include-dirs path/ \ install
0.6.0 (Feb 14, 2016)
Asyncio and async/await support (many thanks to @paulo-raca).
Add the ability to set the phys property of uinput devices (thanks @paulo-raca).
Add a generic
InputDevice.set()method (thanks @paulo-raca).Distribute the evtest script along with evdev.
Fix issue with generating
ecodes.cin recent kernels (>= 4.4.0).Fix absinfo item indexes in
UInput.uinput_create()(thanks @forsenonlhaimaisentito).More robust comparison of
InputDeviceobjects (thanks @isia).
0.5.0 (Jun 16, 2015)
Write access to the input device is no longer mandatory. Evdev will first try to open the device for reading and writing and fallback to read-only. Methods that require write access (e.g.
set_led()) will raiseEvdevErrorif the device is open only for reading.
0.4.7 (Oct 07, 2014)
Fallback to distutils if setuptools is not available.
0.4.6 (Oct 07, 2014)
Rework documentation and docstrings once more.
Fix install on Python 3.4 (works around issue21121).
Fix
ioctl()requested buffer size (thanks Jakub Wojciech Klama).
0.4.5 (Jul 06, 2014)
0.4.4 (Jun 04, 2014)
Calling
InputDevice.read_one()should always returnNone, when there is nothing to be read, even in case of aEAGAINerrno (thanks JPP).
0.4.3 (Dec 19, 2013)
Silence
OSErrorin destructor (thanks @polyphemus).Make
InputDevice.close()work in cases in which stdin (fd 0) has been closed (thanks @polyphemus).
0.4.2 (Dec 13, 2013)
Rework documentation and docstrings.
Call
InputDevice.close()fromInputDevice.__del__().
0.4.1 (Jul 24, 2013)
Fix reference counting in
InputDevice.device_read(),InputDevice.device_read_many()andioctl_capabilities().
0.4.0 (Jul 01, 2013)
Add
FF_*andFF_STATUScodes toecodes()(thanks @bgilbert).Reverse event code mappings (
ecodes.{KEY,FF,REL,ABS}and etc.) will now map to a list of codes, whenever a value corresponds to multiple codes:>>> ecodes.KEY[152] ... ['KEY_COFFEE', 'KEY_SCREENLOCK'] >>> ecodes.KEY[30] ... 'KEY_A'
Set the state of a LED through
InputDevice.set_led()(thanks @accek).Open
InputDevice.fdinO_RDWRmode from now on.Fix segfault in
InputDevice.device_read_many()(thanks @bgilbert).
0.3.3 (May 29, 2013)
Raise
IOErrorfromInputDevice.device_read()andInputDevice.device_read_many()whenInputDevice.read()fails.Several stability and style changes (thank you debian code reviewers).
0.3.2 (Apr 05, 2013)
Fix vendor id and product id order in
DeviceInfo()(thanks @kived).
0.3.1 (Nov 23, 2012)
InputDevice.read()will return an empty tuple if the device has nothing to offer (instead of segfaulting).Exclude unnecessary package data in sdist and bdist.
0.3.0 (Nov 06, 2012)
Add ability to set/get auto-repeat settings with
EVIOC{SG}REP.Add
InputDevice.version()- the value ofEVIOCGVERSION.Add
InputDevice.read_loop().Add
InputDevice.grab()andInputDevice.ungrab()- exposesEVIOCGRAB.Add
InputDevice.leds()- exposesEVIOCGLED.Replace
DeviceInfoclass with a namedtuple.Prevent
InputDevice.read_one()from skipping events.Rename
AbsDatatoAbsInfo(as instruct input_absinfo).
0.2.0 (Aug 22, 2012)
Add the ability to set arbitrary device capabilities on uinput devices (defaults to all
EV_KEYecodes).Add
UInput.devicewhich is an openInputDeviceto the input device that uinput ‘spawns’.Add
UInput.capabilities()which is just a shortcut toUInput.device.capabilities().Rename
UInput.write()toUInput.write_event().Add a simpler
UInput.write(type, code, value)()method.Make all
UInput()constructor arguments optional (default device name is nowpy-evdev-uinput).Add the ability to set
absmin,absmax,absfuzzandabsflatwhen specifying the uinput device’s capabilities.Remove the
nophysargument - if a device fails theEVIOCGPHYSioctl, phys will equal the empty string.Make
InputDevice.capabilities()perform aEVIOCGABSioctl for devices that supportEV_ABSand return that info wrapped in anAbsDatanamedtuple.Split
ioctl_devinfointoioctl_devinfoandioctl_capabilities.Split
UInput.uinput_open()toUInput.uinput_open()andUInput.uinput_create()Add more uinput usage examples and documentation.
Rewrite uinput tests.
Remove
mouserelandmouseabsfromUInput.Tie the sphinx version and release to the distutils version.
Set ‘methods-before-attributes’ sorting in the docs.
Remove
KEY_CNTandKEY_MAXfromecodes.keys().
0.1.1 (May 18, 2012)
Add
events.keys, which is a combination of allBTN_andKEY_event codes.ecodes.cwas not generated when installing throughpip.
0.1.0 (May 17, 2012)
Initial Release