diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index 88311c8a..99f2e789 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -31,6 +31,7 @@ KEY_FENRIR,KEY_KPDOT=exit_review KEY_FENRIR,KEY_KP5=curr_screen KEY_FENRIR,KEY_KP8=curr_screen_before_cursor KEY_FENRIR,KEY_KP2=curr_screen_after_cursor +#=cursor_read_to_end_of_line #=cursor_column #=cursor_lineno KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1 diff --git a/config/keyboard/laptop.conf b/config/keyboard/laptop.conf index 106c958e..7b19304f 100644 --- a/config/keyboard/laptop.conf +++ b/config/keyboard/laptop.conf @@ -30,6 +30,7 @@ KEY_FENRIR,KEY_SHIFT,KEY_DOT=cursor_position KEY_FENRIR,KEY_SHIFT,KEY_K=curr_screen KEY_FENRIR,KEY_SHIFT,KEY_I=curr_screen_before_cursor KEY_FENRIR,KEY_SHIFT,KEY_COMMA=curr_screen_after_cursor +#=cursor_read_to_end_of_line #=cursor_column #=cursor_lineno KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1 diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 3c97a015..c882114d 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -31,6 +31,7 @@ KEY_FENRIR,KEY_KPDOT=exit_review KEY_FENRIR,KEY_KP5=curr_screen #KEY_FENRIR,KEY_KP8=curr_screen_before_cursor #KEY_FENRIR,KEY_KP2=curr_screen_after_cursor +#=cursor_read_to_end_of_line KEY_FENRIR,KEY_KP2=cursor_column KEY_FENRIR,KEY_KP8=cursor_lineno KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1 diff --git a/src/fenrir/commands/commands/cursor_read_to_end_of_line.py b/src/fenrir/commands/commands/cursor_read_to_end_of_line.py new file mode 100644 index 00000000..ba4c2eb5 --- /dev/null +++ b/src/fenrir/commands/commands/cursor_read_to_end_of_line.py @@ -0,0 +1,33 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +# Fenrir TTY screen reader +# By Chrys, Storm Dragon, and contributers. + +from core import debug +from utils import line_utils + +class command(): + def __init__(self): + pass + def initialize(self, environment): + self.env = environment + def shutdown(self): + pass + def getDescription(self): + return 'read to end of line, use review cursor if you are in reviewmode, otherwhise use text cursor' + + def run(self): + cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() + + x, y, currLine = \ + line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText']) + + if currLine.isspace(): + self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) + else: + self.env['runtime']['outputManager'].presentText(currLine[cursorPos['x']], interrupt=True) + self.env['runtime']['outputManager'].announceActiveCursor() + def setCallback(self, callback): + pass +