diff --git a/source/NVDAObjects/UIA/winConsoleUIA.py b/source/NVDAObjects/UIA/winConsoleUIA.py index 03e6b677c38..02bb9c46ab4 100644 --- a/source/NVDAObjects/UIA/winConsoleUIA.py +++ b/source/NVDAObjects/UIA/winConsoleUIA.py @@ -4,6 +4,7 @@ # See the file COPYING for more details. # Copyright (C) 2019 Bill Dengler +import config import speech import time import textInfos @@ -37,6 +38,7 @@ class winConsoleUIA(Terminal): _TextInfo = consoleUIATextInfo _isTyping = False _lastCharTime = 0 + _queuedChars = [] _TYPING_TIMEOUT = 1 def _reportNewText(self, line): @@ -56,7 +58,22 @@ def event_typedCharacter(self, ch): # This will need to be changed once #8110 is merged. speech.curWordChars = [] self._lastCharTime = time.time() - super(winConsoleUIA, self).event_typedCharacter(ch) + if ( + ( + config.conf['keyboard']['speakTypedCharacters'] + or config.conf['keyboard']['speakTypedWords'] + ) + and not config.conf['UIA']['winConsoleSpeakPasswords'] + ): + self._queuedChars.append(ch) + else: + super(winConsoleUIA, self).event_typedCharacter(ch) + + def event_textChange(self): + while self._queuedChars: + ch = self._queuedChars.pop(0) + super(winConsoleUIA, self).event_typedCharacter(ch) + super(winConsoleUIA, self).event_textChange() @script(gestures=[ "kb:enter", @@ -69,6 +86,7 @@ def event_typedCharacter(self, ch): def script_clear_isTyping(self, gesture): gesture.send() self._isTyping = False + self._queuedChars = [] def _getTextLines(self): # Filter out extraneous empty lines from UIA diff --git a/source/config/configSpec.py b/source/config/configSpec.py index 12c16356de3..fdc4e0114b5 100644 --- a/source/config/configSpec.py +++ b/source/config/configSpec.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2018 NV Access Limited, Babbage B.V., Davy Kager +#Copyright (C) 2006-2019 NV Access Limited, Babbage B.V., Davy Kager, Bill Dengler #This file is covered by the GNU General Public License. #See the file COPYING for more details. @@ -188,6 +188,7 @@ enabled = boolean(default=true) useInMSWordWhenAvailable = boolean(default=false) winConsoleImplementation= option("auto", "legacy", "UIA", default="auto") + winConsoleSpeakPasswords = boolean(default=false) [update] autoCheck = boolean(default=true) diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index 768ea056e60..60f96e9cb3e 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -2058,6 +2058,13 @@ def __init__(self, parent): self.ConsoleUIACheckBox.SetValue(consoleUIADevMap) self.ConsoleUIACheckBox.defaultValue = self._getDefaultValue(["UIA", "winConsoleImplementation"]) + # Translators: This is the label for a checkbox in the + # Advanced settings panel. + label = _("Speak &passwords in UIA consoles (may improve performance)") + self.winConsoleSpeakPasswordsCheckBox=UIAGroup.addItem(wx.CheckBox(self, label=label)) + self.winConsoleSpeakPasswordsCheckBox.SetValue(config.conf["UIA"]["winConsoleSpeakPasswords"]) + self.winConsoleSpeakPasswordsCheckBox.defaultValue = self._getDefaultValue(["UIA", "winConsoleSpeakPasswords"]) + # Translators: This is the label for a group of advanced options in the # Advanced settings panel label = _("Browse mode") @@ -2143,6 +2150,7 @@ def haveConfigDefaultsBeenRestored(self): self.scratchpadCheckBox.IsChecked() == self.scratchpadCheckBox.defaultValue and self.UIAInMSWordCheckBox.IsChecked() == self.UIAInMSWordCheckBox.defaultValue and self.ConsoleUIACheckBox.IsChecked() == (self.ConsoleUIACheckBox.defaultValue=='UIA') and + self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue and self.autoFocusFocusableElementsCheckBox.IsChecked() == self.autoFocusFocusableElementsCheckBox.defaultValue and self.caretMoveTimeoutSpinControl.GetValue() == self.caretMoveTimeoutSpinControl.defaultValue and set(self.logCategoriesList.CheckedItems) == set(self.logCategoriesList.defaultCheckedItems) and @@ -2153,6 +2161,7 @@ def restoreToDefaults(self): self.scratchpadCheckBox.SetValue(self.scratchpadCheckBox.defaultValue) self.UIAInMSWordCheckBox.SetValue(self.UIAInMSWordCheckBox.defaultValue) self.ConsoleUIACheckBox.SetValue(self.ConsoleUIACheckBox.defaultValue=='UIA') + self.winConsoleSpeakPasswordsCheckBox.SetValue(self.winConsoleSpeakPasswordsCheckBox.defaultValue) self.autoFocusFocusableElementsCheckBox.SetValue(self.autoFocusFocusableElementsCheckBox.defaultValue) self.caretMoveTimeoutSpinControl.SetValue(self.caretMoveTimeoutSpinControl.defaultValue) self.logCategoriesList.CheckedItems = self.logCategoriesList.defaultCheckedItems @@ -2166,6 +2175,7 @@ def onSave(self): config.conf['UIA']['winConsoleImplementation'] = "UIA" else: config.conf['UIA']['winConsoleImplementation'] = "auto" + config.conf["UIA"]["winConsoleSpeakPasswords"]=self.winConsoleSpeakPasswordsCheckBox.IsChecked() config.conf["virtualBuffers"]["autoFocusFocusableElements"] = self.autoFocusFocusableElementsCheckBox.IsChecked() config.conf["editableText"]["caretMoveTimeoutMs"]=self.caretMoveTimeoutSpinControl.GetValue() for index,key in enumerate(self.logCategories): diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index c49736ed6dd..4817a1a03fa 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -1674,6 +1674,9 @@ We still do not recommend that the majority of users turn this on by default, t ==== Force UI Automation in the Windows Console====[AdvancedSettingsConsoleUIA] When this option is enabled, NVDA will use a new, work in progress version of its support for Windows Console which takes advantage of [accessibility improvements made by Microsoft https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/]. This feature is highly experimental and is still incomplete, so its use is not yet recommended. However, once completed, it is anticipated that this new support will become the default, improving NVDA's performance and stability in Windows command consoles. +==== Speak passwords in UIA consoles ====[AdvancedSettingsWinConsoleSpeakPasswords] +This setting controls whether characters are spoken by [speak typed characters #KeyboardSettingsSpeakTypedCharacters] or [speak typed words #KeyboardSettingsSpeakTypedWords] in situations where the screen does not update (such as password entry) in the Windows Console with UI automation support enabled. For security purposes, this setting should be left disabled. However, you may wish to enable it if you experience performance issues or instability with typed character and/or word reporting while using NVDA's new experimental console support. + ==== Automatically set system focus to focusable elements in Browse Mode ====[BrowseModeSettingsAutoFocusFocusableElements] Key: NVDA+8