diff --git a/config/settings/settings.conf b/config/settings/settings.conf index f2a1d865..7ee045d7 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -23,6 +23,7 @@ driver=linux [keyboard] keyboardLayout=desktop charEcho=False +charDeleteEcho=True wordEcho=True interruptOnKeyPress=False diff --git a/src/fenrir-package/commands/onScreenChanged/65000-speak_key_echo.py b/src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/65000-speak_key_echo.py rename to src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py diff --git a/src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py b/src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py similarity index 100% rename from src/fenrir-package/commands/onScreenChanged/69000-speak_word_echo.py rename to src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py diff --git a/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py b/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py new file mode 100644 index 00000000..4ae3dc45 --- /dev/null +++ b/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py @@ -0,0 +1,31 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + + if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charDeleteEcho'): + return environment + # detect typing + if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']: + return environment + # TTY change + if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: + return environment + # More than just a deletion happend + if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: + return environment + # No deletion + if environment['screenData']['newNegativeDelta'] == environment['screenData']['oldNegativeDelta']: + return environment + if environment['screenData']['newNegativeDelta'] == '': + return environment + + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newNegativeDelta'], interrupt=True) + + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index cf2c9ad4..5c3fec4e 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -33,6 +33,7 @@ settings = { 'keyboard':{ 'keyboardLayout': "desktop", 'charEcho':False, + 'charDeleteEcho':True, 'wordEcho':True, 'interruptOnKeyPress': True, }