diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf index ffb2f220..0b43b53c 100644 --- a/config/settings/espeak.settings.conf +++ b/config/settings/espeak.settings.conf @@ -92,6 +92,8 @@ charDeleteEcho=True wordEcho=True # interrupt speech on any keypress interruptOnKeyPress=True +# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) +interruptOnKeyPressFilter= # timeout for double tap in sec doubleTapTimeout=0.2 diff --git a/config/settings/settings.conf b/config/settings/settings.conf index ab0b2203..019fff66 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -93,6 +93,8 @@ charDeleteEcho=True wordEcho=False # interrupt speech on any keypress interruptOnKeyPress=False +# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) +interruptOnKeyPressFilter= # timeout for double tap in sec doubleTapTimeout=0.2 diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys index a44059f7..a9c76780 100644 --- a/config/settings/settings.conf.chrys +++ b/config/settings/settings.conf.chrys @@ -92,6 +92,8 @@ charDeleteEcho=True wordEcho=False # interrupt speech on any keypress interruptOnKeyPress=False +# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) +interruptOnKeyPressFilter= # timeout for double tap in sec doubleTapTimeout=0.2 diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 947b2ef6..6f4f2e42 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -43,6 +43,8 @@ charEcho=False charDeleteEcho=True wordEcho=False interruptOnKeyPress=True +# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) +interruptOnKeyPressFilter= # timeout for double tap in sec doubleTapTimeout=0.2 diff --git a/src/fenrir/commands/onInput/10000-shut_up.py b/src/fenrir/commands/onInput/10000-shut_up.py index b2ba6fa6..db9d82ef 100644 --- a/src/fenrir/commands/onInput/10000-shut_up.py +++ b/src/fenrir/commands/onInput/10000-shut_up.py @@ -22,8 +22,14 @@ class command(): if self.env['runtime']['inputManager'].noKeyPressed(): return if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']): - return - if self.environment['runtime']['screenManager'].isScreenChange(): + return + if len(self.env['input']['currInput']) != 1: + return + # if the filter is set + if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '': + if not self.env['input']['currInput'][0] in self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(','): + return + if self.env['runtime']['screenManager'].isScreenChange(): return self.env['runtime']['outputManager'].interruptOutput() diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index 1b9008cf..f12ad15a 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -87,6 +87,7 @@ settings = { 'charDeleteEcho': True, 'wordEcho': True, 'interruptOnKeyPress': True, + 'interruptOnKeyPressFilter': '', 'doubleTapTimeout': 0.2, } }