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

@ -14,11 +14,11 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return _('Move review to the bottom of the screen')
return _('Move review to the bottom of the screen')
def run(self):
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):
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