From bc572cd270695f0ddaf7d18cb44ef08c6a46a18c Mon Sep 17 00:00:00 2001 From: Talin Date: Thu, 5 Dec 2024 17:16:52 -0800 Subject: [PATCH] bevy_input_focus improvements (follow-up PR) (#16665) This adds a few minor items which were left out of the previous PR: - Added synchronization from bevy_input_focus to bevy_a11y. - Initialize InputFocusVisible resource. - Make `input_focus` available from `bevy` module. I've tested this using VoiceOver on Mac OS. It works, but it needs considerable polish. --- crates/bevy_input_focus/src/lib.rs | 1 + crates/bevy_internal/Cargo.toml | 1 + crates/bevy_internal/src/lib.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/crates/bevy_input_focus/src/lib.rs b/crates/bevy_input_focus/src/lib.rs index bd65e1d0b2..b4a84b2e4c 100644 --- a/crates/bevy_input_focus/src/lib.rs +++ b/crates/bevy_input_focus/src/lib.rs @@ -107,6 +107,7 @@ pub struct InputDispatchPlugin; impl Plugin for InputDispatchPlugin { fn build(&self, app: &mut App) { app.insert_resource(InputFocus(None)) + .insert_resource(InputFocusVisible(false)) .add_systems(Update, dispatch_keyboard_input); } } diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index fc1d9a3d5d..c6f3fed2d9 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -268,6 +268,7 @@ bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-dev" } bevy_state = { path = "../bevy_state", optional = true, version = "0.15.0-dev" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-dev" } bevy_input = { path = "../bevy_input", version = "0.15.0-dev" } +bevy_input_focus = { path = "../bevy_input_focus", version = "0.15.0-dev" } bevy_log = { path = "../bevy_log", version = "0.15.0-dev" } bevy_math = { path = "../bevy_math", version = "0.15.0-dev" } bevy_ptr = { path = "../bevy_ptr", version = "0.15.0-dev" } diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs index dd7c351773..34b308cd97 100644 --- a/crates/bevy_internal/src/lib.rs +++ b/crates/bevy_internal/src/lib.rs @@ -41,6 +41,7 @@ pub use bevy_hierarchy as hierarchy; #[cfg(feature = "bevy_image")] pub use bevy_image as image; pub use bevy_input as input; +pub use bevy_input_focus as input_focus; pub use bevy_log as log; pub use bevy_math as math; #[cfg(feature = "bevy_pbr")]