UI Automation in Windows Console: add STABILIZE_DELAY, only enable UIA when available, limit blank lines in review, make speaking of passwords configurable, improvements to "speak typed words", and initial word movement support #9646
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Builds on #9614.
Summary of the issue:
Currently, in consoles with UI Automation enabled:
_isTyping
flag is not cleared on the console, so new text is not announced immediately.Description of how this pull request fixes the issue:
Word movement and blank line filtering have been implemented in an overridden
move
method onconsoleUIATextInfo
. Since the console's UIA implementation does not provide word movement, we must use an offset-based word movement algorithm which uses the Uniscribe API to find word boundaries. The algorithm used for this implementation is based on that inNVDAObjects.offsets._getWordOffsets
. Blank lines are filtered by comparing thetextInfo
's_rangeObj
to the last visible text range (returned bywinConsoleUIA.UIATextPattern.GetVisibleRanges
).When "speak passwords in UIA consoles" is disabled and one of "speak typed characters" or "speak typed words" is enabled,
typedCharacter
events are trapped and queued until atextChange
event is received. InwinConsoleUIA.event_textChange
, typed characters are removed from the queue andtypedCharacter
events are fired. InwinConsoleUIA.script_clear_isTyping
, this queue is flushed. Since password prompts do not update the screen while the user is typing, notextChange
events are received, so notypedCharacter
events are fired and therefore no characters are announced.The legacy console code has been moved to
NVDAObjects.IAccessible.winConsoleLegacy
, and the check for consoles has been moved fromNVDAObjects.window.findOverlayClasses
toNVDAObjects.IAccessible.findOverlayClasses
. Since NVDA prefers UIA over MSAA, UIA is used when enabled and available and legacy is used otherwise.The
speech.curWordChars
buffer is cleared when atypedCharacter
of enter or tab is received. This prevents NVDA from speaking partially-typed words (during tab completion) or the last word of a command (when enter is pressed). This approach will need to be modified once #8110 is merged, as it significantly changes handling of typed words.The interrupt characters control+c, control+d, and control+break have been bound to the
script_clear_isTyping
script onNVDAObjects.UIA.winConsoleUIA
.Testing performed:
Tested password entry (by authenticating with
ssh
), text review, and all combinations of the "use legacy console" and UIA checkboxes on Windows 10 versions 1803 and 1903.Known issues with pull request:
typedCharacter
events are only dispatched oncetextChange
is received. This may introduce a small performance penalty.winConsoleUIA._isTyping
is cleared), reporting of new text and speak typed words may not function correctly.Change log entry:
None.