-
-
Notifications
You must be signed in to change notification settings - Fork 654
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: add STABILIZE_DELAY and improve "speak typed words" #9651
Conversation
…legacy consoles). This helps NVDA process large amounts of text.
…ffer when enter or tab is pressed. Note: this will need to be investigated once nvaccess#8110 is merged.
@@ -32,24 +33,39 @@ def __init__(self, obj, position, _rangeObj=None): | |||
|
|||
|
|||
class winConsoleUIA(Terminal): | |||
STABILIZE_DELAY = 0.03 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on how you decided to go with 0.03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value taken from legacy console code.
"kb:enter", | ||
"kb:numpadEnter", | ||
"kb:tab", | ||
"kb:control+c", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could we make sure that this list of gestures is complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably isn't unfortunately.
return | ||
super(winConsoleUIA, self)._reportNewText(line) | ||
|
||
def event_typedCharacter(self, ch): | ||
if not ch.isspace(): | ||
self._isTyping = True | ||
if ch in ('\r', '\t'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about \n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen the console send a \n on return, but there's no reason why I couldn't add it...
Link to issue number:
Split from #9646 (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:
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 "speak typed words" on Windows 10 1803 and 1903. Tested console performance with many
textChange
events on Windows 10 1903.Known issues with pull request:
See #9646 for all known console UIA issues to date.
Change log entry:
None.