astrelis-input 0.2.3

Astrelis input handling library
Documentation

Input state management for tracking keyboard, mouse, and gamepad state.

This module provides a unified input system that tracks the current state of input devices, making it easy to query whether keys or buttons are pressed, just pressed, or just released.

Example

use astrelis_input::InputState;

let mut input = InputState::new();

// In your event loop:
input.handle_events(&mut events);

// Query input state:
if input.is_key_pressed(KeyCode::Space) {
    player.jump();
}

if input.is_key_just_pressed(KeyCode::Escape) {
    game.pause();
}

let mouse_delta = input.mouse_delta();

// At the end of each frame:
input.end_frame();