From e428f6ab5d9ecfea72ffd6783a9651908d99687b Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Tue, 8 Feb 2022 00:37:08 +0100 Subject: [PATCH] Ignore F5 key press when ingame menu is open Since ghost menu and browser use F5 already to refresh, and having a bind on it, would cause both actions at once. I believe it makes sense to have this special handling only for F5, other F-keys don't have this problem since we don't use them in any menus. --- src/game/client/components/binds.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 6741f587b..7a6bfb12e 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -4,12 +4,14 @@ #include #include +#include + static const ColorRGBA gs_BindPrintColor{1.0f, 1.0f, 0.8f, 1.0f}; bool CBinds::CBindsSpecial::OnInput(IInput::CEvent Event) { // only handle F and composed F binds - if((Event.m_Key >= KEY_F1 && Event.m_Key <= KEY_F12) || (Event.m_Key >= KEY_F13 && Event.m_Key <= KEY_F24)) + if(((Event.m_Key >= KEY_F1 && Event.m_Key <= KEY_F12) || (Event.m_Key >= KEY_F13 && Event.m_Key <= KEY_F24)) && (Event.m_Key != KEY_F5 || !m_pClient->m_Menus.IsActive())) { int Mask = CBinds::GetModifierMask(Input());