Update evdevDriver.py

This commit is contained in:
chrys87 2018-05-23 14:51:35 +02:00 committed by GitHub
parent 637a9c3c51
commit e30a703491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,15 +66,13 @@ class driver(inputDriver):
monitor.start() monitor.start()
while active.value: while active.value:
validDevices = [] validDevices = []
action, device = monitor.poll(1) device = monitor.poll(1)
while device: while device:
try: try:
if not '/sys/devices/virtual/input/' in device.sys_path: if not '/sys/devices/virtual/input/' in device.sys_path:
if device.device_node: if device.device_node:
if device.sys_name.startswith('event'): validDevices.append(str(device.device_node))
if action == 'add': device = monitor.poll(0.1)
validDevices.append(str(device.device_node))
action, device = monitor.poll(0.1)
except: except:
pass pass
if validDevices: if validDevices: