Skip to content
Browse files

UIA in WinConsole: Always use ConsoleUIATextInfo for UIA consoles (PR #…


NVDA was dynamically selecting the wrong TextInfo implementation (see NVDAObjects.UIA.UIA._getTextInfo).
Instead we override the _get_TextInfo method of NVDAObjects.UIA.UIA to return ConsoleUIATextInfo instead of UIATextInfo. 
ConsoleUIATextInfo will properly handle collapsed textRanges in UIA consoles.
  • Loading branch information...
codeofdusk authored and feerrenrut committed Aug 13, 2019
1 parent ac5ab40 commit 26485a0973f82c85188607b6ec9f5353f51168c1
Showing with 7 additions and 1 deletion.
  1. +7 −1 source/NVDAObjects/UIA/
@@ -269,10 +269,16 @@ class WinConsoleUIA(KeyboardHandlerBasedTypedCharSupport):
#: Only process text changes every 30 ms, in case the console is getting
#: a lot of text.
_TextInfo = consoleUIATextInfo
#: the caret in consoles can take a while to move on Windows 10 1903 and later.
_caretMovementTimeoutMultiplier = 1.5

def _get_TextInfo(self):
"""Overriding _get_TextInfo and thus the TextInfo property
on NVDAObjects.UIA.UIA
consoleUIATextInfo fixes expand/collapse, implements word movement, and
bounds review to the visible text."""
return consoleUIATextInfo

def _get_caretMovementDetectionUsesEvents(self):
"""Using caret events in consoles sometimes causes the last character of the
prompt to be read when quickly deleting text."""

0 comments on commit 26485a0

Please sign in to comment.
You can’t perform that action at this time.