Skip to content
Snippets Groups Projects
Peter Hutterer's avatar
Peter Hutterer authored
Previously, event codes without a kernel define would resolve into properly
named objects, e.g. libevdev.EV_REL.REL_0B

This breaks the API whenever the kernel introduces a new define because that
named object will just disappear. e.g. the above REL_0B is now
REL_WHEEL_HI_RES.

Since the undefined names aren't supposed to be used by callers directly
anyway, rename them to be underscored instead: libevdev.EV_REL._REL_0B
This means we can still return them from evbit() and events() but the
underscore signals a private API.

The actual name remains the same, so print(_REL_0B.name) will not have an
underscore. This is to avoid bugs/breakage where the caller uses the 3-lettter
prefix for other purposes.

Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
f9968087
History

python-libevdev - Python wrapper for libevdev

This project is a Python wrapper around libevdev, taking advantage of libevdev's advanced event handling. Documentation is available here: https://python-libevdev.readthedocs.io/en/latest/

libevdev makes it easy to

  • read and parse events from an input device
  • create a virtual input device and make it send events
  • duplicate an existing device and modify the event stream

For information about libevdev see here: https://freedesktop.org/wiki/Software/libevdev/

Source code

The source code of python-libevdev can be found at: https://gitlab.freedesktop.org/libevdev/python-libevdev

License

python-libevdev is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: [...]

See the COPYING file for the full license information.