diff --git a/config/settings/settings.cfg b/config/settings/settings.cfg index 2b9cc227..41758c90 100644 --- a/config/settings/settings.cfg +++ b/config/settings/settings.cfg @@ -21,8 +21,12 @@ layout=en ['screen] driver=linux -[general] +[keyboard] keyboardLayout=desktop +charEcho=False +wordEcho=True + +[general] debugLevel=0 punctuationLevel=1 diff --git a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py b/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py index 2cc8bc6f..b1c5be95 100644 --- a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py +++ b/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py @@ -4,6 +4,12 @@ class command(): def __init__(self): pass def run(self, environment): + print(environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') ) + if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\ + len(environment['screenData']['newDelta']) <= 2 and \ + environment['screenData']['newCursor'] != environment['screenData']['oldCursor']: + print('dri') + return environment if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ environment['screenData']['newTTY'] == environment['screenData']['oldTTY']: return environment diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index 5f9dc820..7499f803 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -29,5 +29,10 @@ settings = { 'keyboardLayout': "desktop", 'debugLevel': debug.debugLevel.DEACTIVE, 'punctuationLevel': 1 +}, +'keyboard':{ + 'keyboardLayout': "desktop", + 'charEcho':False, + 'wordEcho':True, } } diff --git a/src/fenrir-package/core/settingsManager.py b/src/fenrir-package/core/settingsManager.py index 2a145991..e7464a00 100644 --- a/src/fenrir-package/core/settingsManager.py +++ b/src/fenrir-package/core/settingsManager.py @@ -81,14 +81,27 @@ class settingsManager(): return value def getSettingAsInt(self, environment, section, setting): - return int(self.getSetting( environment, section, setting)) - + value = '' + try: + value = environment['settings'].getint(section, setting) + except: + value = self.settings[section][setting] + return value + def getSettingAsFloat(self, environment, section, setting): - return float(self.getSetting( environment, section, setting)) - + value = '' + try: + value = environment['settings'].getfloat(section, setting) + except: + value = self.settings[section][setting] + return value def getSettingAsBool(self, environment, section, setting): - return bool(self.getSetting(environment, section, setting)) - + value = '' + try: + value = environment['settings'].getboolean(section, setting) + except: + value = self.settings[section][setting] + return value def loadSpeechDriver(self, environment, driverName): if environment['runtime']['speechDriver'] != None: environment['runtime']['speechDriver'].shutdown()