Skip to main content

Module input

Module input 

Source
Expand description

Input handling — keyboard, mouse, scroll, and window events.

InputState is rebuilt fresh each frame by the render pipeline and handed to game code inside ProofGame::update(). All transient state (just-pressed, just-released, delta values) is cleared at the start of each frame.

§Example

use proof_engine::input::{InputState, Key};

fn my_update(input: &InputState) {
    if input.just_pressed(Key::Space) {
        println!("space!");
    }
    if input.mouse_left {
        println!("dragging at ({}, {})", input.mouse_x, input.mouse_y);
    }
}

Modules§

keybindings
Key bindings, chord detection, analog axes, and input action system.

Structs§

InputState
Complete snapshot of all input this frame.

Enums§

Key
Keyboard key codes understood by the engine.