start input

This commit is contained in:
2026-08-06 09:27:23 +02:00
parent 5c6f49616f
commit f6a3aa3bc7

25
src/input.rs Normal file
View File

@@ -0,0 +1,25 @@
use std::collections::HashSet;
use evdev::{AbsoluteAxisCode, Device, EventSummary, KeyCode};
struct InputState {
x: i32,
y: i32,
keys_down: HashSet<KeyCode>,
keys_pressed_this_update: HashSet<KeyCode>,
keys_released_this_update: HashSet<KeyCode>,
clear_before_next_event: bool,
}
impl InputState {
pub fn new() -> Self {
Self {
x: 0,
y: 0,
keys_down: HashSet::new(),
keys_pressed_this_update: HashSet::new(),
keys_released_this_update: HashSet::new(),
clear_before_next_event: true,
}
}
}