From 8538dc52a5b4dc280cf770e03177e3ab07aaa25a Mon Sep 17 00:00:00 2001 From: chrys87 Date: Wed, 23 May 2018 14:30:39 +0200 Subject: [PATCH] Update evdevDriver.py --- src/fenrirscreenreader/inputDriver/evdevDriver.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 0775ce64..85b81ad7 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -66,14 +66,15 @@ class driver(inputDriver): monitor.start() while active.value: validDevices = [] - device = monitor.poll(1) + action, device = monitor.poll(1) while device: try: if not '/sys/devices/virtual/input/' in device.sys_path: if device.device_node: if device.sys_name.startswith('event'): - validDevices.append(str(device.device_node)) - device = monitor.poll(0.1) + if action == 'add': + validDevices.append(str(device.device_node)) + action, device = monitor.poll(0.1) except: pass if validDevices: