announce capital letters in keyecho, deleteecho, char review next,prev/current and arrow left right
This commit is contained in:
@ -26,7 +26,7 @@ class command():
|
||||
if currChar.strip(" \t\n") == '':
|
||||
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
||||
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):
|
||||
pass
|
||||
|
@ -28,7 +28,7 @@ class command():
|
||||
if currChar.strip(" \t\n") == '':
|
||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||
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):
|
||||
pass
|
||||
|
@ -28,7 +28,7 @@ class command():
|
||||
if currChar.strip(" \t\n") == '':
|
||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||
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):
|
||||
pass
|
||||
|
@ -32,7 +32,7 @@ class command():
|
||||
return
|
||||
currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']]
|
||||
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):
|
||||
pass
|
||||
|
||||
|
@ -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)
|
||||
if len(self.env['screenData']['newDelta']) > 3:
|
||||
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):
|
||||
pass
|
||||
|
@ -36,7 +36,8 @@ class command():
|
||||
# too much for a single backspace...
|
||||
if len(self.env['screenData']['newNegativeDelta']) >= 5:
|
||||
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):
|
||||
pass
|
||||
|
@ -5,6 +5,7 @@
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
import string
|
||||
|
||||
class outputManager():
|
||||
def __init__(self):
|
||||
@ -20,15 +21,20 @@ class outputManager():
|
||||
self.env['runtime']['settingsManager'].shutdownDriver('soundDriver')
|
||||
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)
|
||||
if self.playSoundIcon(soundIcon, interrupt):
|
||||
self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO)
|
||||
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)
|
||||
|
||||
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'):
|
||||
self.env['runtime']['debug'].writeDebugOut("Speech disabled in outputManager.speakText",debug.debugLevel.INFO)
|
||||
return
|
||||
@ -50,7 +56,10 @@ class outputManager():
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
|
||||
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:
|
||||
self.env['runtime']['debug'].writeDebugOut("setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR)
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
|
@ -20,6 +20,7 @@ settings = {
|
||||
'driver': 'speechd',
|
||||
'rate': 0.75,
|
||||
'pitch': 0.5,
|
||||
'capitalPitch':0.8,
|
||||
'volume': 1.0,
|
||||
'module': '',
|
||||
'voice': 'de',
|
||||
|
Reference in New Issue
Block a user