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: add STABILIZE_DELAY and improve "speak typed words" #9651

Merged
merged 4 commits into from
Jun 3, 2019

Conversation

codeofdusk
Copy link
Contributor

Link to issue number:

Split from #9646 (builds on #9614).

Summary of the issue:

Currently, in consoles with UI Automation enabled:

  • If "speak typed words" is enabled, the last typed word is announced when pressing enter.
  • When pressing an interrupt character (such as control+c), the _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 a typedCharacter 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 on NVDAObjects.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.

…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.
@codeofdusk
Copy link
Contributor Author

@@ -32,24 +33,39 @@ def __init__(self, obj, position, _rangeObj=None):


class winConsoleUIA(Terminal):
STABILIZE_DELAY = 0.03
Copy link
Collaborator

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

Copy link
Contributor Author

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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about \n

Copy link
Contributor Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants