-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add Accelerators to all Visual Elements #16202
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Why not capture all keyboard keys globally at App level, then every VisualElement can subscribe to them/whatever? |
Accelerators are a very specific concept that doesn't really map to a global listener. For example, WinUI has a specific KeyboardAcccelerator property on the UIElement itself https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.keyboardaccelerators?view=winrt-26100. The reason for this is that this now tells the OS the combination of keys that are associated with this element. If you were to do this via a global listener then this isn't discoverable by the OS. Doing accelerators via the correct APIs is necessary for accessibility and discoverability. Similarly all UIResponders on iOS have https://developer.apple.com/documentation/uikit/uiresponder/1621141-keycommands Handling key combinations at the app level isn't going to be implicitly discoverable |
Description
We've added Accelerators to MenuItems #5211.
This spec proposes adding
Accelerators
toVisualElement
. WinUI and Catalyst both supportAccelerators
at the base view level.This spec is partially in response to #12004 where
Accelerators
will give users much more fine-grained control at the view level vs at a global level.One of the primary reasons to use
Accelerators
over aGeneric
keyboard listener, is that this this lets the OS know whatKeyCommands
you've implemented short cut behavior against. With this information the OS can provide information to readers and better visual hints about available commands.(Public) API Changes
VisualElement
Properties
Accelerators
as you want.Usage Scenarios
Backward Compatibility
N/A
Difficulty
Medium
The text was updated successfully, but these errors were encountered: