reaction 0.2.0

Universal low-latency input handling for game engines
Documentation
use reaction::prelude::*;

fn main() {
    let mut input = AdvancedInputState::new();

    println!("Simulating Input Frame 1: Press 'W'");
    input.keyboard.press(KeyCode::KeyW, 0.0, 1);

    if input.was_key_just_pressed(KeyCode::KeyW) {
        println!(" -> Action: Start Moving Forward");
    }

    input.end_frame(16.67);

    println!("Simulating Input Frame 2: Hold 'W'");
    // No new press event needed if holding
    if input.is_key_down(KeyCode::KeyW) {
        println!(" -> Action: Continue Moving");
    }
    if !input.was_key_just_pressed(KeyCode::KeyW) {
        println!(" -> Note: Key was NOT just pressed this frame");
    }

    input.end_frame(16.67);

    println!("Simulating Input Frame 3: Release 'W'");
    input.keyboard.release(KeyCode::KeyW, 3);

    if !input.is_key_down(KeyCode::KeyW) {
        println!(" -> Action: Stop Moving");
    }
}