some more tweaks

This commit is contained in:
chrys 2016-12-23 00:16:34 +01:00
parent c8e23b8d78
commit 4a7a36e6b8
5 changed files with 24 additions and 15 deletions

View File

@ -90,7 +90,7 @@ charEcho=False
# echo deleted chars
charDeleteEcho=True
# echo word after pressing space
wordEcho=False
wordEcho=True
# interrupt speech on any keypress
interruptOnKeyPress=False
# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys)

View File

@ -28,7 +28,12 @@ class command():
# 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['screenData']['newDelta']) > 3:
return
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
# filter unneded space on word begin
currDelta = self.env['screenData']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '':
currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback):
pass

View File

@ -38,16 +38,15 @@ class command():
newContent = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screenData']['newCursor']['x'], 0, newContent)
# was this a typed word?
# currently writing
if self.env['runtime']['screenManager'].isDelta():
# is there a delta bigger than keyecho?
if len(self.env['screenData']['newDelta']) > 1:
return
if not(newContent[self.env['screenData']['oldCursor']['x']].isspace() and x != self.env['screenData']['oldCursor']['x']):
return
return
else:
# or just arrow arround?
if not(newContent[self.env['screenData']['newCursor']['x']].isspace() and x != self.env['screenData']['newCursor']['x']):
# at the end of a word
if not newContent[self.env['screenData']['newCursor']['x']].isspace():
return
if (x + len(currWord) != self.env['screenData']['newCursor']['x']) and \
(x + len(currWord) != self.env['screenData']['newCursor']['x']-1):
return
if currWord != '':

View File

@ -72,9 +72,11 @@ class command():
currWord = currWord.strip(string.whitespace + '!"#$%&()*+,-./:;<=>?@[\\]^_{|}~')
else:
# or just arrow arround?
if not(newContent[self.env['screenData']['newCursor']['x']].isspace() and x != self.env['screenData']['newCursor']['x']):
return
if not newContent[self.env['screenData']['newCursor']['x']].isspace():
return
if (x + len(currWord) != self.env['screenData']['newCursor']['x']) and \
(x + len(currWord) != self.env['screenData']['newCursor']['x']-1):
return
# ignore empty
if currWord.strip(string.whitespace) =='':
return

View File

@ -38,8 +38,11 @@ class command():
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
if len(self.env['screenData']['newNegativeDelta']) > 2:
return
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
currNegativeDelta = self.env['screenData']['newNegativeDelta']
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
currNegativeDelta.strip() != '':
currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback):
pass