fix word announcement
This commit is contained in:
parent
79c650577f
commit
22b24fcb6e
@ -6,13 +6,13 @@ volume=1.0
|
|||||||
|
|
||||||
[speech]
|
[speech]
|
||||||
enabled=True
|
enabled=True
|
||||||
driver=espeak
|
driver=speechd
|
||||||
rate=0.75
|
rate=0.75
|
||||||
pitch=0.5
|
pitch=0.5
|
||||||
module=espeak
|
|
||||||
voice=en-us
|
|
||||||
language=en-us
|
|
||||||
volume=1.0
|
volume=1.0
|
||||||
|
module=espeak
|
||||||
|
voice=de
|
||||||
|
language=de
|
||||||
autoReadIncomming=True
|
autoReadIncomming=True
|
||||||
|
|
||||||
[braille]
|
[braille]
|
||||||
@ -25,7 +25,7 @@ driver=linux
|
|||||||
[keyboard]
|
[keyboard]
|
||||||
device=all
|
device=all
|
||||||
keyboardLayout=desktop
|
keyboardLayout=desktop
|
||||||
charEcho=False
|
charEcho=True
|
||||||
charDeleteEcho=True
|
charDeleteEcho=True
|
||||||
wordEcho=True
|
wordEcho=True
|
||||||
interruptOnKeyPress=False
|
interruptOnKeyPress=False
|
||||||
|
@ -14,6 +14,7 @@ class command():
|
|||||||
environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
|
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
|
||||||
|
|
||||||
return environment
|
return environment
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -29,9 +29,15 @@ class command():
|
|||||||
# get the word
|
# get the word
|
||||||
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
||||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||||
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
# was this a typed word?
|
||||||
return environment
|
if environment['screenData']['newDelta'] != '':
|
||||||
print('word')
|
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||||
|
return environment
|
||||||
|
else:
|
||||||
|
# or just arrow arround?
|
||||||
|
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||||
|
return environment
|
||||||
|
|
||||||
if currWord != '':
|
if currWord != '':
|
||||||
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class screen():
|
|||||||
environment['screenData']['newCursor']['x'] = int( environment['screenData']['newContentBytes'][2])
|
environment['screenData']['newCursor']['x'] = int( environment['screenData']['newContentBytes'][2])
|
||||||
environment['screenData']['newCursor']['y'] = int( environment['screenData']['newContentBytes'][3])
|
environment['screenData']['newCursor']['y'] = int( environment['screenData']['newContentBytes'][3])
|
||||||
# analyze content
|
# analyze content
|
||||||
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("ascii", "replace"))
|
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("ascii", "replace")).replace('\n'," ")
|
||||||
environment['screenData']['newContentAttrib'] = environment['screenData']['newContentBytes'][5:][::2]
|
environment['screenData']['newContentAttrib'] = environment['screenData']['newContentBytes'][5:][::2]
|
||||||
environment['screenData']['newContentText'] = '\n'.join(self.textWrapper.wrap(environment['screenData']['newContentText'], ))[:-2]
|
environment['screenData']['newContentText'] = '\n'.join(self.textWrapper.wrap(environment['screenData']['newContentText'], ))[:-2]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user