From 03722148f82e52fe21d141b9d4c36dba5d5fbfba Mon Sep 17 00:00:00 2001 From: Chrys Date: Wed, 3 Aug 2016 19:43:23 +0200 Subject: [PATCH] initial rebuild of onInput commands --- TODO | 3 ++- .../commands/onInput/70000-speak_incomming.py | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index fb60b730..88c25a60 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ ToDos in Priority order: -- soundIcons - implement commands set_copy_begin_mark set_copy_end_mark @@ -119,6 +118,8 @@ except KeyboardInterrupt: https://github.com/seb-m/pyinotify/wiki/Tutorial http://www.saltycrane.com/blog/2010/04/monitoring-filesystem-python-and-pyinotify/ +- soundIcons + - default soundIcon theme (soundfiles) - implement commands curr_word diff --git a/src/fenrir-package/commands/onInput/70000-speak_incomming.py b/src/fenrir-package/commands/onInput/70000-speak_incomming.py index de918995..4bf968ec 100644 --- a/src/fenrir-package/commands/onInput/70000-speak_incomming.py +++ b/src/fenrir-package/commands/onInput/70000-speak_incomming.py @@ -4,17 +4,15 @@ class command(): def __init__(self): pass def run(self, environment): - if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\ - environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x'] == 1: + if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']: return environment - ttyChanged = environment['screenData']['newTTY'] != environment['screenData']['oldTTY'] - if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ - not ttyChanged: + if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: return environment - if ttyChanged: - environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY') - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=ttyChanged) + if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: + return environment + + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True) return environment def setCallback(self, callback):