improve navigation
This commit is contained in:
parent
52a8342a3c
commit
d745042839
@ -33,6 +33,15 @@ class command():
|
||||
# is it a horizontal change?
|
||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||
return
|
||||
# echo word insteed of char
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
||||
# get the word
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||
if self.env['screen']['newCursor']['x'] == x:
|
||||
return
|
||||
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||
if not currChar.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
from core import debug
|
||||
from utils import line_utils
|
||||
from utils import word_utils
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
|
@ -42,14 +42,14 @@ class command():
|
||||
if currWord == '':
|
||||
return
|
||||
|
||||
# navigate prev word
|
||||
if self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x'] > 1:
|
||||
# navigate by word (i.e. CTRL + Arrow left/right)
|
||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
||||
# at the start of a word
|
||||
if newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||
return
|
||||
if self.env['screen']['newCursor']['x'] != x:
|
||||
return
|
||||
# navigate next word
|
||||
# navigate by char (left/ right)
|
||||
else:
|
||||
# at the end of a word
|
||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||
|
Loading…
Reference in New Issue
Block a user