From d7c86c6ae943b12e479f48a30a5d7e30e14b8f37 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sun, 30 Apr 2017 20:26:05 +0300 Subject: [PATCH] Fixed a bug when GUI elements ate keystrokes even when hidden --- src/hooks/others.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 52e56eb7..f7c6df37 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -87,7 +87,7 @@ CUserCmd* GetUserCmd_hook(IInput* thisptr, int sequence_number) { int IN_KeyEvent_hook(void* thisptr, int eventcode, int keynum, const char* pszCurrentBinding) { SEGV_BEGIN; - if (g_pGUI->ConsumesKey((ButtonCode_t)keynum)) { + if (g_pGUI->ConsumesKey((ButtonCode_t)keynum) && g_pGUI->Visible()) { return 0; } return ((IN_KeyEvent_t*)hooks::hkClient->GetMethod(hooks::offKeyEvent))(thisptr, eventcode, keynum, pszCurrentBinding);