mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-05 14:09:53 +03:00
package/python-evdev: new package
evdev 1.6.1 https://pypi.org/project/evdev/ Signed-off-by: Witold Lipieta <witold.lipieta@thaumatec.com> [yann.morin.1998@free.fr: - add missing comment on kernel headers - fix flake8 in test ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
a7ad781626
commit
b100440bff
11
support/testing/tests/package/sample_python_evdev.py
Normal file
11
support/testing/tests/package/sample_python_evdev.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import evdev
|
||||
|
||||
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
|
||||
e = evdev.events.InputEvent(1036996631, 984417, evdev.ecodes.EV_KEY, evdev.ecodes.KEY_A, 2)
|
||||
k = evdev.events.KeyEvent(e)
|
||||
|
||||
assert(k.keystate == evdev.events.KeyEvent.key_hold)
|
||||
assert(k.event == e)
|
||||
assert(k.scancode == evdev.ecodes.KEY_A)
|
||||
assert(k.keycode == 'KEY_A')
|
||||
assert(len(devices) > 0)
|
||||
11
support/testing/tests/package/test_python_evdev.py
Normal file
11
support/testing/tests/package/test_python_evdev.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from tests.package.test_python import TestPythonPackageBase
|
||||
|
||||
|
||||
class TestPythonPy3Evdev(TestPythonPackageBase):
|
||||
__test__ = True
|
||||
config = TestPythonPackageBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_EVDEV=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_evdev.py"]
|
||||
Reference in New Issue
Block a user