announce content of begin/end of line

This commit is contained in:
chrys 2016-10-02 16:38:52 +02:00
parent 3eb5fb0f47
commit c6562281da
6 changed files with 31 additions and 16 deletions

View File

@ -5,8 +5,8 @@ KEY_FENRIR,KEY_KP7=review_top
KEY_KP8=review_curr_line
KEY_KP7=review_prev_line
KEY_KP9=review_next_line
#=review_line_end
#=review_line_begin
KEY_FENRIR,KEY_KP6=review_line_end
KEY_FENRIR,KEY_KP5=review_line_begin
#=present_first_line
#=present_last_line
KEY_KP5=review_curr_word
@ -20,7 +20,7 @@ KEY_KP3=review_next_char
KEY_KPDOT=cursor_position
KEY_FENRIR,KEY_I=indent_curr_line
KEY_FENRIR,KEY_KPDOT=exit_review
KEY_FENRIR,KEY_KP5=curr_screen
#KEY_FENRIR,KEY_KP5=curr_screen
KEY_FENRIR,KEY_KP8=curr_screen_before_cursor
KEY_FENRIR,KEY_KP2=curr_screen_after_cursor
KEY_FENRIR,KEY_1=set_window_application

View File

@ -60,7 +60,7 @@ voice=
language=english-us
# Read new text as it happens?
autoReadIncoming=True
autoReadIncomming=True
[braille]
#braille is not implemented yet
@ -72,7 +72,7 @@ driver=linux
encoding=cp850
screenUpdateDelay=0.4
suspendingScreen=
autodetectSuspendingScreen=True
autodetectSuspendingScreen=False
[keyboard]
driver=evdev
@ -82,24 +82,24 @@ device=AUTO
grabDevices=True
ignoreShortcuts=False
# the current shortcut layout located in /etc/fenrir/keyboard
keyboardLayout=desktop
keyboardLayout=test
# echo chars while typing.
charEcho=False
charEcho=True
# echo deleted chars
charDeleteEcho=True
# echo word after pressing space
wordEcho=False
wordEcho=True
# interrupt speech on any keypress
interruptOnKeyPress=False
# timeout for double tap in sec
doubleTapDelay=0.2
[general]
debugLevel=3
debugLevel=2
punctuationLevel=Some
numberOfClipboards=10
# define the current fenrir key
fenrirKeys=KEY_KP0,KEY_META
fenrirKeys=KEY_KP0
timeFormat=%H:%M:%P
dateFormat=%A, %B %d, %Y
autoSpellCheck=True

View File

@ -1,11 +1,11 @@
#!/bin/python
from utils import char_utils
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):
@ -14,12 +15,19 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'displays the position of the review cursor'
return 'set review cursor to begin of current line and display the content'
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(0 ,cursorPos['y'])
self.env['runtime']['outputManager'].presentText("begin of line", interrupt=True)
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
self.env['runtime']['outputManager'].presentText("begin of line", interrupt=False)
def setCallback(self, callback):
pass

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):
@ -14,12 +15,19 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'displays the position of the review cursor'
return 'set review cursor to end of current line and display the content'
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screenData']['columns']-1 ,cursorPos['y'])
self.env['runtime']['outputManager'].presentText("end of line", interrupt=True)
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
self.env['runtime']['outputManager'].presentText("end of line", interrupt=False)
def setCallback(self, callback):
pass

View File

@ -57,7 +57,6 @@ class settingsManager():
kbConfig.close()
def loadSoundIcons(self, soundIconPath):
print(soundIconPath + '/soundicons.conf')
siConfig = open(soundIconPath + '/soundicons.conf',"r")
while(True):
line = siConfig.readline()