fix double presentation of key echo

This commit is contained in:
chrys 2016-08-08 11:34:55 +02:00
parent 629fa3576c
commit 79c650577f
3 changed files with 10 additions and 5 deletions

View File

@ -31,7 +31,7 @@ class command():
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
return environment
print('word')
if currWord != '':
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)

View File

@ -6,12 +6,17 @@ class command():
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'):
return environment
# is there something to read?
if environment['screenData']['newDelta'] == '':
return environment
# dont read TTY change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
if environment['screenData']['newDelta'] == '':
return environment
# its a cursor movement (experimental) - maybe also check current shortcut string?
if abs(environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x']) == 1:
if len(environment['screenData']['newDelta']) == 1:
return environment
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False)
return environment