-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalize bubbling focus input events to other kinds of input (#16876)
# Objective The new `bevy_input_focus` crates has a tool to bubble input events up the entity hierarchy, ending with the window, based on the currently focused entity. Right now though, this only works for keyboard events! Both `bevy_ui` buttons and `bevy_egui` should hook into this system (primarily for contextual hotkeys), and we would like to drive `leafwing_input_manager` via these events, to help resolve longstanding pain around "absorbing" / "consuming" inputs based on focus. In order to make that work properly though, we need gamepad support! ## Solution The logic backing this has been changed to be generic for any cloneable event types, and the machinery to make use of this externally has been made `pub`. Within the engine itself, I've added support for gamepad button and scroll events, but nothing else. Mouse button / touch bubbling is handled via bevy_picking, and mouse / gamepad motion doesn't really make sense to bubble. ## Testing The `tab_navigation` example continues to work, and CI is green. ## Future Work I would like to add more complex UI examples to stress test this, but not here please. We should take advantage of the bubbled mouse scrolling when defining scrolled widgets.
- Loading branch information
1 parent
a4b89d0
commit b9123e7
Showing
2 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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