mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
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:
parent
0a7ff4f9d0
commit
e428f6ab5d
|
@ -4,12 +4,14 @@
|
||||||
#include <engine/config.h>
|
#include <engine/config.h>
|
||||||
#include <engine/shared/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};
|
static const ColorRGBA gs_BindPrintColor{1.0f, 1.0f, 0.8f, 1.0f};
|
||||||
|
|
||||||
bool CBinds::CBindsSpecial::OnInput(IInput::CEvent Event)
|
bool CBinds::CBindsSpecial::OnInput(IInput::CEvent Event)
|
||||||
{
|
{
|
||||||
// only handle F and composed F binds
|
// 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());
|
int Mask = CBinds::GetModifierMask(Input());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue