Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Automation in Windows Console: only enable UIA when available #9650

Merged
merged 5 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/NVDAObjects/IAccessible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
12 changes: 12 additions & 0 deletions source/NVDAObjects/IAccessible/winConsole.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions source/NVDAObjects/window/__init__.py
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions source/NVDAObjects/window/winConsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions source/winConsoleHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions source/wincon.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down