Update inputManager.py

This commit is contained in:
chrys87 2016-09-21 10:00:45 +02:00 committed by GitHub
parent a251e5c466
commit 77c8b27be2

View File

@ -28,14 +28,14 @@ class inputManager():
if environment['runtime']['inputDriver']: if environment['runtime']['inputDriver']:
environment['runtime']['inputDriver'].shutdown(environment) environment['runtime']['inputDriver'].shutdown(environment)
def proceedInputEvent(self, environment): def getInputEvent(self, environment):
timeout = True eventReceived = False
mEvent = environment['runtime']['inputDriver'].getInput(environment) mEvent = environment['runtime']['inputDriver'].getInput(environment)
mEvent['EventName'] = self.convertEventName(mEvent['EventName']) mEvent['EventName'] = self.convertEventName(mEvent['EventName'])
if mEvent: if mEvent:
if mEvent['EventValue'] == 0: if mEvent['EventValue'] == 0:
return True return False
timeout = False eventReceived = True
if mEvent['EventState'] == 0: if mEvent['EventState'] == 0:
if mEvent['EventName'] in environment['input']['currInput']: if mEvent['EventName'] in environment['input']['currInput']:
environment['input']['currInput'].remove(mEvent['EventName']) environment['input']['currInput'].remove(mEvent['EventName'])
@ -56,7 +56,7 @@ class inputManager():
environment['input']['newScrollLock'] = environment['runtime']['inputDriver'].getScrollLock(environment) environment['input']['newScrollLock'] = environment['runtime']['inputDriver'].getScrollLock(environment)
environment['input']['lastInputTime'] = time.time() environment['input']['lastInputTime'] = time.time()
environment['input']['shortcutRepeat'] = 1 environment['input']['shortcutRepeat'] = 1
return timeout return eventReceived
def grabDevices(self, environment): def grabDevices(self, environment):
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'grabDevices'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'grabDevices'):