add evdev tools
This commit is contained in:
parent
731981d6b7
commit
84d901a484
15
tools/traceEvdev.py
Normal file
15
tools/traceEvdev.py
Normal file
@ -0,0 +1,15 @@
|
||||
import evdev
|
||||
from evdev import InputDevice
|
||||
from select import select
|
||||
import time
|
||||
|
||||
devices = map(evdev.InputDevice, (evdev.list_devices()))
|
||||
devices = {dev.fd: dev for dev in devices}
|
||||
|
||||
while True:
|
||||
r, w, x = select(devices, [], [])
|
||||
if r != []:
|
||||
for fd in r:
|
||||
for event in devices[fd].read():
|
||||
print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn + ' Events:' + str(devices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
|
||||
|
Loading…
Reference in New Issue
Block a user