dont add key twice

This commit is contained in:
chrys 2016-09-18 03:41:45 +02:00
parent bf72e7fdc7
commit e7ea7a9e0e

View File

@ -38,12 +38,16 @@ class inputManager():
environment['input']['currInput'] = sorted(environment['input']['currInput']) environment['input']['currInput'] = sorted(environment['input']['currInput'])
elif mEvent['EventState'] == 1: elif mEvent['EventState'] == 1:
if self.isFenrirKey(environment, mEvent): if self.isFenrirKey(environment, mEvent):
if not 'KEY_FENRIR' in environment['input']['currInput']:
environment['input']['currInput'].append('KEY_FENRIR') environment['input']['currInput'].append('KEY_FENRIR')
elif mEvent['EventName'] in ['KEY_RIGHTCTRL','KEY_LEFTCTRL'] : elif mEvent['EventName'] in ['KEY_RIGHTCTRL','KEY_LEFTCTRL'] :
if not 'KEY_CTRL' in environment['input']['currInput']:
environment['input']['currInput'].append('KEY_CTRL') environment['input']['currInput'].append('KEY_CTRL')
elif mEvent['EventName'] in ['KEY_RIGHTSHIFT','KEY_LEFTSHIFT'] : elif mEvent['EventName'] in ['KEY_RIGHTSHIFT','KEY_LEFTSHIFT'] :
if not 'KEY_SHIFT' in environment['input']['currInput']:
environment['input']['currInput'].append('KEY_SHIFT') environment['input']['currInput'].append('KEY_SHIFT')
else: else:
if not mEvent['EventName'] in environment['input']['currInput']:
environment['input']['currInput'].append(mEvent['EventName']) environment['input']['currInput'].append(mEvent['EventName'])
environment['input']['currInput'] = sorted(environment['input']['currInput']) environment['input']['currInput'] = sorted(environment['input']['currInput'])
elif mEvent['EventState'] == 2: elif mEvent['EventState'] == 2: