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'");
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");
}
}