rework
This commit is contained in:
parent
3296f72a8d
commit
0abd37f3f4
@ -12,18 +12,9 @@ class inputManager():
|
|||||||
return environment
|
return environment
|
||||||
def proceedInputEvent(self, environment):
|
def proceedInputEvent(self, environment):
|
||||||
timeout = True
|
timeout = True
|
||||||
if not environment['input']['keyForeward']:
|
|
||||||
self.ignoreKeyRelease = 0
|
|
||||||
environment, timeout = environment['runtime']['inputDriver'].getInput(environment)
|
environment, timeout = environment['runtime']['inputDriver'].getInput(environment)
|
||||||
environment['input']['currShortcutString'] = self.getShortcutString(environment)
|
return environment, timeout
|
||||||
if not timeout:
|
|
||||||
environment['input']['lastInputTime'] = time.time()
|
|
||||||
environment['input']['consumeKey'] = environment['input']['currShortcut'] != {} and environment['input']['consumeKey']
|
|
||||||
if (environment['input']['keyForeward'] and environment['input']['currShortcut'] == {}):
|
|
||||||
self.ignoreKeyRelease += 1
|
|
||||||
if self.ignoreKeyRelease >= 2: # a hack... has to bee done more clean
|
|
||||||
environment['input']['keyForeward'] = environment['input']['keyForeward'] and not environment['input']['currShortcut'] == {}
|
|
||||||
return environment, timeout
|
|
||||||
def grabDevices(self, environment):
|
def grabDevices(self, environment):
|
||||||
environment['runtime']['inputDriver'].grabDevices(environment)
|
environment['runtime']['inputDriver'].grabDevices(environment)
|
||||||
|
|
||||||
@ -42,6 +33,7 @@ class inputManager():
|
|||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while writeUInput",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"Error while writeUInput",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment, str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment, str(e),debug.debugLevel.ERROR)
|
||||||
return environment
|
return environment
|
||||||
|
|
||||||
def getShortcutString(self, environment):
|
def getShortcutString(self, environment):
|
||||||
if environment['input']['currShortcut'] == {}:
|
if environment['input']['currShortcut'] == {}:
|
||||||
return ''
|
return ''
|
||||||
|
@ -11,8 +11,6 @@ class input():
|
|||||||
self.iDevices = {}
|
self.iDevices = {}
|
||||||
self.uDevices = {}
|
self.uDevices = {}
|
||||||
self.getInputDevices()
|
self.getInputDevices()
|
||||||
self.grabDevices()
|
|
||||||
self.ignoreKeyRelease = 0
|
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
return environment
|
return environment
|
||||||
def shutdown(self, environment):
|
def shutdown(self, environment):
|
||||||
|
Loading…
Reference in New Issue
Block a user