Update evdevDriver.py

This commit is contained in:
chrys87 2018-05-18 11:40:05 +02:00 committed by GitHub
parent 0082898119
commit 6a10d7b50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,18 +65,18 @@ class driver(inputDriver):
monitor.filter_by(subsystem='input') monitor.filter_by(subsystem='input')
monitor.start() monitor.start()
while active.value: while active.value:
validDevice = False validDevices = []
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:
validDevice = True validDevices.append(str(device.device_path))
device = monitor.poll(0.5) device = monitor.poll(0.2)
except: except:
pass pass
if validDevice: if validDevices:
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":validDevices})
return time.time() return time.time()
def plugInputDeviceWatchdogTimer(self, active): def plugInputDeviceWatchdogTimer(self, active):
time.sleep(10) time.sleep(10)
return time.time() return time.time()