diff --git a/src/fenrir-package/commands/onInput/10000-shut_up.py b/src/fenrir-package/commands/onInput/10000-shut_up.py index 171676b2..11e786ef 100644 --- a/src/fenrir-package/commands/onInput/10000-shut_up.py +++ b/src/fenrir-package/commands/onInput/10000-shut_up.py @@ -19,8 +19,6 @@ class command(): def run(self): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'): return - if self.env['runtime']['inputManager'].noKeyPressed(): - return if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: return diff --git a/src/fenrir-package/commands/onInput/50000-char_echo.py b/src/fenrir-package/commands/onInput/50000-char_echo.py index 9ed4232f..0c20e4ca 100644 --- a/src/fenrir-package/commands/onInput/50000-char_echo.py +++ b/src/fenrir-package/commands/onInput/50000-char_echo.py @@ -17,6 +17,8 @@ class command(): return 'No Description found' def run(self): + if self.env['runtime']['inputManager'].noKeyPressed(): + return if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'): return # detect deletion or chilling diff --git a/src/fenrir-package/commands/onInput/54000-present_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/54000-present_char_if_cursor_change_horizontal.py index e04aa7a0..b83246af 100644 --- a/src/fenrir-package/commands/onInput/54000-present_char_if_cursor_change_horizontal.py +++ b/src/fenrir-package/commands/onInput/54000-present_char_if_cursor_change_horizontal.py @@ -17,9 +17,10 @@ class command(): return '' def run(self): - # TTY Change + if self.env['runtime']['inputManager'].noKeyPressed(): + return if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return + return if self.env['runtime']['inputManager'].noKeyPressed(): return # detect an change on the screen, we just want to cursor arround, so no change should appear diff --git a/src/fenrir-package/commands/onInput/55000-present_line_if_cursor_change_vertical.py b/src/fenrir-package/commands/onInput/55000-present_line_if_cursor_change_vertical.py index 6171d0df..acda3aa3 100644 --- a/src/fenrir-package/commands/onInput/55000-present_line_if_cursor_change_vertical.py +++ b/src/fenrir-package/commands/onInput/55000-present_line_if_cursor_change_vertical.py @@ -17,6 +17,8 @@ class command(): return '' def run(self): + if self.env['runtime']['inputManager'].noKeyPressed(): + return if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: return if self.env['screenData']['newDelta'] != self.env['screenData']['oldDelta']: diff --git a/src/fenrir-package/commands/onInput/60000-word_echo.py b/src/fenrir-package/commands/onInput/60000-word_echo.py index 46e17c9e..3526352a 100644 --- a/src/fenrir-package/commands/onInput/60000-word_echo.py +++ b/src/fenrir-package/commands/onInput/60000-word_echo.py @@ -18,6 +18,8 @@ class command(): return 'No Description found' def run(self): + if self.env['runtime']['inputManager'].noKeyPressed(): + return if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): return diff --git a/src/fenrir-package/commands/onInput/62000-spell_check.py b/src/fenrir-package/commands/onInput/62000-spell_check.py index dfc9be99..40d561a2 100644 --- a/src/fenrir-package/commands/onInput/62000-spell_check.py +++ b/src/fenrir-package/commands/onInput/62000-spell_check.py @@ -30,6 +30,8 @@ class command(): self.language = self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage') def run(self): + if self.env['runtime']['inputManager'].noKeyPressed(): + return if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'): return diff --git a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py index 8fada66f..72250f48 100644 --- a/src/fenrir-package/commands/onInput/65000-char_delete_echo.py +++ b/src/fenrir-package/commands/onInput/65000-char_delete_echo.py @@ -17,6 +17,8 @@ class command(): return 'No Description found' def run(self): + if self.env['runtime']['inputManager'].noKeyPressed(): + return if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'): return diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 813232b4..00356a55 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -36,13 +36,9 @@ class fenrir(): def handleProcess(self): eventReceived = self.environment['runtime']['inputManager'].getInputEvent() - + startTime = time.time() if eventReceived: self.prepareCommand() - #if not (self.environment['runtime']['inputManager'].isConsumeInput() or \ - # self.environment['runtime']['inputManager'].isFenrirKeyPressed()) and \ - # not self.environment['runtime']['commandManager'].isCommandQueued(): - if not (self.wasCommand or self.environment['runtime']['inputManager'].isFenrirKeyPressed() or self.environment['generalInformation']['tutorialMode']): self.environment['runtime']['inputManager'].writeEventBuffer() if self.environment['runtime']['inputManager'].noKeyPressed(): @@ -55,7 +51,7 @@ class fenrir(): self.environment['input']['keyForeward'] -=1 self.environment['input']['prevDeepestInput'] = [] self.environment['runtime']['screenManager'].update() - + self.environment['runtime']['commandManager'].executeDefaultTrigger('onInput') else: self.environment['runtime']['screenManager'].update() @@ -72,12 +68,13 @@ class fenrir(): self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate') self.handleCommands() + #print(time.time()-startTime) def prepareCommand(self): if self.environment['input']['keyForeward'] > 0: return shortcut = self.environment['runtime']['inputManager'].getCurrShortcut() - print(shortcut) + #print(shortcut) command = self.environment['runtime']['inputManager'].getCommandForShortcut(shortcut) self.environment['runtime']['commandManager'].queueCommand(command) if len(self.environment['input']['prevDeepestInput']) < len(self.environment['input']['currInput']):