From 2cd218f3e7915ba06171f78cb9cb0ca5e1ab11d1 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 21 Sep 2016 23:33:45 +0200 Subject: [PATCH] improve commands for new onScreenChanged trigger --- .../commands/onScreenUpdate/50000-char_echo.py | 3 --- .../commands/onScreenUpdate/60000-word_echo.py | 6 +----- .../commands/onScreenUpdate/62000-spell_check.py | 4 ---- .../commands/onScreenUpdate/65000-char_delete_echo.py | 4 ---- .../commands/onScreenUpdate/70000-incomming.py | 4 +--- .../commands/onScreenUpdate/75000-incomming_promote.py | 2 -- 6 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py b/src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py index 12a3e5eb..791bd01f 100644 --- a/src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py +++ b/src/fenrir-package/commands/onScreenUpdate/50000-char_echo.py @@ -22,9 +22,6 @@ class command(): # detect deletion or chilling if self.env['screenData']['newCursor']['x'] <= self.env['screenData']['oldCursor']['x']: return - # TTY Change - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return # is there any change? if self.env['screenData']['newDelta'] == '': return diff --git a/src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py b/src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py index a93af6b2..46e17c9e 100644 --- a/src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py +++ b/src/fenrir-package/commands/onScreenUpdate/60000-word_echo.py @@ -30,11 +30,7 @@ class command(): return if len(self.env['screenData']['newDelta']) > 1: return - - # TTY Change is no new word - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return - + # first place could not be the end of a word if self.env['screenData']['newCursor']['x'] == 0: return diff --git a/src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py b/src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py index 7c913e44..dfc9be99 100644 --- a/src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py +++ b/src/fenrir-package/commands/onScreenUpdate/62000-spell_check.py @@ -51,10 +51,6 @@ class command(): if len(self.env['screenData']['newDelta']) > 1: return - # TTY Change is no new word - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return - # first place could not be the end of a word if self.env['screenData']['newCursor']['x'] == 0: return diff --git a/src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py b/src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py index f3c87d6d..09531033 100644 --- a/src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py +++ b/src/fenrir-package/commands/onScreenUpdate/65000-char_delete_echo.py @@ -24,10 +24,6 @@ class command(): if self.env['screenData']['newCursor']['x'] >= self.env['screenData']['oldCursor']['x']: return - # TTY change - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return - # More than just a deletion happend if self.env['screenData']['newDelta'].strip() != '': if self.env['screenData']['newDelta'] != self.env['screenData']['oldDelta']: diff --git a/src/fenrir-package/commands/onScreenUpdate/70000-incomming.py b/src/fenrir-package/commands/onScreenUpdate/70000-incomming.py index d7f83aca..6d47c864 100644 --- a/src/fenrir-package/commands/onScreenUpdate/70000-incomming.py +++ b/src/fenrir-package/commands/onScreenUpdate/70000-incomming.py @@ -22,9 +22,7 @@ class command(): # is there something to read? if self.env['screenData']['newDelta'] == '': return - # dont read TTY change - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return + # its a cursor movement (experimental) - maybe also check current shortcut string? if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1: if len(self.env['screenData']['newDelta']) <= 5: diff --git a/src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py b/src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py index 0063c813..3ec3f43b 100644 --- a/src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py +++ b/src/fenrir-package/commands/onScreenUpdate/75000-incomming_promote.py @@ -22,8 +22,6 @@ class command(): return if self.env['runtime']['settingsManager'].getSetting('promote', 'list').strip(" \t\n") == '': return - if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']: - return if self.env['screenData']['newDelta'] == '': return if int(time.time() - self.env['input']['lastInputTime']) < self.env['runtime']['settingsManager'].getSettingAsInt('promote', 'inactiveTimeoutSec'):