aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-03-29 23:20:01 +0200
committerVG <vg@devys.org>2016-03-29 23:20:01 +0200
commitb177a85ca2cc8143b0b3a5a477e85cddacdd03d3 (patch)
tree18817f0e40fe8c207a3dc1531eb0fa45c6996fa7
downloadvhs_recorder-b177a85ca2cc8143b0b3a5a477e85cddacdd03d3.tar.gz
vhs_recorder-b177a85ca2cc8143b0b3a5a477e85cddacdd03d3.tar.bz2
vhs_recorder-b177a85ca2cc8143b0b3a5a477e85cddacdd03d3.zip
first commit
-rwxr-xr-xvhs_recorder.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/vhs_recorder.py b/vhs_recorder.py
new file mode 100755
index 0000000..574a7ff
--- /dev/null
+++ b/vhs_recorder.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python3
+
+import evdev
+import time
+
+dev = evdev.InputDevice('/dev/input/by-path/pci-0000:00:12.2-usb-0:4.4:1.0-event-mouse')
+
+dev.grab()
+
+for event in dev.read_loop():
+ if not event.code:
+ continue
+ print('event code: ', event.code)
+ if event.code == 274 and event.value == 1:
+ print("2h record requested")
+ time.sleep(3)
+ # remove pending event after job before waiting for a new one
+ while dev.read_one():
+ pass
+ print('iteration done')