-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add "bevy_input_focus" crate. #15611
base: main
Are you sure you want to change the base?
Conversation
I really want this, and I like the fundamental design. At the start of the 0.16 cycle I'm going to come back to this, evaluate scope and then decide how to proceed. We may want a working group for all of the follow-up. |
One thing that has not been established is the relationship between this and bevy_a11y. I had originally assumed that this would depend on bevy_a11y, but it sounds like you were thinking that it would be the other way around. |
Yeah, my expectation is that bevy_a11y is a consumer of the focus data produced here from user input, and so should depend on this crate. |
@@ -47,6 +47,7 @@ crates=( | |||
bevy_dylib | |||
bevy_color | |||
bevy_picking | |||
bevy_input_focus |
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.
this should not be at the end of the list, put it right after bevy_input imo
Objective
Define a framework for handling keyboard focus and bubbled keyboard events, as discussed in #15374.
Solution
Introduces a new crate,
bevy_input_focus
. This crate provides:This crate does not provide any integration with UI widgets, or provide functions for
tab navigation or gamepad-based focus navigation, as those are typically application-specific.
Testing
Most of the code has been copied from a different project, one that has been well tested. However, most of what's in this module consists of type definitions, with relatively small amounts of executable code. That being said, I expect that there will be substantial bikeshedding on the design, and I would prefer to hold off writing tests until after things have settled.
I think that an example would be appropriate, however I'm waiting on a few other pending changes to Bevy before doing so. In particular, I can see a simple example with four buttons, with focus navigation between them, and which can be triggered by the keyboard.
@alice-i-cecile