aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..e085ec9
--- /dev/null
+++ b/main.py
@@ -0,0 +1,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}")