mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use KEY_FIRST
and KEY_UNKNOWN
instead of 0
This commit is contained in:
parent
c959665226
commit
09462cff67
|
@ -335,7 +335,7 @@ void CInput::Clear()
|
||||||
|
|
||||||
bool CInput::KeyState(int Key) const
|
bool CInput::KeyState(int Key) const
|
||||||
{
|
{
|
||||||
if(Key < 0 || Key >= KEY_LAST)
|
if(Key < KEY_FIRST || Key >= KEY_LAST)
|
||||||
return false;
|
return false;
|
||||||
return m_aInputState[Key];
|
return m_aInputState[Key];
|
||||||
}
|
}
|
||||||
|
@ -618,7 +618,7 @@ int CInput::Update()
|
||||||
}
|
}
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
m_EditingTextLen = -1;
|
m_EditingTextLen = -1;
|
||||||
AddEvent(Event.text.text, 0, IInput::FLAG_TEXT);
|
AddEvent(Event.text.text, KEY_UNKNOWN, IInput::FLAG_TEXT);
|
||||||
break;
|
break;
|
||||||
// handle keys
|
// handle keys
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
|
|
|
@ -126,7 +126,7 @@ int CBinds::GetModifierMaskOfKey(int Key)
|
||||||
bool CBinds::OnInput(const IInput::CEvent &Event)
|
bool CBinds::OnInput(const IInput::CEvent &Event)
|
||||||
{
|
{
|
||||||
// don't handle invalid events
|
// don't handle invalid events
|
||||||
if(Event.m_Key <= 0 || Event.m_Key >= KEY_LAST)
|
if(Event.m_Key <= KEY_FIRST || Event.m_Key >= KEY_LAST)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int Mask = GetModifierMask(Input());
|
int Mask = GetModifierMask(Input());
|
||||||
|
|
Loading…
Reference in a new issue