add review begin of line command

This commit is contained in:
chrys 2016-10-02 14:19:22 +02:00
parent 9e6dc32241
commit 41fe26d7a3
7 changed files with 13 additions and 17 deletions

View File

@ -6,6 +6,7 @@ KEY_KP8=review_curr_line
KEY_KP7=review_prev_line KEY_KP7=review_prev_line
KEY_KP9=review_next_line KEY_KP9=review_next_line
#=review_end_of_line #=review_end_of_line
#=review_begin_of_line
#=present_first_line #=present_first_line
#=present_last_line #=present_last_line
KEY_KP5=review_curr_word KEY_KP5=review_curr_word

View File

@ -6,6 +6,7 @@ KEY_FENRIR,KEY_I=review_curr_line
KEY_FENRIR,KEY_U=review_prev_line KEY_FENRIR,KEY_U=review_prev_line
KEY_FENRIR,KEY_O=review_next_line KEY_FENRIR,KEY_O=review_next_line
#=review_end_of_line #=review_end_of_line
#=review_begin_of_line
#=present_first_line #=present_first_line
#=present_last_line #=present_last_line
KEY_FENRIR,KEY_K=review_curr_word KEY_FENRIR,KEY_K=review_curr_word

View File

@ -5,7 +5,8 @@ KEY_FENRIR,KEY_KP7=review_top
KEY_KP8=review_curr_line KEY_KP8=review_curr_line
KEY_KP7=review_prev_line KEY_KP7=review_prev_line
KEY_KP9=review_next_line KEY_KP9=review_next_line
KEY_FENRIR,KEY_KP6=review_end_of_line #=review_end_of_line
KEY_FENRIR,KEY_KP6=review_begin_of_line
#=present_first_line #=present_first_line
#=present_last_line #=present_last_line
KEY_KP5=review_curr_word KEY_KP5=review_curr_word

View File

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

View File

@ -19,10 +19,7 @@ class command():
def run(self): def run(self):
# Prefer review cursor over text cursor # Prefer review cursor over text cursor
if self.env['screenData']['newCursorReview']: cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
cursorPos = self.env['screenData']['newCursorReview'].copy()
else:
cursorPos = self.env['screenData']['newCursor'].copy()
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screenData']['newContentText']) textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screenData']['newContentText'])

View File

@ -49,10 +49,6 @@ class cursorManager():
if not self.env['screenData']['newCursorReview']: if not self.env['screenData']['newCursorReview']:
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy() self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
def setReviewCursorPosition(self, x, y): def setReviewCursorPosition(self, x, y):
if not x:
return
if not y:
return
if not self.isReviewMode(): if not self.isReviewMode():
self.enterReviewModeCurrTextCursor() self.enterReviewModeCurrTextCursor()
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview'] self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']

View File

@ -56,4 +56,4 @@ def getTextAfterMark(mark, inText):
return '' return ''
if mark == None: if mark == None:
return '' return ''
return getTextBetweenMarks(mark, {'x':len(inText[0])-1,'y':len(inText)-1}, inText) return getTextBetweenMarks(mark, {'x':len(inText[0]),'y':len(inText)}, inText)