diff options
| author | Arslaan Pathan <[email protected]> | 2026-10-05 23:16:42 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-10-05 23:16:42 +1300 |
| commit | 4683da385843dd2f2a397555370445217871e513 (patch) | |
| tree | feba73a9125e34e8801abca67ce8dc87973088c5 | |
| parent | 91e944bc70736ec10816f401ab4a2172624f2aff (diff) | |
| download | remote-automation-4683da385843dd2f2a397555370445217871e513.tar.xz remote-automation-4683da385843dd2f2a397555370445217871e513.zip | |
autodetect
| -rw-r--r-- | main.py | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -1,9 +1,18 @@ -from evdev import InputDevice, ecodes +from evdev import InputDevice, list_devices -device = InputDevice("/dev/input/event0") +device = None + +for path in list_devices(): + candidate = InputDevice(path) + + if candidate.name == "meson-ir": + device = candidate + break + +if device is None: + raise RuntimeError("meson-ir input device not found") print(f"Listening on {device.path}: {device.name}") for event in device.read_loop(): - if event.type == ecodes.EV_MSC and event.code == ecodes.MSC_SCAN: - print(f"Scancode: {event.value:#x}") + print(event) |
