Skip to content

Commit

Permalink
GUI/documentation changes for UIA console by default.
Browse files Browse the repository at this point in the history
This partially reverts commits 82eeff0 and b00c3f1.
  • Loading branch information
codeofdusk committed Jul 2, 2021
1 parent 85d103a commit 44632ea
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 25 deletions.
61 changes: 42 additions & 19 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2020 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
# Copyright (C) 2006-2021 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
# Rui Batista, Joseph Lee, Heiko Folkerts, Zahari Yurukov, Leonard de Ruijter,
# Derek Riemer, Babbage B.V., Davy Kager, Ethan Holliger, Bill Dengler, Thomas Stivers
# This file is covered by the GNU General Public License.
Expand Down Expand Up @@ -2600,15 +2600,39 @@ def __init__(self, parent):
self.bindHelpEvent("UseUiaForExcel", self.UIAInMSExcelCheckBox)
self.UIAInMSExcelCheckBox.SetValue(config.conf["UIA"]["useInMSExcelWhenAvailable"])
self.UIAInMSExcelCheckBox.defaultValue = self._getDefaultValue(["UIA", "useInMSExcelWhenAvailable"])

# Translators: This is the label for a checkbox in the
# Advanced settings panel.
label = _("Use UI Automation to access the Windows C&onsole when available")
consoleUIADevMap = True if config.conf['UIA']['winConsoleImplementation'] == 'UIA' else False
self.ConsoleUIACheckBox = UIAGroup.addItem(wx.CheckBox(UIABox, label=label))
self.bindHelpEvent("AdvancedSettingsConsoleUIA", self.ConsoleUIACheckBox)
self.ConsoleUIACheckBox.SetValue(consoleUIADevMap)
self.ConsoleUIACheckBox.defaultValue = self._getDefaultValue(["UIA", "winConsoleImplementation"])
# Translators: This is the label for a combo box for selecting the
# active console implementation in the advanced settings panel.
# Choices are automatic, prefer UIA, and legacy.
consoleComboText = _("Windows C&onsole support:")
consoleChoices = [
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA determine its Windows Console implementation
# automatically.
_("Automatic"),
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA use UIA in the Windows Console when available.
_("Prefer UIA"),
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA use its legacy Windoes Console support
# in all cases.
_("Legacy")
]
#: The possible console config values, in the order they appear
#: in the combo box.
self.consoleVals = (
"auto",
"UIA",
"legacy"
)
self.consoleCombo = UIAGroup.addLabeledControl(consoleComboText, wx.Choice, choices=consoleChoices)
self.bindHelpEvent("AdvancedSettingsConsoleUIA", self.consoleCombo)
curChoice = self.consoleVals.index(
config.conf['UIA']['winConsoleImplementation']
)
self.consoleCombo.SetSelection(curChoice)
self.consoleCombo.defaultValue = self.consoleVals.index(
self._getDefaultValue(["UIA", "winConsoleImplementation"])
)

