fix typos
This commit is contained in:
parent
5f77198e80
commit
9c571ba032
@ -31,9 +31,9 @@ class inputManager():
|
||||
|
||||
def getInputEvent(self, environment):
|
||||
eventReceived = False
|
||||
mEvent = environment['runtime']['inputDriver'].getInput(environment)
|
||||
mEvent['EventName'] = self.convertEventName(mEvent['EventName'])
|
||||
mEvent = environment['runtime']['inputDriver'].getInputEvent(environment)
|
||||
if mEvent:
|
||||
mEvent['EventName'] = self.convertEventName(environment, mEvent['EventName'])
|
||||
if mEvent['EventValue'] == 0:
|
||||
return False
|
||||
eventReceived = True
|
||||
@ -42,8 +42,8 @@ class inputManager():
|
||||
environment['input']['currInput'].remove(mEvent['EventName'])
|
||||
environment['input']['currInput'] = sorted(environment['input']['currInput'])
|
||||
elif mEvent['EventState'] == 1:
|
||||
if not mEvent['EventName'] in environment['input']['currInput']:
|
||||
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'])
|
||||
elif mEvent['EventState'] == 2:
|
||||
pass
|
||||
@ -66,7 +66,9 @@ class inputManager():
|
||||
def releaseDevices(self, environment):
|
||||
environment['runtime']['inputDriver'].releaseDevices(environment)
|
||||
|
||||
def convertEventName(self, eventName):
|
||||
def convertEventName(self, environment, eventName):
|
||||
if not eventName:
|
||||
return ''
|
||||
if eventName == 'KEY_LEFTCTRL':
|
||||
eventName == 'KEY_CTRL'
|
||||
elif eventName == 'KEY_RIGHTCTRL':
|
||||
@ -81,13 +83,13 @@ class inputManager():
|
||||
eventName = 'KEY_ALT'
|
||||
if self.isFenrirKey(environment, eventName):
|
||||
eventName = 'KEY_FENRIR'
|
||||
return eventName
|
||||
return eventName
|
||||
|
||||
def isConsumeInput(self, environment):
|
||||
return environment['runtime']['commandManager'].isCommandQueued(environment) and \
|
||||
not environment['input']['keyForeward']
|
||||
#and
|
||||
# not (environment['input']['keyForeward'] or \
|
||||
return environment['runtime']['commandManager'].isCommandQueued(environment) and \
|
||||
not environment['input']['keyForeward']
|
||||
#and
|
||||
# not (environment['input']['keyForeward'] or \
|
||||
# environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'grabDevices'))
|
||||
|
||||
def clearEventBuffer(self, environment):
|
||||
@ -100,6 +102,7 @@ class inputManager():
|
||||
print(e)
|
||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while writeUInput",debug.debugLevel.ERROR)
|
||||
environment['runtime']['debug'].writeDebugOut(environment, str(e),debug.debugLevel.ERROR)
|
||||
|
||||
def isFenrirKeyPressed(self, environment):
|
||||
return 'KEY_FENRIR' in environment['input']['currInput']
|
||||
|
||||
@ -133,4 +136,3 @@ class inputManager():
|
||||
|
||||
def shortcutExists(self, environment, shortcut):
|
||||
return( str(shortcut).upper() in environment['bindings'])
|
||||
|
||||
|
@ -22,7 +22,7 @@ class driver():
|
||||
self.getInputDevices(environment)
|
||||
def shutdown(self, environment):
|
||||
pass
|
||||
def getInput(self, environment):
|
||||
def getInputEvent(self, environment):
|
||||
event = None
|
||||
r, w, x = select(self.iDevices, [], [], environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'screen', 'screenUpdateDelay'))
|
||||
if r != []:
|
||||
|
Loading…
Reference in New Issue
Block a user