add device debugging

This commit is contained in:
chrys 2017-03-20 18:42:58 +01:00
parent cede189a8d
commit 8c5694dbf3
2 changed files with 13 additions and 6 deletions

View File

@ -7,12 +7,6 @@ import time
iDevices = map(evdev.InputDevice, (evdev.list_devices())) iDevices = map(evdev.InputDevice, (evdev.list_devices()))
iDevices = {dev.fd: dev for dev in iDevices if evdev.events.EV_KEY in dev.capabilities()} iDevices = {dev.fd: dev for dev in iDevices if evdev.events.EV_KEY in dev.capabilities()}
for fd in iDevices:
dev = iDevices[fd]
print(dev.name,dev.leds())
return
uDevices = {} uDevices = {}
for fd in iDevices: for fd in iDevices:
dev = iDevices[fd] dev = iDevices[fd]

13
play zone/listDevices.py Executable file
View File

@ -0,0 +1,13 @@
#!/bin/python
import evdev
from evdev import InputDevice, UInput
from select import select
import time
iDevices = map(evdev.InputDevice, (evdev.list_devices()))
iDevices = {dev.fd: dev for dev in iDevices}
for fd in iDevices:
dev = iDevices[fd]
cap = dev.capabilities()
print(dev.name,dev.leds(),'has keys:'+str(evdev.events.EV_KEY in cap),'is mouse:'+str(((evdev.events.EV_REL in cap) or (evdev.events.EV_ABS in cap))))