bevy/tools
Talin ea33fc04ab
Add "bevy_input_focus" crate. (#15611)
# 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:

* A resource for tracking which entity has keyboard focus.
* Methods for getting and setting keyboard focus.
* Event definitions for triggering bubble-able keyboard input events to
the focused entity.
* A system for dispatching keyboard input events to the focused entity.

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
2024-12-05 18:08:31 +00:00
..
build-templated-pages Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
build-wasm-example Fix common capitalization errors in documentation (#14562) 2024-07-31 21:16:05 +00:00
ci Add no_std Support to bevy_math (#15810) 2024-12-03 17:14:51 +00:00
compile_fail_utils compile_fail_utils: Verify path exists (#14827) 2024-08-22 16:54:26 +00:00
example-showcase Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
publish.sh Add "bevy_input_focus" crate. (#15611) 2024-12-05 18:08:31 +00:00