-
-
Notifications
You must be signed in to change notification settings - Fork 641
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: work around Microsoft bugs on Windows 10 version 1903 and improve caret movement #9773
Conversation
Does this partially implement #9660? |
Yes – we now listen for |
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.
In the Edge address bar, pressing backspace now fails to announce the deleted character.
- Please move the
__ne__
method onto ConsoleUIATextInfo - Please only multiply caretMovementTimeout on WinConsoleUIA NVDAObject.
We do of course want to try and fix this for UIA in general at some point in the future, but due to the introduced bug, clearly for now this solution is only useful for consoles.
@michaelDCurran Fixed. |
## Summary of the issue: In text fields, when moving the caret with caret movement commands, such as the arrows, NVDA relies on bookmarks to find out whether the caret has moved. In short: 1. You press left arrow 2. NVDA creates a bookmark of the current caret position 3. NVDA executes left arrow 4. For up to the caret movement timeout, NVDA tries to find out whether the caret has moved by creating new bookmarks and comparing them against the old. However, for UIA, this comparison fails, as creating a bookmark at the end of a range and then removing one character from the end of the range results in a new bookmark that is equal to the former. ## Description of how this fixes the issue: This PR introduces a different approach based on #9773. In first instance, this code caused #9786 to occur (i.e. editors in Chrome reporting the wrong caret position). Compared to #9773, flow is now as follows: - In a loop in EditableText._hasCaretMoved, NVDA processes pedning events - If there is a focus event pending, the loop is exited - NVDA tries to find out whether the caret position has changed by creating a textInfo at the caret position - new code: only when this succeeds, NVDA checks for pending caret and textChange events. If the object that contains the caret has caretMovementDetectionUsesEvents set to False, it still ignores the caret events. This is what we do in IA2Web objects. ## Testing performed: - Tested that deleted characters/words are again reported in UIA controls, such as MS Word - Tested Notepad, Wordpad, Word Without UIA, Thunderbird, LibreOffice, start menu edit field, legacy command consoles and Skype Electron. Made sure that the caret was still correctly reported in all of them when moving with arrow keys or deleting. ## Known issues with pull request: We can't set the caretMovementDetectionUsesEvents attribute to True on editableText.EditableText and then override it in other places, such as IA2Web. This is because EditableText precedes the IA2Web class as well as other classes in the mro Setting it on EditableText directly therefore makes it impossible for other classes to override the attribute. I solved this by making it a magic property on EditableText that first tries to call super before returning the default. Fixes #9928 Follow up of PR #9773
Link to issue number:
Closes #9632 and #9649. Builds on #9614. Incorporates #5991 with modifications.
Summary of the issue:
Currently:
collapse
method onconsoleUIATextInfo
is broken, resulting in several caret and selection bugs.Description of how this pull request fixes the issue:
consoleUIATextInfo.collapse
andconsoleUIATextInfo._get_isCollapsed
as suggested by @michaelDCurran.caret
event for UIA._caretMovementTimeoutMultiplier
variable to editable text objects, and sets it to 2 for UIA (some controls take a while to send events).Testing performed:
Tested the console and Windows start menu search field on Windows 10 1903. Caret movement, selection, and backspace reporting are functional, even over
ssh
.Known issues with pull request:
Change log entry:
None