Extend KeyDownTriggerBehavior with Modifiers and ability to handle already handled events#853
Open
Irina-Konovalova wants to merge 2 commits into
Open
Conversation
…nts, and modifier keys
6b836a3 to
8b01b15
Compare
Author
|
@dotnet-policy-service agree company="ECIERGE SOFTWARE DEV INC" |
Avid29
requested changes
May 28, 2026
Member
There was a problem hiding this comment.
I think this is a great PR. I love the additional functionality, and I appreciate the coding style such as using guard clauses. However, I dislike the repeated calls to InputKeyboardSource.GetKeyStateForCurrentThread. I do love small purposeful helper functions, but not at the expense of ideal behavior. Let's see about moving the state check into CheckModifiers and inlining IsDown inside Match using the state retrieved in CheckModifiers.
There's also a somewhat trivial code styling question spawned by this PR regarding the ordering of class members. Hoping to get a definitive answer on that soon.
- Consolidate modifier state retrieval into CheckModifiers - Inline IsDown logic into Match - Remove repeated GetKeyStateForCurrentThread calls - Update XML documentation to match new signatures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
This PR extends
KeyDownTriggerBehavior.PR Type
What kind of change does this PR introduce?
KeyDownTriggerBehaviorwithModifiersand ability to handle already handled events.What is the current behavior?
KeyDownTriggerBehaviordoes not support modifier keys or PreviewKeyDown, which limits its use in keyboard navigation scenarios.What is the new behavior?
This PR extends
KeyDownTriggerBehaviorby adding support for modifier keys, PreviewKeyDown, and handled events. It also updates the XML documentation.PR Checklist
Please check if your PR fulfills the following requirements:
Other information