tweak line changes
This commit is contained in:
parent
09a07ab11e
commit
64e29680ce
@ -26,7 +26,8 @@ class command():
|
|||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
||||||
if len(self.env['screen']['newDelta'].strip(' \n\t')) > 1:
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
|
if not( (xMove >= 1) and xMove == len(self.env['screen']['newDelta'])):
|
||||||
return
|
return
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
|
@ -33,6 +33,7 @@ class command():
|
|||||||
# is it a horizontal change?
|
# is it a horizontal change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
|
|
||||||
# echo word insteed of char
|
# echo word insteed of char
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
||||||
@ -42,7 +43,7 @@ class command():
|
|||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
if self.env['screen']['newCursor']['x'] == x:
|
if self.env['screen']['newCursor']['x'] == x:
|
||||||
return
|
return
|
||||||
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if not currChar.isspace():
|
if not currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
@ -20,16 +20,18 @@ class command():
|
|||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
||||||
return
|
return
|
||||||
# is there something to read?
|
# is there something to read?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||||
return
|
return
|
||||||
# this must be a keyecho or something
|
# this must be a keyecho or something
|
||||||
if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
|
#if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
|
||||||
if abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) >= 1:
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y'])
|
||||||
return
|
if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']):
|
||||||
if abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y']) == 1:
|
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||||
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
return
|
||||||
return
|
#if yMove == 1:
|
||||||
|
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||||
|
# return
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
@ -337,7 +337,7 @@ class driver(screenDriver):
|
|||||||
else:
|
else:
|
||||||
cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y']
|
cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y']
|
||||||
cursorLineEnd = cursorLineStart + self.env['screen']['columns']
|
cursorLineEnd = cursorLineStart + self.env['screen']['columns']
|
||||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) == 1 and \
|
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) >= 1 and \
|
||||||
self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \
|
self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \
|
||||||
self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart] and \
|
self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart] and \
|
||||||
self.env['screen']['newContentText'][cursorLineEnd:] == self.env['screen']['oldContentText'][cursorLineEnd:]:
|
self.env['screen']['newContentText'][cursorLineEnd:] == self.env['screen']['oldContentText'][cursorLineEnd:]:
|
||||||
|
Loading…
Reference in New Issue
Block a user