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,13 +38,17 @@ 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):
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'] : 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'] : elif mEvent['EventName'] in ['KEY_RIGHTSHIFT','KEY_LEFTSHIFT'] :
environment['input']['currInput'].append('KEY_SHIFT') if not 'KEY_SHIFT' in environment['input']['currInput']:
environment['input']['currInput'].append('KEY_SHIFT')
else: else:
environment['input']['currInput'].append(mEvent['EventName']) if not mEvent['EventName'] in environment['input']['currInput']:
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:
pass pass