32 lines
1.2 KiB
Python
Raw Normal View History

2016-08-07 17:00:54 +02:00
#!/bin/python
class command():
def __init__(self):
pass
def initialize(self, environment):
pass
def shutdown(self, environment):
pass
2016-09-17 02:14:11 +02:00
def getDescription(self, environment):
return ''
2016-09-17 02:14:11 +02:00
2016-08-07 17:00:54 +02:00
def run(self, environment):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'):
return
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'] == '':
return
2016-08-08 11:34:55 +02:00
# dont read TTY change
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
return
2016-08-08 11:34:55 +02:00
# its a cursor movement (experimental) - maybe also check current shortcut string?
2016-08-28 17:45:16 +02:00
if abs(environment['screenData']['newCursor']['x'] - environment['screenData']['oldCursor']['x']) >= 1:
if len(environment['screenData']['newDelta']) <= 5:
return
2016-08-08 11:34:55 +02:00
2016-08-07 17:00:54 +02:00
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False)
def setCallback(self, callback):
pass