blob: 574a7ffcb027ce743efd5c7b868c452234112522 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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')
|