initial rebuild of onInput commands
This commit is contained in:
parent
03722148f8
commit
592be62188
24
src/fenrir-package/commands/onInput/65000-speak_key_echo.py
Normal file
24
src/fenrir-package/commands/onInput/65000-speak_key_echo.py
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/python
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho'):
|
||||
return environment
|
||||
if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:
|
||||
return environment
|
||||
|
||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||
return environment
|
||||
|
||||
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):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
30
src/fenrir-package/commands/onInput/69000-speak_word_echo.py
Normal file
30
src/fenrir-package/commands/onInput/69000-speak_word_echo.py
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/python
|
||||
from utils import word_utils
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho') and\
|
||||
environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']:
|
||||
return environment
|
||||
|
||||
if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
|
||||
return environment
|
||||
|
||||
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']:
|
||||
return environment
|
||||
|
||||
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursorReview']['x'], 0, newContent)
|
||||
|
||||
if environment['screenData']['newCursor']['x'] > 0 and \
|
||||
newContent[environment['screenData']['newCursor']['x'] - 1] == ' ':
|
||||
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
@ -0,0 +1,17 @@
|
||||
#!/bin/python
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
if environment['screenData']['newTTY'] == environment['screenData']['oldTTY']:
|
||||
return environment
|
||||
environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY')
|
||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
Loading…
Reference in New Issue
Block a user