initial say prev,curr,next line

This commit is contained in:
chrys
2016-07-13 21:40:19 +02:00
parent 311e653893
commit 333232d7ce
9 changed files with 38 additions and 22 deletions

View File

@ -29,6 +29,7 @@ class commandManager():
for cmd in sorted(environment['commands'][trigger]):
environment = environment['commands'][trigger][cmd].run(environment)
return environment
def executeCommand(self, environment, currCommand, section = 'commands'):
if self.isCommandDefined(environment):
try:
@ -38,7 +39,7 @@ class commandManager():
except:
pass
environment['commandInfo']['currCommand'] = ''
environment['commandInfo']['lastCommandTime'] = time.time()
environment['commandInfo']['lastCommandTime'] = time.time()
return environment
def executeNextCommand(self, environment):

View File

@ -11,19 +11,22 @@ class inputManager():
#for dev in self.devices.values(): print(dev)
def getKeyPressed(self, environment):
r, w, x = select(self.devices, [], [])
currShortcut = environment['input']['currShortcut']
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
try:
r, w, x = select(self.devices, [], [])
currShortcut = environment['input']['currShortcut']
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
except:
pass
environment['input']['currShortcut'] = currShortcut
environment['input']['currShortcutString'] = self.getShortcutString(environment)
return environment

View File

@ -4,13 +4,13 @@ screenData = {
'columns': 0,
'lines': 0,
'oldDelta': '',
'oldCursorReview':{'x':0,'y':0},
'oldCursorReview':{'x':-1,'y':-1},
'oldCursor':{'x':0,'y':0},
'oldContentBytes': b'',
'oldContentText': '',
'oldContentAttrib': b'',
'newDelta': '',
'newCursorReview':{'x':0,'y':0},
'newCursorReview':{'x':-1,'y':-1},
'newCursor':{'x':0,'y':0},
'newContentBytes': b'',
'newContentText': '',