major rework, performance boost and bigger accuracy

This commit is contained in:
chrys
2016-08-06 04:34:37 +02:00
parent 7f8a03ae6c
commit 6373b3d8b8
12 changed files with 37 additions and 58 deletions

View File

@ -4,6 +4,7 @@ class command():
def __init__(self):
pass
def run(self, environment):
return environment
if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\
environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
return environment

View File

@ -1,21 +0,0 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']:
return environment
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
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):
pass
def shutdown(self):
pass

View File

@ -4,6 +4,9 @@ class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\
environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']:
return environment
@ -11,7 +14,7 @@ class command():
pass
#environment['runtime']['outputManager'].presentText(environment, "blank",True)
else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],True)
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],interrupt=True)
return environment
def setCallback(self, callback):

View File

@ -4,6 +4,7 @@ class command():
def __init__(self):
pass
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
return environment
if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']:

View File

@ -4,6 +4,7 @@ class command():
def __init__(self):
pass
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho'):
return environment
if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:

View File

@ -5,7 +5,7 @@ class command():
def __init__(self):
pass
def run(self, environment):
return environment
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho') and\
environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:
return environment
@ -22,7 +22,7 @@ class command():
if environment['screenData']['newCursor']['x'] > 0 and \
newContent[environment['screenData']['newCursor']['x'] - 1] == ' ':
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
print('word')
return environment
def setCallback(self, callback):
pass

View File

@ -4,16 +4,16 @@ 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
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], soundIconName='', interrupt=ttyChanged)
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
return environment
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False)
return environment
def setCallback(self, callback):
pass