From 664f123a856d9a3b0b1429bc8c946e1d2bc1b749 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 14 Jan 2025 02:56:55 +0300 Subject: [PATCH] twn_input.c: zero ctx.mouse_movement on focus lost --- src/twn_input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/twn_input.c b/src/twn_input.c index 9eaf186..cae2220 100644 --- a/src/twn_input.c +++ b/src/twn_input.c @@ -234,6 +234,8 @@ void input_state_update(InputState *input) { if (ctx.window_mouse_resident) ctx.game.mouse_movement = input->mouse_relative_position; + else + ctx.game.mouse_movement = (Vec2){0}; for (size_t i = 0; i < shlenu(input->action_hash); ++i) { Action *action = &input->action_hash[i].value;