From f6a3aa3bc7d339c8590895ede91d22d033faaa24 Mon Sep 17 00:00:00 2001 From: Avii Date: Thu, 6 Aug 2026 09:27:23 +0200 Subject: [PATCH] start input --- src/input.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/input.rs diff --git a/src/input.rs b/src/input.rs new file mode 100644 index 0000000..814206c --- /dev/null +++ b/src/input.rs @@ -0,0 +1,25 @@ +use std::collections::HashSet; + +use evdev::{AbsoluteAxisCode, Device, EventSummary, KeyCode}; + +struct InputState { + x: i32, + y: i32, + keys_down: HashSet, + keys_pressed_this_update: HashSet, + keys_released_this_update: HashSet, + 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, + } + } +}