mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix stuck input
This commit is contained in:
parent
c0c79c69c3
commit
1da935f4c1
|
@ -52,6 +52,10 @@ void CBinds::Bind(int KeyID, const char *pStr, bool FreeOnly, int Modifier)
|
|||
m_aapKeyBindings[Modifier][KeyID] = 0;
|
||||
}
|
||||
|
||||
// skip modifiers for +xxx binds
|
||||
if(pStr[0] == '+')
|
||||
Modifier = 0;
|
||||
|
||||
char aBuf[256];
|
||||
if(!pStr[0])
|
||||
{
|
||||
|
@ -132,7 +136,7 @@ bool CBinds::OnInput(IInput::CEvent e)
|
|||
bool ret = false;
|
||||
for(int Mod = 0; Mod < MODIFIER_COUNT; Mod++)
|
||||
{
|
||||
if(Mask & (1 << Mod) && m_aapKeyBindings[Mod][e.m_Key])
|
||||
if(m_aapKeyBindings[Mod][e.m_Key] && (((Mask&(1 << Mod)) || (Mod == 0 && m_aapKeyBindings[0][e.m_Key][0] == '+')))) // always trigger +xxx binds despite any modifier
|
||||
{
|
||||
if(e.m_Flags&IInput::FLAG_PRESS)
|
||||
Console()->ExecuteLineStroked(1, m_aapKeyBindings[Mod][e.m_Key]);
|
||||
|
|
Loading…
Reference in a new issue