# Translators: This is the label for a checkbox in the
# Advanced settings panel.
Expand Down Expand Up @@ -2665,7 +2689,7 @@ def __init__(self, parent):
sHelper.addItem(terminalsGroup)
# Translators: This is the label for a checkbox in the
# Advanced settings panel.
label = _("Use the new t&yped character support in Windows Console when available")
label = _("Use the new t&yped character support in legacy Windows consoles when available")
self.keyboardSupportInLegacyCheckBox = terminalsGroup.addItem(wx.CheckBox(terminalsBox, label=label))
self.bindHelpEvent("AdvancedSettingsKeyboardSupportInLegacy", self.keyboardSupportInLegacyCheckBox)
self.keyboardSupportInLegacyCheckBox.SetValue(config.conf["terminals"]["keyboardSupportInLegacy"])
Expand Down Expand Up @@ -2820,8 +2844,8 @@ def haveConfigDefaultsBeenRestored(self):
)
and self.UIAInMSWordCheckBox.IsChecked() == self.UIAInMSWordCheckBox.defaultValue
and self.UIAInMSExcelCheckBox.IsChecked() == self.UIAInMSExcelCheckBox.defaultValue
and self.ConsoleUIACheckBox.IsChecked() == (self.ConsoleUIACheckBox.defaultValue == 'UIA')
and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue
and self.consoleCombo.GetSelection() == self.consoleCombo.defaultValue
and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.speakPasswordsCheckBox.defaultValue
and self.cancelExpiredFocusSpeechCombo.GetSelection() == self.cancelExpiredFocusSpeechCombo.defaultValue
and self.UIAInChromiumCombo.GetSelection() == self.UIAInChromiumCombo.defaultValue
and self.keyboardSupportInLegacyCheckBox.IsChecked() == self.keyboardSupportInLegacyCheckBox.defaultValue
Expand All @@ -2837,8 +2861,7 @@ def restoreToDefaults(self):
self.selectiveUIAEventRegistrationCheckBox.SetValue(self.selectiveUIAEventRegistrationCheckBox.defaultValue)
self.UIAInMSWordCheckBox.SetValue(self.UIAInMSWordCheckBox.defaultValue)
self.UIAInMSExcelCheckBox.SetValue(self.UIAInMSExcelCheckBox.defaultValue)
self.ConsoleUIACheckBox.SetValue(self.ConsoleUIACheckBox.defaultValue == 'UIA')
self.UIAInChromiumCombo.SetSelection(self.UIAInChromiumCombo.defaultValue)
self.consoleCombo.SetSelection(self.consoleCombo.defaultValue == 'auto')
self.winConsoleSpeakPasswordsCheckBox.SetValue(self.winConsoleSpeakPasswordsCheckBox.defaultValue)
self.cancelExpiredFocusSpeechCombo.SetSelection(self.cancelExpiredFocusSpeechCombo.defaultValue)
self.keyboardSupportInLegacyCheckBox.SetValue(self.keyboardSupportInLegacyCheckBox.defaultValue)
Expand All @@ -2854,10 +2877,10 @@ def onSave(self):
config.conf["UIA"]["selectiveEventRegistration"] = self.selectiveUIAEventRegistrationCheckBox.IsChecked()
config.conf["UIA"]["useInMSWordWhenAvailable"]=self.UIAInMSWordCheckBox.IsChecked()
config.conf["UIA"]["useInMSExcelWhenAvailable"] = self.UIAInMSExcelCheckBox.IsChecked()
if self.ConsoleUIACheckBox.IsChecked():
config.conf['UIA']['winConsoleImplementation'] = "UIA"
else:
config.conf['UIA']['winConsoleImplementation'] = "auto"
consoleChoice = self.consoleCombo.GetSelection()
config.conf['UIA']['winConsoleImplementation'] = (
self.consoleVals[consoleChoice]
)
config.conf["terminals"]["speakPasswords"] = self.winConsoleSpeakPasswordsCheckBox.IsChecked()
config.conf["featureFlag"]["cancelExpiredFocusSpeech"] = self.cancelExpiredFocusSpeechCombo.GetSelection()
config.conf["UIA"]["allowInChromium"] = self.UIAInChromiumCombo.GetSelection()
Expand Down
22 changes: 16 additions & 6 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1833,11 +1833,21 @@ This includes Microsoft Word itself, and also the Microsoft Outlook message view
However, There may be some information which is either not exposed, or exposed incorrectly in some versions of Microsoft Office, which means this UI automation support cannot always be relied upon.
We still do not recommend that the majority of users turn this on by default, though we do welcome users of Office 2016/365 to test this feature and provide feedback.

==== Use UI Automation to access the Windows Console when available ====[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.
==== Windows Console support ====[AdvancedSettingsConsoleUIA]
This option selects how NVDA interacts with the Windows Console used by command prompt, PowerShell, and the Windows Subsystem for Linux.
It does not affect the modern Windows Terminal.
In Windows 10 version 1709, Microsoft [added support for its UI Automation API to the console https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/], bringing vastly improved performance and stability for screen readers that support it.
In situations where UI Automation is unavailable or known to result in an inferior user experience, NVDA's legacy console support is available as a fallback.
The Windows Console support combo box has three options:
- Automatic: Uses UI Automation in consoles on Windows 10 version 21H1 and later. This option is recommended and set by default.
- Prefer UIA: Uses UI Automation in consoles if available, even on Windows versions with incomplete or buggy implementations. While this limited functionality may be useful (and even sufficient for your usage), use of this option is entirely at your own risk and no support for it will be provided.
- Legacy: UI Automation in the Windows Console will be completely disabled, so the legacy fallback will always be used.
-

==== 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.
==== Speak passwords in UIA Windows Console ====[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 some terminal programs, such as the Windows Console with UI automation support enabled and Mintty.
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 in consoles, or work in trusted environments and prefer password announcement.

==== Use UIA with Microsoft Edge and other Chromium based browsers when available ====[ChromiumUIA]
Allows specifying when UIA will be used when it is available in Chromium based browsers such as Microsoft Edge.
Expand Down Expand Up @@ -1865,8 +1875,8 @@ However, for basic spreadsheet navigating / editing, this option may provide a v
We still do not recommend that the majority of users turn this on by default, though we do welcome users of Microsoft Excel build 16.0.13522.10000 or higher to test this feature and provide feedback.
Microsoft Excel's UI automation implementation is ever changing, and versions of Microsoft Office older than 16.0.13522.10000 may not expose enough information for this option to be of any use.

==== Use the new typed character support in Windows Console when available ====[AdvancedSettingsKeyboardSupportInLegacy]
This option enables an alternative method for detecting typed characters in Windows command consoles.
==== Use the new typed character support in legacy Windows consoles when available ====[AdvancedSettingsKeyboardSupportInLegacy]
This option enables an alternative method for detecting typed characters in legacy Windows consoles.
While it improves performance and prevents some console output from being spelled out, it may be incompatible with some terminal programs.
This feature is available and enabled by default on Windows 10 versions 1607 and later when UI Automation is unavailable or disabled.
Warning: with this option enabled, typed characters that do not appear onscreen, such as passwords, will not be suppressed.
Expand Down

0 comments on commit 44632ea

Please sign in to comment.