From 504219aefbbcd802dae6ef80a750edf7679ed508 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 10 Sep 2025 03:41:38 +1000 Subject: [PATCH] fix not tracking input cursor positions --- platform.d | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform.d b/platform.d index a313169..a028d26 100644 --- a/platform.d +++ b/platform.d @@ -88,11 +88,13 @@ ResetInputs(Inputs* inputs) } void -Push(Inputs* inputs, Input input, bool pressed) +Push(Inputs* inputs, Input input, i32 x, i32 y, bool pressed) { DNode!(InputEvent)* node = Alloc!(DNode!(InputEvent))(&inputs.arena); node.value.key = input; node.value.pressed = pressed; + node.value.x = x; + node.value.y = y; DLLPushFront(&inputs.list, node, null); } @@ -386,7 +388,7 @@ HandleEvents(PlatformWindow* window) if (input != KBI.None) { - Push(inputs, input, pressed); + Push(inputs, input, keyboard_event.root_x, keyboard_event.root_y, pressed); } } break; case XCB_BUTTON_PRESS: @@ -406,7 +408,7 @@ HandleEvents(PlatformWindow* window) if (input != Input.None) { - Push(inputs, input, pressed); + Push(inputs, input, mouse_event.root_x, mouse_event.root_y, pressed); } } break; case XCB_MOTION_NOTIFY: