diff --git a/src/fenrir-package/core/inputManager.py b/src/fenrir-package/core/inputManager.py index a815befe..9b824750 100644 --- a/src/fenrir-package/core/inputManager.py +++ b/src/fenrir-package/core/inputManager.py @@ -68,8 +68,10 @@ class inputManager(): def convertEventName(self, eventName): if not eventName: return '' + print(eventName) + if eventName == 'KEY_LEFTCTRL': - eventName == 'KEY_CTRL' + eventName = 'KEY_CTRL' elif eventName == 'KEY_RIGHTCTRL': eventName = 'KEY_CTRL' elif eventName == 'KEY_LEFTSHIFT': @@ -80,6 +82,10 @@ class inputManager(): eventName = 'KEY_ALT' elif eventName == 'KEY_RIGHTALT': eventName = 'KEY_ALT' + elif eventName == 'KEY_LEFTMETA': + eventName = 'KEY_META' + elif eventName == 'KEY_RIGHTMETA': + eventName = 'KEY_META' if self.isFenrirKey(eventName): eventName = 'KEY_FENRIR' return eventName @@ -97,6 +103,8 @@ class inputManager(): def writeEventBuffer(self): try: self.env['runtime']['inputDriver'].writeEventBuffer() + time.sleep(0.005) + self.clearEventBuffer() except Exception as e: print(e) self.env['runtime']['debug'].writeDebugOut("Error while writeUInput",debug.debugLevel.ERROR) diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 0e278833..90034676 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -44,7 +44,7 @@ class fenrir(): if not self.wasCommand: self.environment['runtime']['inputManager'].writeEventBuffer() if self.wasCommand: - if not self.environment['runtime']['inputManager'].noKeyPressed(): + if self.environment['runtime']['inputManager'].noKeyPressed(): self.wasCommand = False self.environment['runtime']['inputManager'].clearEventBuffer() if self.environment['runtime']['inputManager'].noKeyPressed(): @@ -70,9 +70,10 @@ class fenrir(): if self.environment['input']['keyForeward']: return shortcut = self.environment['runtime']['inputManager'].getCurrShortcut() + print(shortcut) command = self.environment['runtime']['inputManager'].getCommandForShortcut(shortcut) self.environment['runtime']['commandManager'].queueCommand(command) - self.wasCommand = command != '' + self.wasCommand = command != '' def handleCommands(self): if time.time() - self.environment['commandInfo']['lastCommandExecutionTime'] < 0.2: diff --git a/src/fenrir-package/inputDriver/evdev.py b/src/fenrir-package/inputDriver/evdev.py index 0135fd88..8ed2abab 100644 --- a/src/fenrir-package/inputDriver/evdev.py +++ b/src/fenrir-package/inputDriver/evdev.py @@ -37,7 +37,6 @@ class driver(): def writeEventBuffer(self): for iDevice, uDevice, event in self.env['input']['eventBuffer']: self.writeUInput(uDevice, event) - self.clearEventBuffer() def clearEventBuffer(self): del self.env['input']['eventBuffer'][:] @@ -53,7 +52,8 @@ class driver(): # 1 Keys # we try to filter out mices and other stuff here self.iDevices = map(evdev.InputDevice, (evdev.list_devices())) - self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()} + #self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()} + self.iDevices = {dev.fd: dev for dev in self.iDevices if 1 in dev.capabilities()} self.ledDevices = map(evdev.InputDevice, (evdev.list_devices())) self.ledDevices = {dev.fd: dev for dev in self.ledDevices if 1 in dev.capabilities() and 17 in dev.capabilities() and not 3 in dev.capabilities() and not 2 in dev.capabilities()}