From e797d8dd9721f68169c2e988d59b005b8b77d09d Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 6 Aug 2016 04:47:41 +0200 Subject: [PATCH] add interrupt on keypress --- config/settings/settings.conf | 1 + src/fenrir-package/commands/onInput/10000-shut_up.py | 9 +++++---- src/fenrir-package/core/settings.py | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 482e233d..ccaa2813 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -24,6 +24,7 @@ driver=linux keyboardLayout=desktop charEcho=False wordEcho=False +interruptOnKeyPress=False [general] debugLevel=0 diff --git a/src/fenrir-package/commands/onInput/10000-shut_up.py b/src/fenrir-package/commands/onInput/10000-shut_up.py index dbc35088..6834699d 100644 --- a/src/fenrir-package/commands/onInput/10000-shut_up.py +++ b/src/fenrir-package/commands/onInput/10000-shut_up.py @@ -4,10 +4,11 @@ class command(): def __init__(self): pass def run(self, environment): - return environment - if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\ - environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: - return environment + if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'interruptOnKeyPress'): + return environment +# if environment['screenData']['newCursor'] == environment['screenData']['oldCursor'] and\ +# environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: +# return environment environment['runtime']['outputManager'].interruptOutput(environment) return environment def setCallback(self, callback): diff --git a/src/fenrir-package/core/settings.py b/src/fenrir-package/core/settings.py index 7499f803..cf2c9ad4 100644 --- a/src/fenrir-package/core/settings.py +++ b/src/fenrir-package/core/settings.py @@ -34,5 +34,6 @@ settings = { 'keyboardLayout': "desktop", 'charEcho':False, 'wordEcho':True, + 'interruptOnKeyPress': True, } }