diff --git a/src/fenrir-package/commands/50000-speak_incomming.py b/src/fenrir-package/commands/50000-speak_incomming.py new file mode 100644 index 00000000..533f2320 --- /dev/null +++ b/src/fenrir-package/commands/50000-speak_incomming.py @@ -0,0 +1,16 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and + environment['screenData']['newTTY'] == environment['screenData']['oldTTY']: + return environment + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], Interrupt=False) + print('50000-speak_incomming.py') + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py new file mode 100644 index 00000000..99ef269b --- /dev/null +++ b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py @@ -0,0 +1,20 @@ +#!/bin/python +import time +class command(): + def __init__(self): + pass + def run(self, environment): + if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\ + environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']: + return environment + if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].replace(" ","").replace("\n","").replace("\t","") == '': + environment['runtime']['outputManager'].presentText(environment, "blank") + else: + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']]) + + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py new file mode 100644 index 00000000..e1f9dfb8 --- /dev/null +++ b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py @@ -0,0 +1,19 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + #if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: + # return environment + if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']: + return environment + if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].replace(" ","").replace("\n","").replace("\t","") == '': + environment['runtime']['outputManager'].presentText(environment, "blank") + else: + environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass