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 <killercup@gmail.com>
This commit is contained in:
Tristan Guichaoua 2023-08-19 20:19:43 +02:00 committed by GitHub
parent 0087556028
commit b9ab17e8b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}