initial evdev driver

This commit is contained in:
chrys
2016-09-13 00:05:29 +02:00
parent 0abd37f3f4
commit efeb9b884a
5 changed files with 19 additions and 45 deletions

View File

@ -20,25 +20,22 @@ for fd in iDevices:
# dev.info.bustype,
# '/dev/uinput'
)
dev.grab()
i = 0
while i < 100:
while i < 1000:
r, w, x = select(iDevices, [], [])
if r != []:
i += 1
for fd in r:
for event in iDevices[fd].read():
if event.code != 30: # a
uDevices[fd].write_event(event)
uDevices[fd].syn()
#print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn + ' Events:' + str(devices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
print('Devicename:'+ iDevices[fd].name + ' Devicepath:' + iDevices[fd].fn + ' Events:' + str(iDevices[fd].active_keys(verbose=True)) + ' Value:' + str(event.value))
else:
print('this key is consumed')
break
break
for fd in iDevices:
iDevices[fd].ungrab()
iDevices[fd].close()
uDevices[fd].close()