-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Attach UiaRenderer and Fire Selection Changed Events #2989
Conversation
/azp run |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
feb0c5c
to
a36902f
Compare
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 have lots of comments/questions, but considering I'll be gone in 3 days, I don't want to block the PR
Whoops. That last commit was intended for the other branch... but eh. It's all going to the same place anyways. |
393d9b9
to
c1f10c3
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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'm marking as changes requested to make sure the _prevSelection
thing gets followed up on. I'm open to being overruled on the SignalUia
thing.
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.
None of this is worth blocking over, but I don't know if these are serious concerns or not.
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.
There's still a few things outstanding, so I don't want to sign off yet.
🎉 Handy links: |
Summary of the Pull Request
I recommend looking at this PR by commit.
This PR makes use of the UiaRenderer by attaching it to the TerminalControl and setting up selectionChanged events for accessibility.
References
#2447
PR Checklist
Tests added/passedRequires documentation to be updatedDetailed Description of the Pull Request / Additional comments
Commit 1: attaching the UiaRenderer
The
uiaRenderer
is treated very similarly to thedxRenderer
. We have a unique_ptr ref to it in theTermControl
. This gets populated when theTermControlAutomationPeer
is created (thus enabling accessibility).To prevent every TermControl from sending signals simultaneously, we specifically only enable whichever one is in an active pane.
The
UiaRenderer
needs to send encoded events to the automation provider (in this case,TermControlAutomationPeer
). We needed our own automation events so that we can reuse this model for ConHost. This is the purpose ofIUiaEventDispatcher
.We need a dispatcher for the
UiaRenderer
. Otherwise, we would do a lot of work to find out when to fire an event, but we wouldn't have a way of doing that.Commit 2: hooking up selection events
This provides a little bit of polish to hooking it up before. Primarily to actually make it work. This includes returning
S_FALSE
instead ofE_NOTIMPL
.The main thing here really is just how to detect if a selection has changed. This also shows how clean adding more events will be in the future!
Validation Steps Performed
Scenario 1: cell selection
click on a cell with text in it
Narrator should read it out
Scenario 2a: expand selection
Click on a cell with text in it and drag it over more text (extending the selection)
Narrator shouild read the first cell, then read either...
(this is still unclear to me when it does which one)
Scenario 2b: reduce selection
Make a selection of an entire word (i.e.: "Powershell")
Reduce the selection to the first character
Narrator should read what got unselected
Scenario 3: Double click
double click on a word
Narrator should read the entire selection
Scenario 4: Triple click
Triple click on a line
Narrator should read the entire selection