From dd3772ce86e9edc322ba8bea0bb2ddfe0cf456e6 Mon Sep 17 00:00:00 2001 From: Vincent Junge Date: Thu, 7 Mar 2024 19:39:49 +0100 Subject: [PATCH 1/2] docs --- crates/bevy_input/src/button_input.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/bevy_input/src/button_input.rs b/crates/bevy_input/src/button_input.rs index 8e4c05e4b9e2a..f4a33088655d5 100644 --- a/crates/bevy_input/src/button_input.rs +++ b/crates/bevy_input/src/button_input.rs @@ -29,6 +29,15 @@ use bevy_ecs::schedule::State; /// * Using [`ButtonInput::clear_just_pressed`] or [`ButtonInput::clear_just_released`] instead. /// * Calling [`ButtonInput::clear`] or [`ButtonInput::reset`] immediately after the state change. /// +/// ## Window focus +/// +/// `ButtonInput` is tied to window focus. For example, if the user holds a button +/// while the window looses focus, [`ButtonInput::just_released`] will trigger; if the window +/// regains focus, [`ButtonInput::just_pressed`] will trigger. Currently this happens even if the +/// focus switches from one Bevy window to another (for example because a new window was just spawned). +/// +/// `ButtonInput` is independent of window focus. +/// /// ## Note /// /// When adding this resource for a new input type, you should: From f8b06dd7e8bc62ead2fa333dc613e137dec6240f Mon Sep 17 00:00:00 2001 From: SpecificProtagonist Date: Thu, 7 Mar 2024 21:29:31 +0100 Subject: [PATCH 2/2] wording & spelling Co-authored-by: Mateusz Wachowiak --- crates/bevy_input/src/button_input.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_input/src/button_input.rs b/crates/bevy_input/src/button_input.rs index f4a33088655d5..f4c2bf4b1f83e 100644 --- a/crates/bevy_input/src/button_input.rs +++ b/crates/bevy_input/src/button_input.rs @@ -32,8 +32,8 @@ use bevy_ecs::schedule::State; /// ## Window focus /// /// `ButtonInput` is tied to window focus. For example, if the user holds a button -/// while the window looses focus, [`ButtonInput::just_released`] will trigger; if the window -/// regains focus, [`ButtonInput::just_pressed`] will trigger. Currently this happens even if the +/// while the window loses focus, [`ButtonInput::just_released`] will be triggered. Similarly if the window +/// regains focus, [`ButtonInput::just_pressed`] will be triggered. Currently this happens even if the /// focus switches from one Bevy window to another (for example because a new window was just spawned). /// /// `ButtonInput` is independent of window focus.