more work on speakup layout

This commit is contained in:
Chrys 2022-07-13 16:13:10 +02:00
parent 85e52bfe21
commit cc4e0915dd
6 changed files with 156 additions and 29 deletions

View File

@ -38,6 +38,7 @@ KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
#=braille_return_to_cursor #=braille_return_to_cursor
#=braille_pan_left #=braille_pan_left
#=braille_pan_right #=braille_pan_right
#=cursor_read_line_to_cursor
KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1 KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1
KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1 KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1
KEY_FENRIR,KEY_1=bookmark_1 KEY_FENRIR,KEY_1=bookmark_1

View File

@ -83,6 +83,7 @@ KEY_FENRIR,KEY_ENTER=toggle_auto_read
KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time
KEY_FENRIR,KEY_Y=toggle_highlight_tracking KEY_FENRIR,KEY_Y=toggle_highlight_tracking
#=toggle_barrier #=toggle_barrier
#=cursor_read_line_to_cursor
KEY_FENRIR,KEY_Q=quit_fenrir KEY_FENRIR,KEY_Q=quit_fenrir
KEY_FENRIR,KEY_T=time KEY_FENRIR,KEY_T=time
2,KEY_FENRIR,KEY_T=date 2,KEY_FENRIR,KEY_T=date

View File

