aboutsummaryrefslogtreecommitdiff
path: root/main.py
blob: c2d114f2b36b6fd63b9873ebc3b593c2032d7223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from evdev import InputDevice, list_devices

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():
    print(event)