0.7.0 (Jun 16, 2017)

  • InputDevice now 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 that InputDevice instances can be passed to callers that expect a os.PathLike object.

  • 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.c from source distribution (Fixes `#63`_).

0.6.3 (Oct 06, 2016)

  • Add the UInput.from_device class 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_ecodes distutils command, which generates the ecodes.c extension module. The new way of overwriting the evdev header locations is:

    python build \
      build_ecodes --evdev-headers path/input.h:path/input-event-codes.h \
      build_ext --include-dirs  path/ \

    The build* and install commands no longer have to be part of the same command-line (i.e. running install will reuse the outputs of the last build).

0.6.1 (Jun 04, 2016)

  • Dissable tty echoing while evtest is running.

  • Allow evtest to listen to more than one devices.

  • The script now allows the location of the input header files to be overwritten. For example:

    python build_ext \
      --evdev-headers path/input.h:path/input-event-codes.h \
      --include-dirs  path/ \

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.c in recent kernels (>= 4.4.0).
  • Fix absinfo item indexes in UInput.uinput_create() (thanks @forsenonlhaimaisentito).
  • More robust comparison of InputDevice objects (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 raise EvdevError if 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)

  • Add method for returning a list of the currently active keys - InputDevice.active_keys() (thanks @spasche).
  • Fix a potential buffer overflow in ioctl_capabilities() (thanks @spasche).

0.4.4 (Jun 04, 2014)

  • Calling InputDevice.read_one() should always return None, when there is nothing to be read, even in case of a EAGAIN errno (thanks JPP).

0.4.3 (Dec 19, 2013)

  • Silence OSError in 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() from InputDevice.__del__().

0.4.1 (Jul 24, 2013)

  • Fix reference counting in InputDevice.device_read(), InputDevice.device_read_many() and ioctl_capabilities().

0.4.0 (Jul 01, 2013)

  • Add FF_* and FF_STATUS codes to ecodes() (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]
    >>> ecodes.KEY[30]
    ... 'KEY_A'
  • Set the state of a LED through InputDevice.set_led() (thanks @accek).

  • Open InputDevice.fd in O_RDWR mode from now on.

  • Fix segfault in InputDevice.device_read_many() (thanks @bgilbert).

0.3.3 (May 29, 2013)

  • Raise IOError from InputDevice.device_read() and InputDevice.device_read_many() when 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)

  • 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 of EVIOCGVERSION.
  • Add InputDevice.read_loop().
  • Add InputDevice.grab() and InputDevice.ungrab() - exposes EVIOCGRAB.
  • Add InputDevice.leds() - exposes EVIOCGLED.
  • Replace DeviceInfo class with a namedtuple.
  • Prevent InputDevice.read_one() from skipping events.
  • Rename AbsData to AbsInfo (as in struct input_absinfo).

0.2.0 (Aug 22, 2012)

  • Add the ability to set arbitrary device capabilities on uinput devices (defaults to all EV_KEY ecodes).
  • Add UInput.device which is an open InputDevice to the input device that uinput ‘spawns’.
  • Add UInput.capabilities() which is just a shortcut to UInput.device.capabilities().
  • Rename UInput.write() to UInput.write_event().
  • Add a simpler UInput.write(type, code, value)() method.
  • Make all UInput() constructor arguments optional (default device name is now py-evdev-uinput).
  • Add the ability to set absmin, absmax, absfuzz and absflat when specifying the uinput device’s capabilities.
  • Remove the nophys argument - if a device fails the EVIOCGPHYS ioctl, phys will equal the empty string.
  • Make InputDevice.capabilities() perform a EVIOCGABS ioctl for devices that support EV_ABS and return that info wrapped in an AbsData namedtuple.
  • Split ioctl_devinfo into ioctl_devinfo and ioctl_capabilities.
  • Split UInput.uinput_open() to UInput.uinput_open() and UInput.uinput_create()
  • Add more uinput usage examples and documentation.
  • Rewrite uinput tests.
  • Remove mouserel and mouseabs from UInput.
  • Tie the sphinx version and release to the distutils version.
  • Set ‘methods-before-attributes’ sorting in the docs.
  • Remove KEY_CNT and KEY_MAX from ecodes.keys().

0.1.1 (May 18, 2012)

  • Add events.keys, which is a combination of all BTN_ and KEY_ event codes.
  • ecodes.c was not generated when installing through pip.

0.1.0 (May 17, 2012)

Initial Release