From e7ea7a9e0e5eff7630c883c9ba9e555d41de436b Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 18 Sep 2016 03:41:45 +0200 Subject: [PATCH] dont add key twice --- src/fenrir-package/core/inputManager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fenrir-package/core/inputManager.py b/src/fenrir-package/core/inputManager.py index eaa9d061..de177d3b 100644 --- a/src/fenrir-package/core/inputManager.py +++ b/src/fenrir-package/core/inputManager.py @@ -38,13 +38,17 @@ class inputManager(): environment['input']['currInput'] = sorted(environment['input']['currInput']) elif mEvent['EventState'] == 1: if self.isFenrirKey(environment, mEvent): - environment['input']['currInput'].append('KEY_FENRIR') + if not 'KEY_FENRIR' in environment['input']['currInput']: + environment['input']['currInput'].append('KEY_FENRIR') elif mEvent['EventName'] in ['KEY_RIGHTCTRL','KEY_LEFTCTRL'] : - environment['input']['currInput'].append('KEY_CTRL') + if not 'KEY_CTRL' in environment['input']['currInput']: + environment['input']['currInput'].append('KEY_CTRL') elif mEvent['EventName'] in ['KEY_RIGHTSHIFT','KEY_LEFTSHIFT'] : - environment['input']['currInput'].append('KEY_SHIFT') - else: - environment['input']['currInput'].append(mEvent['EventName']) + if not 'KEY_SHIFT' in environment['input']['currInput']: + environment['input']['currInput'].append('KEY_SHIFT') + else: + if not mEvent['EventName'] in environment['input']['currInput']: + environment['input']['currInput'].append(mEvent['EventName']) environment['input']['currInput'] = sorted(environment['input']['currInput']) elif mEvent['EventState'] == 2: pass