fenrir/src/fenrir-package/commands/onScreenChanged/70000-incomming.py
2016-08-08 11:34:55 +02:00

27 lines
1.1 KiB
Python

#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'):
return environment
# is there something to read?
if environment['screenData']['newDelta'] == '':
return environment
# dont read TTY change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return environment
# its a cursor movement (experimental) - maybe also check current shortcut string?
if abs(environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x']) == 1:
if len(environment['screenData']['newDelta']) == 1:
return environment
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass