diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py index 065ac1947b6..401df9a942c 100644 --- a/source/NVDAObjects/IAccessible/__init__.py +++ b/source/NVDAObjects/IAccessible/__init__.py @@ -2007,4 +2007,5 @@ def event_alert(self): ("NUIDialog",oleacc.ROLE_SYSTEM_CLIENT):"NUIDialogClient", ("_WwB",oleacc.ROLE_SYSTEM_CLIENT):"winword.ProtectedDocumentPane", ("MsoCommandBar",oleacc.ROLE_SYSTEM_LISTITEM):"msOffice.CommandBarListItem", + ("ConsoleWindowClass",oleacc.ROLE_SYSTEM_CLIENT):"winConsole.WinConsole", } diff --git a/source/NVDAObjects/IAccessible/winConsole.py b/source/NVDAObjects/IAccessible/winConsole.py new file mode 100644 index 00000000000..59b33186edd --- /dev/null +++ b/source/NVDAObjects/IAccessible/winConsole.py @@ -0,0 +1,12 @@ +#NVDAObjects/IAccessible/WinConsole.py +#A part of NonVisual Desktop Access (NVDA) +#This file is covered by the GNU General Public License. +#See the file COPYING for more details. +#Copyright (C) 2007-2019 NV Access Limited, Bill Dengler + +from . import IAccessible +from ..window.winConsole import WinConsole + +class WinConsole(WinConsole, IAccessible): + "The legacy console implementation for situations where UIA isn't supported." + pass \ No newline at end of file diff --git a/source/NVDAObjects/window/__init__.py b/source/NVDAObjects/window/__init__.py index 78858edcf8e..6f7ee3c6db9 100644 --- a/source/NVDAObjects/window/__init__.py +++ b/source/NVDAObjects/window/__init__.py @@ -1,6 +1,6 @@ #NVDAObjects/window.py #A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2006-2019 NV Access Limited, Babbage B.V. +#Copyright (C) 2006-2019 NV Access Limited, Babbage B.V., Bill Dengler #This file is covered by the GNU General Public License. #See the file COPYING for more details. @@ -124,8 +124,6 @@ def findOverlayClasses(self,clsList): from .scintilla import Scintilla as newCls elif windowClassName in ("AkelEditW", "AkelEditA"): from .akelEdit import AkelEdit as newCls - elif windowClassName=="ConsoleWindowClass" and config.conf['UIA']['winConsoleImplementation'] != "UIA": - from .winConsole import WinConsole as newCls elif windowClassName=="EXCEL7": from .excel import Excel7Window as newCls if newCls: diff --git a/source/NVDAObjects/window/winConsole.py b/source/NVDAObjects/window/winConsole.py index 65df9117c1e..ec3923e5fcf 100644 --- a/source/NVDAObjects/window/winConsole.py +++ b/source/NVDAObjects/window/winConsole.py @@ -11,6 +11,11 @@ import core class WinConsole(Terminal, EditableTextWithoutAutoSelectDetection, Window): + """ + NVDA's legacy Windows Console support. + This is used in situations where UIA isn't available. + Please consider using NVDAObjects.UIA.winConsoleUIA instead. + """ STABILIZE_DELAY = 0.03 def _get_TextInfo(self): diff --git a/source/core.py b/source/core.py index 228df2e8f5f..93dcb7ce22d 100644 --- a/source/core.py +++ b/source/core.py @@ -417,7 +417,7 @@ def handlePowerStatusChange(self): except: log.error("Error initializing Java Access Bridge support", exc_info=True) import winConsoleHandler - log.debug("Initializing winConsole support") + log.debug("Initializing legacy winConsole support") winConsoleHandler.initialize() import UIAHandler log.debug("Initializing UIA support") @@ -542,7 +542,7 @@ def run(self): _terminate(treeInterceptorHandler) _terminate(IAccessibleHandler, name="IAccessible support") _terminate(UIAHandler, name="UIA support") - _terminate(winConsoleHandler, name="winConsole support") + _terminate(winConsoleHandler, name="Legacy winConsole support") _terminate(JABHandler, name="Java Access Bridge support") _terminate(appModuleHandler, name="app module handler") _terminate(NVDAHelper) diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index 768ea056e60..42d4ad2ce5c 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -2052,7 +2052,7 @@ def __init__(self, parent): # Translators: This is the label for a checkbox in the # Advanced settings panel. - label = _("Force UI Automation in the Windows Console") + label = _("Use UI Automation to access the Windows Console when available") consoleUIADevMap = True if config.conf['UIA']['winConsoleImplementation'] == 'UIA' else False self.ConsoleUIACheckBox=UIAGroup.addItem(wx.CheckBox(self, label=label)) self.ConsoleUIACheckBox.SetValue(consoleUIADevMap) diff --git a/source/winConsoleHandler.py b/source/winConsoleHandler.py index 62d7e74a2d8..2a583b64199 100755 --- a/source/winConsoleHandler.py +++ b/source/winConsoleHandler.py @@ -16,6 +16,11 @@ import api import config +""" +Handler for NVDA's legacy Windows Console support, +used in situations where UIA isn't available. +""" + #: How often to check whether the console is dead (in ms). CHECK_DEAD_INTERVAL = 100 diff --git a/source/wincon.py b/source/wincon.py index 3eaa94a0238..cdd6d8904ff 100755 --- a/source/wincon.py +++ b/source/wincon.py @@ -1,6 +1,11 @@ from ctypes import * from ctypes.wintypes import * +""" +Lower level utility functions and constants for NVDA's +legacy Windows console support, for situations where UIA isn't available. +""" + CONSOLE_REAL_OUTPUT_HANDLE=-2 class COORD(Structure): diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index c49736ed6dd..1deac4c5e4f 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -1671,7 +1671,7 @@ This includes in Microsoft Word itself, and also the Microsoft Outlook message v 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. -==== Force UI Automation in the Windows Console====[AdvancedSettingsConsoleUIA] +==== 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. ==== Automatically set system focus to focusable elements in Browse Mode ====[BrowseModeSettingsAutoFocusFocusableElements]