announce capital letters in keyecho, deleteecho, char review next,prev/current and arrow left right

This commit is contained in:
chrys 2016-10-01 15:22:34 +02:00
parent 7bfe243f56
commit 2c539ba0f8
16 changed files with 33 additions and 11 deletions

3
TODO
View File

@ -23,7 +23,7 @@ ToDos in Priority order:
curr item curr item
first item first item
last item last item
- beep on cursor to capital letters in cursor and review
- implement onScreenUpdate commands - implement onScreenUpdate commands
read highlighted text mode read highlighted text mode
- add the debugging to core - add the debugging to core
@ -222,3 +222,4 @@ ps a -o tty,comm | grep -e Xorg | grep -v "grep -e Xorg"
- dictonary for special chars and string replacements - dictonary for special chars and string replacements
- punctuation - punctuation
- beep on cursor to capital letters in cursor and review

View File

@ -41,6 +41,8 @@ rate=0.45
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5 pitch=0.5
# Pitch for capital letters
capitalPitch=0.9
# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest.
volume=1.0 volume=1.0

View File

@ -39,6 +39,8 @@ rate=0.45
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5 pitch=0.5
# Pitch for capital letters
capitalPitch=0.9
# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest.
volume=1.0 volume=1.0

View File

@ -12,6 +12,8 @@ enabled=True
driver=speechd driver=speechd
rate=0.85 rate=0.85
pitch=0.5 pitch=0.5
# Pitch for capital letters
capitalPitch=0.9
module=espeak module=espeak
voice= voice=
language=english-us language=english-us

Binary file not shown.

Binary file not shown.

View File

@ -46,3 +46,5 @@ HasAttributes='HasAttributes.opus'
PromotedText='PromotedText.opus' PromotedText='PromotedText.opus'
# missspelled indicator # missspelled indicator
mispell='mispell.opus' mispell='mispell.opus'
# the for capital letter:
capital='Caps.opus'

View File

@ -46,3 +46,5 @@ HasAttributes=''
PromotedText='' PromotedText=''
# misspelled indicator # misspelled indicator
mispell='' mispell=''
# the for capital letter:
capital=''

View File

@ -26,7 +26,7 @@ class command():
if currChar.strip(" \t\n") == '': if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True) self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -28,7 +28,7 @@ class command():
if currChar.strip(" \t\n") == '': if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank", interrupt=True) self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -28,7 +28,7 @@ class command():
if currChar.strip(" \t\n") == '': if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank", interrupt=True) self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -32,7 +32,7 @@ class command():
return return
currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']] currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']]
if not currChar.strip(" \t\n") == '': if not currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -30,7 +30,7 @@ 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) # 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: if len(self.env['screenData']['newDelta']) > 3:
return return
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True) self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -36,7 +36,8 @@ class command():
# too much for a single backspace... # too much for a single backspace...
if len(self.env['screenData']['newNegativeDelta']) >= 5: if len(self.env['screenData']['newNegativeDelta']) >= 5:
return return
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True)
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newNegativeDelta'], interrupt=True, ignorePunctuation=True, announceCapital=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from core import debug from core import debug
import string
class outputManager(): class outputManager():
def __init__(self): def __init__(self):
@ -20,15 +21,20 @@ class outputManager():
self.env['runtime']['settingsManager'].shutdownDriver('soundDriver') self.env['runtime']['settingsManager'].shutdownDriver('soundDriver')
self.env['runtime']['settingsManager'].shutdownDriver('speechDriver') self.env['runtime']['settingsManager'].shutdownDriver('speechDriver')
def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False): def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False):
self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO)
if self.playSoundIcon(soundIcon, interrupt): if self.playSoundIcon(soundIcon, interrupt):
self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO)
return return
self.speakText(text, interrupt, ignorePunctuation) toAnnounceCapital = announceCapital and len(text.strip(' \n\t')) == 1 and text.strip(' \n\t').isupper()
if toAnnounceCapital:
if self.playSoundIcon('capital', False):
toAnnounceCapital = False
self.speakText(text, interrupt, ignorePunctuation,toAnnounceCapital)
self.brailleText(text, interrupt) self.brailleText(text, interrupt)
def speakText(self, text, interrupt=True, ignorePunctuation=False): def speakText(self, text, interrupt=True, ignorePunctuation=False, announceCapital=False):
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'): if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['debug'].writeDebugOut("Speech disabled in outputManager.speakText",debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("Speech disabled in outputManager.speakText",debug.debugLevel.INFO)
return return
@ -50,7 +56,10 @@ class outputManager():
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
try: try:
self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')) if announceCapital:
self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'capitalPitch'))
else:
self.env['runtime']['speechDriver'].setPitch(self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch'))
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut("setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR)
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)

View File

@ -20,6 +20,7 @@ settings = {
'driver': 'speechd', 'driver': 'speechd',
'rate': 0.75, 'rate': 0.75,
'pitch': 0.5, 'pitch': 0.5,
'capitalPitch':0.8,
'volume': 1.0, 'volume': 1.0,
'module': '', 'module': '',
'voice': 'de', 'voice': 'de',