-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
XY focus #13947
Conversation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
I think it makes sense to have them as attached properties, personally. A few issues I've noticed:
Other than that the code looks good to me from what I've seen except a few nits below. |
…azy, as it can't be reused on multiple windows
You can test this PR using the following package version. |
You can test this PR using the following package version. |
…ationModes, integrate with KeyDeviceType input types
You can test this PR using the following package version. |
Fixed that, so only subtrees with enabled XY navigation are selectable. Also made a change from UWP by replacing XYFocusKeyboardNavigationMode with XYFocusNavigationModes. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
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.
LGTM and seems to work well!
What it is about:
XY navigation is essential for devices with DPad-like controllers, where we don't have classic Tab navigation nor we don't have pointer helping with focusing elements. For example: TVs and consoles, or desktop controlled with a gamepad. It also is often useful with a normal keyboard depending on the layout of elements, where tabbing is not optimal.
Code is translated and adapted from WinUI 3 source code - https://github.com/microsoft/microsoft-ui-xaml/tree/winui3/release/1.5-stable/dxaml/xcp/components/focus/XYFocus.
API of this PR
Everything is implemented as attached properties:
See https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.input.xyfocusnavigationstrategy?view=winrt-22621 for visual understanding of the XYFocusNavigationStrategy.
Differences from UWP:
Temporary differences from UWP (we planning to implemented)
Possible bug that I am leaving outside of the scope of this PR: