add more navigation commands and update speakup layout

This commit is contained in:
Chrys 2022-07-13 16:33:16 +02:00
parent cc4e0915dd
commit cb6b66b400
5 changed files with 66 additions and 4 deletions

View File

@ -32,6 +32,8 @@ KEY_FENRIR,KEY_KP5=curr_screen
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
#=cursor_read_to_end_of_line #=cursor_read_to_end_of_line
#=review_screen_last_char
#=review_screen_first_char
#=cursor_column #=cursor_column
#=cursor_lineno #=cursor_lineno
#=braille_flush #=braille_flush

View File

@ -79,10 +79,10 @@ KEY_FENRIR,KEY_KP9=review_bottom
KEY_FENRIR,KEY_KP3=review_top KEY_FENRIR,KEY_KP3=review_top
# InsKeyPad-7 Move reading cursor to left edge of screen (insert home) # InsKeyPad-7 Move reading cursor to left edge of screen (insert home)
# TODO KEY_FENRIR,KEY_KP7=review_screen_first_char
# InsKeyPad-1 Move reading cursor to right edge of screen (insert end) # InsKeyPad-1 Move reading cursor to right edge of screen (insert end)
# TODO KEY_FENRIR,KEY_KP1=review_screen_last_char
# ControlKeyPad-1 Move reading cursor to last character on current line. # ControlKeyPad-1 Move reading cursor to last character on current line.
KEY_CTRL,KEY_KP1=review_line_end KEY_CTRL,KEY_KP1=review_line_end

View File

@ -14,11 +14,11 @@ class command():
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Move review to the bottom of the screen') return _('Move review to the bottom of the screen')
def run(self): def run(self):
self.env['screen']['newCursorReview'] = { 'x': 0, 'y':self.env['screen']['lines'] -1} self.env['screen']['newCursorReview'] = { 'x': 0, 'y':self.env['screen']['lines'] -1}
self.env['runtime']['outputManager'].presentText(_("Bottom"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("Bottom"), interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -0,0 +1,30 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import char_utils
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('Move Review to the first character on the screen (left top)')
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(0 ,0)
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], lastChar = \
char_utils.getLastCharInLine(self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
self.env['runtime']['outputManager'].presentText(_("first character in screen"), interrupt=False)
def setCallback(self, callback):
pass

View File

@ -0,0 +1,30 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import char_utils
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return _('Move Review to the last character on the screen (right bottom)')
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screen']['columns']-1 ,self.env['screen']['lines']-1)
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], lastChar = \
char_utils.getLastCharInLine(self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
self.env['runtime']['outputManager'].presentText(_("last character in screen"), interrupt=False)
def setCallback(self, callback):
pass