From b3281ccdee7247e30d4e73b5c16f8bebc83711d9 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 27 Sep 2016 16:21:23 +0200 Subject: [PATCH 1/3] Update evdev.py --- src/fenrir-package/inputDriver/evdev.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fenrir-package/inputDriver/evdev.py b/src/fenrir-package/inputDriver/evdev.py index e32a648d..385f9c77 100644 --- a/src/fenrir-package/inputDriver/evdev.py +++ b/src/fenrir-package/inputDriver/evdev.py @@ -31,19 +31,20 @@ class driver(): for fd in r: event = self.iDevices[fd].read_one() self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event]) - return self.env['runtime']['inputDriver'].mapEvent(event) + if event.code != 0: + return self.env['runtime']['inputDriver'].mapEvent(event) return None def writeEventBuffer(self): for iDevice, uDevice, event in self.env['input']['eventBuffer']: self.writeUInput(uDevice, event) + uDevice.syn() def clearEventBuffer(self): del self.env['input']['eventBuffer'][:] def writeUInput(self, uDevice, event): uDevice.write_event(event) - uDevice.syn() def getInputDevices(self): # 3 pos absolute @@ -62,7 +63,7 @@ class driver(): return None mEvent = inputEvent.inputEvent try: - mEvent['EventName'] = evdev.ecodes.keys[event.code].upper() + mEvent['EventName'] = evdev.ecodes.keys[event.code] mEvent['EventValue'] = event.code mEvent['EventSec'] = event.sec mEvent['EventUsec'] = event.usec From c956eb9f2d70495dcbe09ec1194daccc29d6fa63 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 27 Sep 2016 16:29:12 +0200 Subject: [PATCH 2/3] Update inputManager.py --- src/fenrir-package/core/inputManager.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/fenrir-package/core/inputManager.py b/src/fenrir-package/core/inputManager.py index 325e4fb4..6859a735 100644 --- a/src/fenrir-package/core/inputManager.py +++ b/src/fenrir-package/core/inputManager.py @@ -33,19 +33,21 @@ class inputManager(): mEvent = self.env['runtime']['inputDriver'].getInputEvent() if mEvent: mEvent['EventName'] = self.convertEventName(mEvent['EventName']) - if mEvent['EventValue'] == 0: - return False eventReceived = True if mEvent['EventState'] == 0: if mEvent['EventName'] in self.env['input']['currInput']: self.env['input']['currInput'].remove(mEvent['EventName']) - self.env['input']['currInput'] = sorted(self.env['input']['currInput']) - if len(self.env['input']['prevDeepestInput']) < len(self.env['input']['currInput']): - self.env['input']['prevDeepestInput'] = self.env['input']['currInput'].copy() + if len(self.env['input']['currInput']) > 1: + self.env['input']['currInput'] = sorted(self.env['input']['currInput']) + if len(self.env['input']['currInput']) == 0: + self.env['input']['prevDeepestInput'] = [] elif mEvent['EventState'] == 1: if not mEvent['EventName'] in self.env['input']['currInput']: self.env['input']['currInput'].append(mEvent['EventName']) - self.env['input']['currInput'] = sorted(self.env['input']['currInput']) + if len(self.env['input']['currInput']) > 1: + self.env['input']['currInput'] = sorted(self.env['input']['currInput']) + if len(self.env['input']['prevDeepestInput']) < len(self.env['input']['currInput']): + self.env['input']['prevDeepestInput'] = self.env['input']['currInput'].copy() elif mEvent['EventState'] == 2: pass else: From 01d2418e1e5ce6c5c6065a3811aa700db53e2390 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 27 Sep 2016 16:31:27 +0200 Subject: [PATCH 3/3] Update fenrir.py --- src/fenrir-package/fenrir.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 6cbbf377..121e6ab4 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -50,7 +50,6 @@ class fenrir(): self.environment['runtime']['inputManager'].clearEventBuffer() if self.environment['input']['keyForeward'] > 0: self.environment['input']['keyForeward'] -=1 - self.environment['input']['prevDeepestInput'] = [] else: self.environment['runtime']['screenManager'].update() self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput')