From 19450edc5258f98558c85b5fdd562cff9db0fd73 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Mon, 5 Jan 2026 16:14:01 +0000 Subject: [PATCH] feat: Update mouse grab behavior and add gamepad state handling in InputState --- config/gui_runtime.json | 2 +- scripts/gui.lua | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/gui_runtime.json b/config/gui_runtime.json index 8519e4c..8349e17 100644 --- a/config/gui_runtime.json +++ b/config/gui_runtime.json @@ -15,7 +15,7 @@ ], "mouse_grab": { "enabled": true, - "grab_on_click": true, + "grab_on_click": false, "release_on_escape": true, "start_grabbed": false, "hide_cursor": true, diff --git a/scripts/gui.lua b/scripts/gui.lua index 9a7983e..cd58e3b 100644 --- a/scripts/gui.lua +++ b/scripts/gui.lua @@ -103,6 +103,15 @@ function InputState:addTextInput(text) self.textInput = (self.textInput or "") .. (text or "") end +function InputState:setGamepad(connected, leftX, leftY, rightX, rightY, togglePressed) + self.gamepadConnected = connected + self.gamepadLeftX = leftX or 0 + self.gamepadLeftY = leftY or 0 + self.gamepadRightX = rightX or 0 + self.gamepadRightY = rightY or 0 + self.gamepadTogglePressed = togglePressed +end + function InputState:resetTransient() self.textInput = "" self.wheel = 0