From 43ac3c22bc69592f09518fe6e886c69e2a3b739d Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Thu, 17 Aug 2023 11:59:32 +0200 Subject: [PATCH 1/2] doc(bevy_input): items in lib.rs --- crates/bevy_input/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs index ab5b445bf5529..73ac3c1d92797 100644 --- a/crates/bevy_input/src/lib.rs +++ b/crates/bevy_input/src/lib.rs @@ -52,6 +52,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; #[derive(Default)] pub struct InputPlugin; +/// Label for systems that update the input data. #[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)] pub struct InputSystem; @@ -148,11 +149,14 @@ impl Plugin for InputPlugin { reflect(Serialize, Deserialize) )] pub enum ButtonState { + /// The button is pressed. Pressed, + /// The button is not pressed. Released, } impl ButtonState { + /// Either or not the button is pressed. pub fn is_pressed(&self) -> bool { matches!(self, ButtonState::Pressed) } From c139a262a694cd81e3853da00fc0d4ac59bd072a Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:11:16 +0200 Subject: [PATCH 2/2] Update crates/bevy_input/src/lib.rs Co-authored-by: Pascal Hertleif --- crates/bevy_input/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_input/src/lib.rs b/crates/bevy_input/src/lib.rs index 73ac3c1d92797..f3f4ab7afc82d 100644 --- a/crates/bevy_input/src/lib.rs +++ b/crates/bevy_input/src/lib.rs @@ -156,7 +156,7 @@ pub enum ButtonState { } impl ButtonState { - /// Either or not the button is pressed. + /// Is this button pressed? pub fn is_pressed(&self) -> bool { matches!(self, ButtonState::Pressed) }