From e812d4e2ae3b2ac276a8660da903f0497ea53f87 Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 11 May 2018 23:30:08 +0200 Subject: [PATCH] catch some driver calls --- src/fenrirscreenreader/core/inputManager.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index 9977c8a7..579c4db4 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -109,10 +109,16 @@ class inputManager(): def grabAllDevices(self): if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): - self.env['runtime']['inputDriver'].grabAllDevices() + try: + self.env['runtime']['inputDriver'].grabAllDevices() + except Exception as e: + pass def ungrabAllDevices(self): if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): - self.env['runtime']['inputDriver'].ungrabAllDevices() + try: + self.env['runtime']['inputDriver'].ungrabAllDevices() + except Exception as e: + pass def updateInputDevices(self): try: @@ -155,7 +161,10 @@ class inputManager(): return eventName def clearEventBuffer(self): - self.env['runtime']['inputDriver'].clearEventBuffer() + try: + self.env['runtime']['inputDriver'].clearEventBuffer() + except Exception as e: + pass def setLastDeepestInput(self, currentDeepestInput): self.lastDeepestInput = currentDeepestInput def clearLastDeepInput(self):