diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index 7d8ae132..722fb607 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -9,6 +9,7 @@ 1-KEY_KP2=curr_char 1-KEY_KP1=prev_char 1-KEY_KP3=next_char +#=cursor_position 1-KEY_KPDOT=exit_review #=curr_screen #=curr_screen_before_cursor diff --git a/config/keyboard/laptop.conf b/config/keyboard/laptop.conf index 1d9d36d4..5857ddf7 100644 --- a/config/keyboard/laptop.conf +++ b/config/keyboard/laptop.conf @@ -10,6 +10,7 @@ 1-KEY_m=prev_char 1-KEY_DOT=next_char 1-KEY_SLASH=exit_review +#=cursor_position #=curr_screen #=curr_screen_before_cursor #=curr_screen_after_cursor diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 26bf5568..cc3b0cf3 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -10,6 +10,7 @@ 1-FENRIR,1-KEY_KP1=prev_char 1-FENRIR,1-KEY_KP3=next_char 1-FENRIR,1-KEY_KPDOT=exit_review +1-FENRIR,1-KEY_J=cursor_position #=curr_screen #=curr_screen_before_cursor #=curr_screen_after_cursor diff --git a/src/fenrir-package/commands/commands/curr_screen_after_cursor.py b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py index 9dc3f779..957ee298 100644 --- a/src/fenrir-package/commands/commands/curr_screen_after_cursor.py +++ b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py @@ -7,7 +7,7 @@ class command(): pass def run(self, environment): # Prefer review cursor over text cursor - if (environment['screenData']['newCursorReview'] != None) + if (environment['screenData']['newCursorReview'] != None): cursorPos = environment['screenData']['newCursorReview'].copy() else: cursorPos = environment['screenData']['newCursor'].copy() diff --git a/src/fenrir-package/commands/commands/curr_screen_before_cursor.py b/src/fenrir-package/commands/commands/curr_screen_before_cursor.py index 2d7d62e3..dab8db4b 100644 --- a/src/fenrir-package/commands/commands/curr_screen_before_cursor.py +++ b/src/fenrir-package/commands/commands/curr_screen_before_cursor.py @@ -7,7 +7,7 @@ class command(): pass def run(self, environment): # Prefer review cursor over text cursor - if (environment['screenData']['newCursorReview'] != None) + if (environment['screenData']['newCursorReview'] != None): cursorPos = environment['screenData']['newCursorReview'].copy() else: cursorPos = environment['screenData']['newCursor'].copy() diff --git a/src/fenrir-package/commands/commands/cursor_position.py b/src/fenrir-package/commands/commands/cursor_position.py new file mode 100644 index 00000000..f26cb70d --- /dev/null +++ b/src/fenrir-package/commands/commands/cursor_position.py @@ -0,0 +1,20 @@ +#!/bin/python + + +class command(): + def __init__(self): + pass + def run(self, environment): + # Prefer review cursor over text cursor + + if (environment['screenData']['newCursorReview'] != None): + cursorPos = environment['screenData']['newCursorReview'].copy() + else: + cursorPos = environment['screenData']['newCursor'].copy() + + environment['runtime']['outputManager'].presentText(environment, "line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/commands/remove_marks.py b/src/fenrir-package/commands/commands/remove_marks.py index 516aca33..cd35b41a 100644 --- a/src/fenrir-package/commands/commands/remove_marks.py +++ b/src/fenrir-package/commands/commands/remove_marks.py @@ -12,4 +12,4 @@ class command(): def setCallback(self, callback): pass def shutdown(self): -pass + pass diff --git a/src/fenrir-package/core/commandManager.py b/src/fenrir-package/core/commandManager.py index c5e27e7d..f71c3222 100644 --- a/src/fenrir-package/core/commandManager.py +++ b/src/fenrir-package/core/commandManager.py @@ -24,6 +24,7 @@ class commandManager(): spec.loader.exec_module(command_mod) environment['commands'][section][fileName] = command_mod.command() except Exception as e: + print(e) environment['runtime']['debug'].writeDebugOut(environment,"Error while loading command:" + currCommand ,debug.debugLevel.ERROR) environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR) continue