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: disable filtering when tab is pressed #9936

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 11 additions & 1 deletion source/NVDAObjects/UIA/winConsoleUIA.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,19 @@ class WinConsoleUIA(Terminal):
#: Whether the console got new text lines in its last update.
#: Used to determine if typed character/word buffers should be flushed.
_hasNewLines = False
#: Whether the last typed character is a tab.
#: If so, we should temporarily disable filtering as completions may
#: be short.
_hasTab = False
#: the caret in consoles can take a while to move on Windows 10 1903 and later.
_caretMovementTimeoutMultiplier = 1.5

def _reportNewText(self, line):
# Additional typed character filtering beyond that in LiveText
if len(line.strip()) < max(len(speech.curWordChars) + 1, 3):
if (
not self._hasTab
and len(line.strip()) < max(len(speech.curWordChars) + 1, 3)
):
return
if self._hasNewLines:
# Clear the typed word buffer for new text lines.
Expand All @@ -252,9 +259,12 @@ def _reportNewText(self, line):

def event_typedCharacter(self, ch):
if ch == '\t':
self._hasTab = True
# Clear the typed word buffer for tab completion.
# This will need to be changed once #8110 is merged.
speech.curWordChars = []
else:
self._hasTab = False
if (
(
config.conf['keyboard']['speakTypedCharacters']
Expand Down