From b9ab17e8b6b82aecddec192e2e9939651e7b870b Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com> Date: Sat, 19 Aug 2023 20:19:43 +0200 Subject: [PATCH] Bevy Input Docs : lib.rs (#9468) # Objective Complete the documentation of `bevy_input` (#3492). This PR is part of a triptych of PRs : - https://github.com/bevyengine/bevy/pull/9467 - https://github.com/bevyengine/bevy/pull/9469 ## Solution Add missing documentation on items in `lib.rs`. --------- Co-authored-by: Pascal Hertleif --- 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..f3f4ab7afc82d 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 { + /// Is this button pressed? pub fn is_pressed(&self) -> bool { matches!(self, ButtonState::Pressed) }