aboutsummaryrefslogtreecommitdiff
path: root/main.py
blob: e085ec9cd66f92feb1c55d3556503af2328f9aec (plain)
1
2
3
4
5
6
7
8
9
from evdev import InputDevice, ecodes

device = InputDevice("/dev/input/event0")

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}")