-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Accessibility: Signaling Model #2447
Comments
Blocking nvaccess/nvda#10305. |
## Summary of the Pull Request We used to return multiple text ranges to represent one selection. We only support one selection at a time, so we should only return one range. Additionally, I moved all TriggerSelection() calls to the renderer from Terminal to TermControl for consistency. This ensures we only call it _once_ when we make a change to our selection state. ## References #2447 - helps polish Signaling for Selection #4465 - This is more apparent as the problem holding back Signaling for Selection ## PR Checklist * [x] Closes #4452 Tested using Accessibility Insights.
- When performing chunk selection, the expansion now occurs at the time of the selection, not the rendering of the selection - `GetSelectionRects()` was moved to the `TextBuffer` and is now shared between ConHost and Windows Terminal - Some of the selection variables were renamed for clarity - Selection COORDs are now in the Text Buffer coordinate space - Fixes an issue with Shift+Click after performing a Multi-Click Selection ## References This also contributes to... - #4509: UIA Box Selection - #2447: UIA Signaling for Selection - #1354: UIA support for Wide Glyphs Now that the expansion occurs at before render-time, the selection anchors are an accurate representation of what is selected. We just need to move `GetText` to the `TextBuffer`. Then we can have those three issues just rely on code from the text buffer. This also means ConHost gets some of this stuff for free 😀 ### TextBuffer - `GetTextRects` is the abstracted form of `GetSelectionRects` - `_ExpandTextRow` is still needed to handle wide glyphs properly ### Terminal - Rename... - `_boxSelection` --> `_blockSelection` for consistency with ConHost - `_selectionAnchor` --> `_selectionStart` for consistency with UIA - `_endSelectionPosition` --> `_selectionEnd` for consistency with UIA - Selection anchors are in Text Buffer coordinates now - Really rely on `SetSelectionEnd` to accomplish appropriate chunk selection and shift+click actions ## Validation Steps Performed - Shift+Click - Multi-Click --> Shift+Click - Chunk Selection at... - top of buffer - bottom of buffer - random region in scrollback Closes #4465 Closes #4547
@codeofdusk @michaelDCurran @LeonarddeR I've attached a release x64 build of For something as simple as Are you expecting a different Automation Event? Do I need to configure my TermControlAutomationPeer any further, maybe? Let me know what's going on from your end :) NOTE: you'll have to run WindowsTerminal.exe here, NOT OpenConsole.exe. ConHost has not been switched over to the new signaling model yet, whereas Windows Terminal has. |
Thanks @carlos-zamora This looks sufficient for implementing terminal support in NVDA. Things are mostly working (see nvaccess/nvda#10784), except we're getting doubled characters when typing (but I think I know where the issue is, and it's on our side). Are there plans to have this merged soon? |
If I can get it working for Narrator too, that'd be ideal. But, I guess there's no harm in merging what I have then iterating on master. I'll submit a PR today then. Thanks! |
I've tested with Narrator and observed, as you did, that we aren't getting new text announcements. In NVDA, we have an |
Not sure. Their code can be a bit complicated haha. I'm working with one of their devs to get a better look. I'm hoping that it can get fixed by next week because we're definitely VERY close. |
If narrator doesn't use a diffing method like NVDA does, the only alternative I can think of is making the terminal a live region. Pretty sure it doesn't work like this, though, as it has several drawbacks. |
Ah and in theory, UIA notification events could be used as well. If they are fired by conhost, NVDA would ignore them as NVDA only speaks notification events fire by the foreground application. |
## Summary of the Pull Request `GetTextForClipboard` already exists in the TextBuffer. It makes sense to use that for UIA as well. This changes the behavior or `GetText()` such that it does not remove leading/trailing whitespace anymore. That is more of an expected behavior. ## References This also contributes to... - #4509: UIA Box Selection - #2447: UIA Signaling for Selection - #1354: UIA support for Wide Glyphs Now that the expansion occurs at before render-time, the selection anchors are an accurate representation of what is selected. We just need to move GetText to the TextBuffer. Then we can have those three issues just rely on code from the text buffer. This also means ConHost gets some of this stuff for free 😀 ## Detailed Description of the Pull Request / Additional comments - `TextBuffer::GetTextForClipboard()` --> `GetText()` - `TextBuffer::GetText()` no longer requires GetForegroundColor/GetBackgroundColor. If either of these are not defined, we return a `TextAndColor` with only the `text` field populated. - renamed a few parameters for copying text to the clipboard for clarity - Updated `UiaTextRange::GetText()` to use `TextBuffer::GetText()` ## Validation Steps Performed Manual tests for UIA using accessibility insights and Windows Terminal's copy action (w/ and w/out shift) Added tests as well.
@carlos-zamora Do you still plan to do this? |
Yup! Here it is: #4826 |
## Summary of the Pull Request This notifies automation clients (i.e.: NVDA, narrator, etc...) of new output being rendered to the screen. ## References Close #2447 - Signaling for new output and cursor Close #3791 - fixed by signaling cursor changes ## Detailed Description of the Pull Request / Additional comments - Added tracing for UiaRenderer. This makes it easier to debug issues with notifying an automation client. - Fire TextChanged automation events when new content is output to the screen. ## Validation Steps Performed Verified with NVDA [1] ## Narrator Narrator works _better_, but is unable to detect new output consistently. There is no harm for narrator when this change goes in. [1] #2447 (comment)
## Summary of the Pull Request This notifies automation clients (i.e.: NVDA, narrator, etc...) of new output being rendered to the screen. ## References Close #2447 - Signaling for new output and cursor Close #3791 - fixed by signaling cursor changes ## Detailed Description of the Pull Request / Additional comments - Added tracing for UiaRenderer. This makes it easier to debug issues with notifying an automation client. - Fire TextChanged automation events when new content is output to the screen. ## Validation Steps Performed Verified with NVDA [1] ## Narrator Narrator works _better_, but is unable to detect new output consistently. There is no harm for narrator when this change goes in. [1] #2447 (comment)
🎉This issue was addressed in #4826, which has now been successfully released as Handy links: |
## Summary of the Pull Request This notifies automation clients (i.e.: NVDA, narrator, etc...) of new output being rendered to the screen. ## References Close #2447 - Signaling for new output and cursor Close #3791 - fixed by signaling cursor changes ## Detailed Description of the Pull Request / Additional comments - Added tracing for UiaRenderer. This makes it easier to debug issues with notifying an automation client. - Fire TextChanged automation events when new content is output to the screen. ## Validation Steps Performed Verified with NVDA [1] ## Narrator Narrator works _better_, but is unable to detect new output consistently. There is no harm for narrator when this change goes in. [1] microsoft/terminal#2447 (comment)
Description of the new feature/enhancement
UIA has signal events (link). ConHost supported them. WindowUiaProvider was an integral part to that.
Windows Terminal currently doesn't support them. We have some architecture in place to do so though.
Proposed technical implementation details (optional)
WindowUiaProvider already has the groundwork for that. It might be that we don't even need a WindowUiaProvider and just have XAML do some of it.
For reference, the signaling model for conhost was as follows:
<ConHost Event (i.e.: new text)>
--> Signal WindowUiaProvider
--> Signal ScreenInfoUiaProvider
--> Raise UiaAutomationEvent to Client
The client then responds to these events with more actions (i.e.: recreate object, etc...)
EDIT: The functionality for signaling includes...
I may possible need...
The text was updated successfully, but these errors were encountered: