pub trait InputState: KeyboardState {
// Required methods
fn begin(&mut self) -> Result<()>;
fn next_loop(&mut self) -> Result<NextLoopState>;
fn finish(&mut self) -> Result<()>;
}Expand description
Trait for managing input state in a game loop.
This trait extends KeyboardState and provides methods for managing input
state throughout the lifecycle of a game loop.
Its methods provide a way for different platform implementations to hook into the game loop cycle to handle input event processing.
Required Methods§
Sourcefn begin(&mut self) -> Result<()>
fn begin(&mut self) -> Result<()>
Initializes the input state before starting a loop.
This method is called once before entering the main loop.
Sourcefn next_loop(&mut self) -> Result<NextLoopState>
fn next_loop(&mut self) -> Result<NextLoopState>
Updates the input state for the next frame.
This method is called at the beginning of each loop iteration, before the update function is invoked.