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.
This commit is contained in:
Dennis Felsing 2022-02-08 00:37:08 +01:00
parent 0a7ff4f9d0
commit e428f6ab5d

View file

@ -4,12 +4,14 @@
#include <engine/config.h>
#include <engine/shared/config.h>
#include <game/client/gameclient.h>
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());