@ -1,39 +1,135 @@
# this speakup bindings are work in progress, if you find incompatibilitys report it to fenrir github issue tracker # Fenrir comment: copy of speakup DefaultKeyAssignments converted to fenrir syntax
# Fenrir comment: https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/drivers/staging/speakup/DefaultKeyAssignments
# Fenrir comment: The insert or shift key named below is the fenrir key
# This file is intended to give you an overview of the default keys used
# by speakup for it's review functions. You may change them to be
# anything you want but that will take some familiarity with key
# mapping.
# We have remapped the insert or zero key on the keypad to act as a
# shift key. Well, actually as an altgr key. So in the following list
# InsKeyPad-period means hold down the insert key like a shift key and
# hit the keypad period.
# KeyPad-8 Say current Line
KEY_KP8=review_curr_line
# InsKeyPad-8 say from top of screen to reading cursor.
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
# KeyPad-7 Say Previous Line (UP one line)
KEY_KP7=review_prev_line
# KeyPad-9 Say Next Line (down one line)
KEY_KP9=review_next_line
# KeyPad-5 Say Current Word
KEY_KP5=review_curr_word
# InsKeyPad-5 Spell Current Word
KEY_FENRIR,KEY_KP5=review_curr_word_phonetic
# KeyPad-4 Say Previous Word (left one word)
KEY_KP4=review_prev_word
# InsKeyPad-4 say from left edge of line to reading cursor.
KEY_FENRIR,KEY_KP4=cursor_read_line_to_cursor
# KeyPad-6 Say Next Word (right one word)
KEY_KP6=review_next_word
# InsKeyPad-6 Say from reading cursor to right edge of line.
KEY_FENRIR,KEY_KP6=cursor_read_to_end_of_line
# KeyPad-2 Say Current Letter
KEY_KP2=review_curr_char
# InsKeyPad-2 say current letter phonetically
KEY_FENRIR,KEY_KP2=review_curr_char_phonetic
# KeyPad-1 Say Previous Character (left one letter)
KEY_KP1=review_prev_char
# KeyPad-3 Say Next Character (right one letter)
KEY_KP3=review_next_char
# KeyPad-plus Say Entire Screen
KEY_KPPLUS=curr_screen
# InsKeyPad-plus Say from reading cursor line to bottom of screen.
KEY_FENRIR,KEY_KPPLUS=curr_screen_after_cursor
# KeyPad-Minus Park reading cursor (toggle)
# TODO
# InsKeyPad-minus Say character hex and decimal value.
# TODO
# KeyPad-period Say Position (current line, position and console)
KEY_KPDOT=cursor_position
# InsKeyPad-period say colour attributes of current position.
KEY_FENRIR,KEY_KPDOT=attribute_cursor
# InsKeyPad-9 Move reading cursor to top of screen (insert pgup)
KEY_FENRIR,KEY_KP9=review_bottom
# InsKeyPad-3 Move reading cursor to bottom of screen (insert pgdn)
KEY_FENRIR,KEY_KP3=review_top
# InsKeyPad-7 Move reading cursor to left edge of screen (insert home)
# TODO
# InsKeyPad-1 Move reading cursor to right edge of screen (insert end)
# TODO
# ControlKeyPad-1 Move reading cursor to last character on current line.
KEY_CTRL,KEY_KP1=review_line_end
# KeyPad-Enter Shut Up (until another key is hit) and sync reading cursor
KEY_KPENTER=temp_disable_speech
# InsKeyPad-Enter Shut Up (until toggled back on).
KEY_FENRIR,KEY_KPENTER=toggle_speech
# InsKeyPad-star n<x|y> go to line (y) or column (x). Where 'n' is any
# allowed value for the row or column for your current screen.
# TODO
# KeyPad-/ Mark and Cut screen region.
KEY_KPSLASH=copy_marked_to_clipboard
# InsKeyPad-/ Paste screen region into any console.
KEY_FENRIR,KEY_KPSLASH=paste_clipboard
# Hitting any key while speakup is outputting speech will quiet the
# synth until it has caught up with what is being printed on the
# console.
# following by other fenrir commands
KEY_FENRIR,KEY_H=toggle_tutorial_mode KEY_FENRIR,KEY_H=toggle_tutorial_mode
KEY_CTRL=shut_up KEY_CTRL=shut_up
KEY_FENRIR,KEY_KP9=review_bottom
KEY_FENRIR,KEY_KP7=review_top
KEY_KP8=review_curr_line
KEY_KP7=review_prev_line
KEY_KP9=review_next_line
KEY_FENRIR,KEY_KP4=review_line_begin KEY_FENRIR,KEY_KP4=review_line_begin
#=review_line_end #=review_line_end
KEY_FENRIR,KEY_KP1=review_line_first_char #=review_line_first_char
KEY_FENRIR,KEY_KP3=review_line_last_char #=review_line_last_char
KEY_FENRIR,KEY_ALT,KEY_1=present_first_line KEY_FENRIR,KEY_ALT,KEY_1=present_first_line
KEY_FENRIR,KEY_ALT,KEY_2=present_last_line KEY_FENRIR,KEY_ALT,KEY_2=present_last_line
KEY_KP5=review_curr_word
KEY_KP4=review_prev_word
KEY_KP6=review_next_word
KEY_FENRIR,KEY_KP5=review_curr_word_phonetic
KEY_FENRIR,KEY_SHIFT,KEY_KP4=review_prev_word_phonetic KEY_FENRIR,KEY_SHIFT,KEY_KP4=review_prev_word_phonetic
KEY_FENRIR,KEY_SHIFT,KEY_KP6=review_next_word_phonetic KEY_FENRIR,KEY_SHIFT,KEY_KP6=review_next_word_phonetic
KEY_KP2=review_curr_char
KEY_KP1=review_prev_char
KEY_KP3=review_next_char
KEY_FENRIR,KEY_KP2=review_curr_char_phonetic
KEY_FENRIR,KEY_SHIFT,KEY_KP1=review_prev_char_phonetic KEY_FENRIR,KEY_SHIFT,KEY_KP1=review_prev_char_phonetic
KEY_FENRIR,KEY_SHIFT,KEY_KP3=review_next_char_phonetic KEY_FENRIR,KEY_SHIFT,KEY_KP3=review_next_char_phonetic
KEY_FENRIR,KEY_CTRL,KEY_KP8=review_up KEY_FENRIR,KEY_CTRL,KEY_KP8=review_up
KEY_FENRIR,KEY_CTRL,KEY_KP2=review_down KEY_FENRIR,KEY_CTRL,KEY_KP2=review_down
KEY_FENRIR,KEY_KPDOT=exit_review #=exit_review
KEY_KPDOT=cursor_position
KEY_FENRIR,KEY_I=indent_curr_line KEY_FENRIR,KEY_I=indent_curr_line
KEY_KPPLUS=curr_screen KEY_KPPLUS=curr_screen
#=curr_screen_before_cursor
KEY_FENRIR,KEY_KPPLUS=curr_screen_after_cursor
KEY_FENRIR,KEY_KP6=cursor_read_to_end_of_line
#=cursor_column #=cursor_column
#=cursor_lineno #=cursor_lineno
#=braille_flush #=braille_flush
@ -75,8 +171,7 @@ KEY_FENRIR,KEY_KPSLASH=set_window_application
#=last_incoming #=last_incoming
KEY_FENRIR,KEY_F2=toggle_braille KEY_FENRIR,KEY_F2=toggle_braille
KEY_FENRIR,KEY_F3=toggle_sound KEY_FENRIR,KEY_F3=toggle_sound
KEY_CTRL,KEY_KPENTER=toggle_speech
KEY_KPENTER=temp_disable_speech
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_BACKSLASH=toggle_output KEY_FENRIR,KEY_BACKSLASH=toggle_output
@ -89,7 +184,6 @@ KEY_FENRIR,KEY_Q=quit_fenrir
KEY_FENRIR,KEY_T=time KEY_FENRIR,KEY_T=time
2,KEY_FENRIR,KEY_T=date 2,KEY_FENRIR,KEY_T=date
KEY_KPSLASH=toggle_auto_indent KEY_KPSLASH=toggle_auto_indent
KEY_KPMINUS=attribute_cursor
#=toggle_has_attribute #=toggle_has_attribute
KEY_FENRIR,KEY_S=spell_check KEY_FENRIR,KEY_S=spell_check
2,KEY_FENRIR,KEY_S=add_word_to_spell_check 2,KEY_FENRIR,KEY_S=add_word_to_spell_check
@ -103,9 +197,7 @@ KEY_FENRIR,KEY_END=last_clipboard
KEY_FENRIR,KEY_PAGEUP=prev_clipboard KEY_FENRIR,KEY_PAGEUP=prev_clipboard
KEY_FENRIR,KEY_PAGEDOWN=next_clipboard KEY_FENRIR,KEY_PAGEDOWN=next_clipboard
KEY_FENRIR,KEY_SHIFT,KEY_C=curr_clipboard KEY_FENRIR,KEY_SHIFT,KEY_C=curr_clipboard
KEY_KPSLASH=copy_marked_to_clipboard
KEY_FENRIR,KEY_CTRL,KEY_C=copy_last_echo_to_clipboard KEY_FENRIR,KEY_CTRL,KEY_C=copy_last_echo_to_clipboard
KEY_FENRIR,KEY_KPSLASH=paste_clipboard
KEY_FENRIR,KEY_F5=import_clipboard_from_file KEY_FENRIR,KEY_F5=import_clipboard_from_file
KEY_FENRIR,KEY_F6=export_clipboard_to_file KEY_FENRIR,KEY_F6=export_clipboard_to_file
KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_X=remove_marks KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_X=remove_marks

View File

@ -0,0 +1,33 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
from fenrirscreenreader.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 line to cursor pos, use review cursor if you are in review mode, 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['screen']['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

View File

@ -26,8 +26,8 @@ class command():
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(currLine[cursorPos['x']], interrupt=True) self.env['runtime']['outputManager'].presentText(currLine[cursorPos['x']:], interrupt=True)
self.env['runtime']['outputManager'].announceActiveCursor() self.env['runtime']['outputManager'].announceActiveCursor()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -15,7 +15,7 @@ class command():
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('set review cursor to begin of current line and display the content') return _('set review cursor to begin of current line and display the content')
def run(self): def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()