From 8c014a5d26fcce9e2894d53f63e7ca74af557403 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 29 May 2024 17:48:49 +1000 Subject: [PATCH] GUIs that grab input should always prevent all normal actions --- src/Input.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Input.c b/src/Input.c index 28a9a12e6..ff231887e 100644 --- a/src/Input.c +++ b/src/Input.c @@ -1151,8 +1151,6 @@ static void InputHandler_CheckZoomFov(void* obj) { } static cc_bool HandleBlockKey(int key) { - if (Gui.InputGrab) return false; - if (InputBind_Claims(BIND_DELETE_BLOCK, key)) { MouseStatePress(MOUSE_LEFT); InputHandler_DeleteBlock(); @@ -1330,8 +1328,9 @@ static void OnInputDown(void* obj, int key, cc_bool was) { s->dirty = true; if (s->VTABLE->HandlesInputDown(s, key)) return; } + if (Gui.InputGrab) return; - if (Input_IsPauseButton(key) && !Gui.InputGrab) { + if (Input_IsPauseButton(key)) { #ifdef CC_BUILD_WEB /* Can't do this in KeyUp, because pressing escape without having */ /* explicitly disabled mouse lock means a KeyUp event isn't sent. */