diff --git a/config/settings/settings.conf b/config/settings/settings.conf index ccaa2813..f2a1d865 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -23,7 +23,7 @@ driver=linux [keyboard] keyboardLayout=desktop charEcho=False -wordEcho=False +wordEcho=True interruptOnKeyPress=False [general] diff --git a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py new file mode 100644 index 00000000..35080cd9 --- /dev/null +++ b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py @@ -0,0 +1,24 @@ +#!/bin/python +import time +class command(): + def __init__(self): + pass + def run(self, environment): + if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: + return 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 + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip(" \t\n") == '': + 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']],interrupt=True) + + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py new file mode 100644 index 00000000..08391870 --- /dev/null +++ b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py @@ -0,0 +1,21 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: + return environment + if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: + return environment + if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']: + return environment + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '': + environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True) + else: + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py b/src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py index 045e8340..e3696095 100644 --- a/src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py +++ b/src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py @@ -5,29 +5,34 @@ class command(): def __init__(self): pass def run(self, environment): - #return environment if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho'): return environment + # just when typing is a new word if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']: return environment + # TTY Change is no new word if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: return environment + # here we just arrow arround (left right) no changes if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ - environment['screenData']['newNegativeDelta'] == '': + environment['screenData']['newNegativeDelta'] == '': + return environment + # this is not the end of the word + if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ + environment['screenData']['newNegativeDelta'] != ' ': return environment + # japp its a finished word... announce it:x newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']] x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent) - print('|',environment['screenData']['newNegativeDelta'] ,'|',len(currWord) + x + 2, environment['screenData']['newCursor']['x'],'|',newContent[environment['screenData']['newCursor']['x'] - 1],'|',x, y, currWord) - print(newContent ) - #len(currWord) + x + 2 == environment['screenData']['newCursor']['x']: + 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