From 878fbdd934285c5ff0826321e2d8f3d44a2ff18c Mon Sep 17 00:00:00 2001 From: Julia <145168563+julia-aph@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:17:14 -0500 Subject: [PATCH] uh wiah --- source/io/ctrl.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/source/io/ctrl.c b/source/io/ctrl.c index 3bc7cce..e4cbb8d 100644 --- a/source/io/ctrl.c +++ b/source/io/ctrl.c @@ -19,37 +19,36 @@ enum InputType { ESCAPE }; -struct Button { - u64 value; -} but; -struct Axis { - i64 value; -} axis; -struct Joystick { - i32 x; - i32 y; -} js; - -struct InputRecord { - u16f bind; - +struct Input { u8 type; u8 is_down; u8 is_held; u8 is_up; union { - struct Button but; - struct Axis axis; - struct Joystick js; + struct Button { + u64 value; + } but; + struct Axis { + i64 value; + } axis; + struct Joystick { + i32 x; + i32 y; + } js; }; +}; + +struct InputRecord { + u16f bind; + struct Input dat; struct timespec timestamp; }; struct InputAxis { - struct input; - + struct Input dat; + struct timespec last_pressed; struct timespec last_released; };