From 3e8a53aa56398ff1d3416f7511bb7ba705bad9c7 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 24 May 2018 11:22:58 +0200 Subject: [PATCH] Update inputDriver.py --- src/fenrirscreenreader/core/inputDriver.py | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/fenrirscreenreader/core/inputDriver.py b/src/fenrirscreenreader/core/inputDriver.py index bc4bff62..d0ba533e 100644 --- a/src/fenrirscreenreader/core/inputDriver.py +++ b/src/fenrirscreenreader/core/inputDriver.py @@ -15,23 +15,19 @@ class inputDriver(): self._isInitialized = True def shutdown(self): if self._initialized: - self.releaseDevices() + self.removeAllDevices() self._isInitialized = False def getInputEvent(self): - time.sleep(0.05) + time.sleep(0.1) return None - def handleInputEvent(self, event): - time.sleep(0.05) - if not self._initialized: - return def writeEventBuffer(self): if not self._initialized: return def clearEventBuffer(self): if not self._initialized: return - del self.env['input']['eventBuffer'][:] - def updateInputDevices(self, force = False, init = False): + del self.env['input']['eventBuffer'][:] + def updateInputDevices(self, newDevices = None, init = False) if not self._initialized: return def getLedState(self, led = 0): @@ -47,10 +43,17 @@ class inputDriver(): def ungrabAllDevices(self): if not self._initialized: return + def hasIDevices(self): + if not self._initialized: + return False + return False def removeAllDevices(self): if not self._initialized: return def __del__(self): if not self._initialized: - return - self.removeAllDevices() + return + try: + self.removeAllDevices() + except: + pass