From e501f7293f6186c1994782d60b2ccb8a3e6541b4 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 28 Feb 2017 11:50:01 +0100 Subject: [PATCH] Update evdevDriver.py --- src/fenrir/inputDriver/evdevDriver.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/fenrir/inputDriver/evdevDriver.py b/src/fenrir/inputDriver/evdevDriver.py index d441e075..b1686fa8 100644 --- a/src/fenrir/inputDriver/evdevDriver.py +++ b/src/fenrir/inputDriver/evdevDriver.py @@ -111,7 +111,11 @@ class driver(): try: if deviceFile in iDevicesFiles: continue - open(deviceFile) + try: + open(deviceFile) + except: + print("Not readable Inputdevice : " + deviceFile +' ' + str(e)) + continue # 3 pos absolute # 2 pos relative # 1 Keys @@ -121,9 +125,12 @@ class driver(): cap = currDevice.capabilities() if mode in ['ALL','NOMICE']: if 1 in cap: - if 116 in cap[1] and len(cap[1]) < 5: + if 116 in cap[1] and len(cap[1]) < 10: print('power') continue + if len(cap[1]) < 30: + print('Not A useful keyboared') + continue if mode == 'ALL': self.iDevices[currDevice.fd] = currDevice self.grabDevice(currDevice.fd)