From 6cd7e1826d91c34c4fc8beb338e1f7eb2eaebb7c Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 19 Mar 2022 12:21:19 +0100 Subject: [PATCH] Fix #2675 "Quickmenu closes when navigated by mouse" --- qcsrc/client/hud/panel/quickmenu.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index 6310a0e69..51f1e7373 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -449,6 +449,8 @@ bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary) // at this point bInputType can only be 0 or 1 (key pressed or released) bool key_pressed = (bInputType == 0); + int hudShiftState_prev = hudShiftState; + int mouseClicked_prev = mouseClicked; if(key_pressed) { if(nPrimary == K_ALT) hudShiftState |= S_ALT; @@ -474,7 +476,7 @@ bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary) { QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary))); } - else + else if (hudShiftState_prev == hudShiftState && mouseClicked_prev == mouseClicked) { // allow console bind to work string con_keys = findkeysforcommand("toggleconsole", 0); -- 2.39.2