From 1bb2d35425158e21589c5917e32cb37e0c1cb837 Mon Sep 17 00:00:00 2001 From: Chrys Date: Tue, 22 Oct 2019 00:08:44 +0200 Subject: [PATCH] add delay to sync --- src/fenrirscreenreader/core/inputManager.py | 7 ++----- src/fenrirscreenreader/inputDriver/evdevDriver.py | 12 ++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index 58733dac..f345bff2 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -53,13 +53,10 @@ class inputManager(): if force: self.setExecuteDeviceGrab() if not self.executeDeviceGrab: - print('1') return if self.env['input']['eventBuffer'] != []: - print('2', self.env['input']['eventBuffer']) return if not self.noKeyPressed(): - print('3') return if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): self.executeDeviceGrab = False @@ -224,7 +221,7 @@ class inputManager(): def setLastDeepestInput(self, currentDeepestInput): self.lastDeepestInput = currentDeepestInput def clearLastDeepInput(self): - self.lastDeepestInput = [] + self.lastDeepestInput = [] def getLastInputTime(self): return self.lastInputTime def getLastDeepestInput(self): @@ -266,7 +263,7 @@ class inputManager(): shortcut = [] self.env['input']['shortcutRepeat'] = 1 shortcut.append(self.env['input']['shortcutRepeat']) - shortcut.append(self.env['input']['currInput']) + shortcut.append(self.env['input']['currInput']) self.env['runtime']['debug'].writeDebugOut("currShortcut " + str(shortcut) ,debug.debugLevel.INFO) return str(shortcut) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index d7c54e47..a64e3cf7 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -73,7 +73,7 @@ class driver(inputDriver): try: if currDevice.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']: ignorePlug = True - if currDevice.phys.upper() in ['','SPEAKUP']: + if currDevice.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: ignorePlug = True if 'BRLTTY' in currDevice.name.upper(): ignorePlug = True @@ -150,6 +150,7 @@ class driver(inputDriver): if not self._initialized: return uDevice.write_event(event) + time.sleep(0.0000002) uDevice.syn() def updateInputDevices(self, newDevices = None, init = False): @@ -199,7 +200,7 @@ class driver(inputDriver): try: if currDevice.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']: continue - if currDevice.phys.upper() in ['','SPEAKUP']: + if currDevice.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: continue if 'BRLTTY' in currDevice.name.upper(): continue @@ -317,17 +318,17 @@ class driver(inputDriver): if self.uDevices[fd] != None: return try: - self.uDevices[fd] = UInput.from_device(self.iDevices[fd], name='fenrir-uinput') + self.uDevices[fd] = UInput.from_device(self.iDevices[fd], name='fenrir-uinput', phys='fenrir-uinput') except Exception as e: try: - print(e) self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: compat fallback: ' + str(e),debug.debugLevel.WARNING) dev = self.iDevices[fd] cap = dev.capabilities() del cap[0] self.uDevices[fd] = UInput( cap, - 'fenrir-uinput', + name = 'fenrir-uinput', + phys = 'fenrir-uinput' ) except Exception as e: self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: init Uinput not possible: ' + str(e),debug.debugLevel.ERROR) @@ -356,7 +357,6 @@ class driver(inputDriver): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): return True try: - print(self.iDevices[fd]) self.iDevices[fd].grab() self.gDevices[fd] = True self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: grab device ('+ str(self.iDevices[fd].name) + ')',debug.debugLevel.INFO)