From 42a690de77bdea9d8fa910caf4d83e2601e4851e Mon Sep 17 00:00:00 2001 From: Chrys Date: Mon, 21 Oct 2019 23:36:46 +0200 Subject: [PATCH] add force --- src/fenrirscreenreader/core/fenrirManager.py | 2 +- src/fenrirscreenreader/core/inputManager.py | 7 ++++--- src/fenrirscreenreader/core/settingsManager.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fenrirscreenreader/core/fenrirManager.py b/src/fenrirscreenreader/core/fenrirManager.py index a118a493..4b78b6f6 100644 --- a/src/fenrirscreenreader/core/fenrirManager.py +++ b/src/fenrirscreenreader/core/fenrirManager.py @@ -127,7 +127,7 @@ class fenrirManager(): self.environment['runtime']['commandManager'].executeDefaultTrigger('onApplicationChange') self.environment['runtime']['commandManager'].executeSwitchTrigger('onSwitchApplicationProfile', \ self.environment['runtime']['applicationManager'].getPrevApplication(), \ - self.environment['runtime']['applicationManager'].getCurrentApplication()) + self.environment['runtime']['applicationManager'].getCurrentApplication()) ''' if self.environment['runtime']['vmenuManager'].getActive(): return diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index eb379607..58733dac 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -49,7 +49,9 @@ class inputManager(): return event def setExecuteDeviceGrab(self, newExecuteDeviceGrab = True): self.executeDeviceGrab = newExecuteDeviceGrab - def handleDeviceGrab(self): + def handleDeviceGrab(self, force = False): + if force: + self.setExecuteDeviceGrab() if not self.executeDeviceGrab: print('1') return @@ -175,10 +177,9 @@ class inputManager(): self.env['runtime']['inputDriver'].updateInputDevices(newDevice) except: pass - self.setExecuteDeviceGrab() try: if self.env['runtime']['screenManager']: - self.handleDeviceGrab() + self.handleDeviceGrab(force = True) except: pass def removeAllDevices(self): diff --git a/src/fenrirscreenreader/core/settingsManager.py b/src/fenrirscreenreader/core/settingsManager.py index 48238ccc..1d9da482 100644 --- a/src/fenrirscreenreader/core/settingsManager.py +++ b/src/fenrirscreenreader/core/settingsManager.py @@ -417,10 +417,10 @@ class settingsManager(): environment['runtime']['vmenuManager'].initialize(environment) environment['runtime']['quickMenuManager'] = quickMenuManager.quickMenuManager() environment['runtime']['quickMenuManager'].initialize(environment) + # only possible after having input and screen managers with clean buffer - environment['runtime']['inputManager'].setExecuteDeviceGrab() environment['runtime']['inputManager'].writeEventBuffer() - environment['runtime']['inputManager'].handleDeviceGrab() + environment['runtime']['inputManager'].handleDeviceGrab(force = True) environment['runtime']['debug'].writeDebugOut('\/-------environment-------\/',debug.debugLevel.INFO, onAnyLevel=True) environment['runtime']['debug'].writeDebugOut(str(environment), debug.debugLevel.INFO, onAnyLevel=True)