threading test
This commit is contained in:
@ -27,11 +27,11 @@ class commandManager():
|
||||
|
||||
def executeCommand(self, environment, currCommand, section = 'commands'):
|
||||
if self.isCommandDefined(environment):
|
||||
#try:
|
||||
environ = environment['commands'][section][currCommand].run(environment)
|
||||
if environ != None:
|
||||
environment = environ
|
||||
#except:
|
||||
try:
|
||||
environ = environment['commands'][section][currCommand].run(environment)
|
||||
if environ != None:
|
||||
environment = environ
|
||||
except:
|
||||
pass
|
||||
environment['commandInfo']['currCommand'] = ''
|
||||
return environment
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/python
|
||||
#from commands import curr_line
|
||||
#from commands import shut_up
|
||||
import time
|
||||
|
||||
commandInfo = {
|
||||
'currCommand': '',
|
||||
'commandCueue':[]
|
||||
'commandCueue':[],
|
||||
'lastCommandTime': time.time()
|
||||
}
|
||||
|
||||
commands = {
|
||||
|
@ -11,15 +11,19 @@ class inputManager():
|
||||
#for dev in self.devices.values(): print(dev)
|
||||
|
||||
def getKeyPressed(self, environment):
|
||||
r, w, x = select(self.devices, [], [])
|
||||
r, w, x = select(self.devices, [], [],0)
|
||||
currShortcut = environment['input']['currShortcut']
|
||||
for fd in r:
|
||||
for event in self.devices[fd].read():
|
||||
if event.type == evdev.ecodes.EV_KEY:
|
||||
if event.value != 0:
|
||||
currShortcut[str(event.code)] = event.value
|
||||
else:
|
||||
del(currShortcut[str(event.code)])
|
||||
if r != []:
|
||||
for fd in r:
|
||||
for event in self.devices[fd].read():
|
||||
if event.type == evdev.ecodes.EV_KEY:
|
||||
if event.value != 0:
|
||||
currShortcut[str(event.code)] = event.value
|
||||
else:
|
||||
try:
|
||||
del(currShortcut[str(event.code)])
|
||||
except:
|
||||
pass
|
||||
environment['input']['currShortcut'] = currShortcut
|
||||
environment['input']['currShortcutString'] = self.getShortcutString(environment)
|
||||
return environment
|
||||
|
Reference in New Issue
Block a user