simple_game_engine/input/
mod.rs

1//! Data structures for inspecting user input.
2
3mod button;
4pub use button::Button;
5mod state;
6use state::ButtonState;
7
8mod mouse;
9pub use mouse::MouseState;
10
11pub use sdl2::{keyboard::Scancode, mouse::MouseButton};
12
13pub(crate) type KeyboardState = ButtonState<Scancode>;
14
15/// The state of all supported input devices.
16pub struct InputState {
17    /// State of every SDL2 supported key on the keyboard
18    pub keyboard: KeyboardState,
19    /// State of every SDL2 supported mouse button, as well as the cursor's *x* and *y* coordinates
20    pub mouse: MouseState,
21}