27 lines
1.1 KiB
Python
Raw Normal View History

2016-08-07 17:00:54 +02:00
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'):
return environment
2016-08-08 11:34:55 +02:00
# is there something to read?
2016-08-07 17:00:54 +02:00
if environment['screenData']['newDelta'] == '':
2016-08-08 11:34:55 +02:00
return environment
# dont read TTY change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
2016-08-07 17:00:54 +02:00
return environment
2016-08-08 11:34:55 +02:00
# 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
2016-08-07 17:00:54 +02:00
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False)
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass