diff --git a/config/settings/settings.cfg b/config/settings/settings.cfg index 41758c90..2920ee87 100644 --- a/config/settings/settings.cfg +++ b/config/settings/settings.cfg @@ -23,7 +23,7 @@ driver=linux [keyboard] keyboardLayout=desktop -charEcho=False +charEcho=True wordEcho=True [general] diff --git a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py b/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py index 6ec9c4f5..78d5bf5a 100644 --- a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py +++ b/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py @@ -5,13 +5,13 @@ class command(): pass def run(self, environment): if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho') and\ - #len(environment['screenData']['newDelta']) <= 2 and \ - environment['screenData']['newCursor'] != environment['screenData']['oldCursor']: + environment['screenData']['newCursor'] - environment['screenData']['oldCursor'] ==1: return environment + ttyChanged = environment['screenData']['newTTY'] != environment['screenData']['oldTTY'] if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ - environment['screenData']['newTTY'] == environment['screenData']['oldTTY']: + not ttyChanged: return environment - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'],False) + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], ttyChanged) return environment def setCallback(self, callback): pass diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 2e5d5bb7..2fb32e3c 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -21,9 +21,9 @@ class fenrir(): signal.signal(signal.SIGINT, self.captureSignal) def proceed(self): - self.threadonInput.start() - while(self.environment['generalInformation']['running']): - self.updateScreen() + #self.threadonInput.start() + #while(self.environment['generalInformation']['running']): + self.onInput() self.shutdown() def onInput(self): @@ -49,8 +49,8 @@ class fenrir(): time.sleep(0.5) def handleCommands(self): - if (self.environment['commandInfo']['currCommand'] != '') and \ - (time.time() - self.environment['commandInfo']['lastCommandTime'] >= 0.01): + if (self.environment['commandInfo']['currCommand'] != ''):# and \ +# (time.time() - self.environment['commandInfo']['lastCommandTime'] >= 0.01): self.environment = self.environment['runtime']['commandManager'].executeCommand(self.environment, self.environment['commandInfo']['currCommand'], 'commands') def shutdown(self): diff --git a/src/fenrir-package/screen/linux.py b/src/fenrir-package/screen/linux.py index bedeb0d9..e0b49a47 100644 --- a/src/fenrir-package/screen/linux.py +++ b/src/fenrir-package/screen/linux.py @@ -4,7 +4,6 @@ import difflib import textwrap import time -import re #import fenrir.utils.debug class screen(): @@ -13,12 +12,13 @@ class screen(): self.textWrapper = textwrap.TextWrapper() self.textWrapper.drop_whitespace = False def analyzeScreen(self, environment, trigger='updateScreen'): - # read screen - currTTY = open('/sys/devices/virtual/tty/tty0/active','r') - newTTY = currTTY.read()[3:-1] - currTTY.close() - newContentBytes = b'' + newTTY = '' + newContentBytes = b'' try: + # read screen + currTTY = open('/sys/devices/virtual/tty/tty0/active','r') + newTTY = currTTY.read()[3:-1] + currTTY.close() vcsa = open(self.vcsaDevicePath + newTTY,'rb',0) newContentBytes = vcsa.read() vcsa.close() @@ -26,11 +26,7 @@ class screen(): return environment except: return environment - if trigger != 'onInput' and False: # so we already moved the cursor and is not input -> screenUpdate was faster - if ((newContentBytes[2] != environment['screenData']['newCursor']['x']) or\ - (newContentBytes[3] != environment['screenData']['newCursor']['y'])) and\ - (newTTY == environment['screenData']['newTTY']): - return environment + # set new "old" values environment['screenData']['oldContentBytes'] = environment['screenData']['newContentBytes'] environment['screenData']['oldContentText'] = environment['screenData']['newContentText']