initial rebuild of onInput commands

This commit is contained in:
Chrys
2016-08-03 19:43:23 +02:00
parent aa3cea9b2e
commit 03722148f8
2 changed files with 8 additions and 9 deletions

View File

@ -4,17 +4,15 @@ class command():
def __init__(self):
pass
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\
environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x'] == 1:
if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']:
return environment
ttyChanged = environment['screenData']['newTTY'] != environment['screenData']['oldTTY']
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \
not ttyChanged:
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
if ttyChanged:
environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY')
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=ttyChanged)
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
return environment
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True)
return environment
def setCallback(self, callback):