From 7920645472b822e24f553cbffbf66fb626fe8e54 Mon Sep 17 00:00:00 2001 From: Surferlul Date: Thu, 21 Jul 2022 21:23:47 +0200 Subject: [PATCH] fixed test-devices --- test-evdev.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/test-evdev.py b/test-evdev.py index 4c3d227..9260764 100755 --- a/test-evdev.py +++ b/test-evdev.py @@ -1,30 +1,20 @@ #!/usr/bin/env python3 import evdev -from evdev import InputDevice, UInput import sys +import glob def test_uinput(): - uinput = UInput( - events={ - 1: [272, 325, 328, 330, 333, 334, 335], - 3: [ - [0, [1386, 0, 3679, 0, 0, 31]], - [1, [995, 0, 2261, 0, 0, 31]], - [47, [0, 0, 4, 0, 0, 0]], - [53, [0, 0, 3679, 0, 0, 31]], - [54, [0, 0, 2261, 0, 0, 31]], - [55, [0, 0, 2, 0, 0, 0]], - [57, [0, 0, 65535, 0, 0, 0]]], - 4: [5] - }, - name="test_touchpad") - uinput.syn() + _uinput = evdev.UInput({}, name="test") def test_input_device(): - _devices = [InputDevice(path) for path in evdev.list_devices()] + possible_devices = glob.glob("/dev/input/event*") + devices = evdev.list_devices() + for device in possible_devices: + if device not in devices: + print(f"Missing permissions for {device}") def main():