mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
do not copy keyboard over mouse state, refactoring
This commit is contained in:
parent
79879591b1
commit
6675de319b
|
@ -223,15 +223,14 @@ int CInput::Update()
|
|||
// keep the counter between 1..0xFFFF, 0 means not pressed
|
||||
m_InputCounter = (m_InputCounter % 0xFFFF) + 1;
|
||||
|
||||
{
|
||||
int i;
|
||||
const Uint8 *pState = SDL_GetKeyboardState(&i);
|
||||
if(i >= KEY_LAST)
|
||||
i = KEY_LAST - 1;
|
||||
mem_copy(m_aInputState, pState, i);
|
||||
if(m_EditingTextLen == 0)
|
||||
m_EditingTextLen = -1;
|
||||
}
|
||||
int NumKeyStates;
|
||||
const Uint8 *pState = SDL_GetKeyboardState(&NumKeyStates);
|
||||
if(NumKeyStates >= KEY_MOUSE_1)
|
||||
NumKeyStates = KEY_MOUSE_1;
|
||||
mem_copy(m_aInputState, pState, NumKeyStates);
|
||||
mem_zero(m_aInputState + NumKeyStates, KEY_LAST - NumKeyStates);
|
||||
if(m_EditingTextLen == 0)
|
||||
m_EditingTextLen = -1;
|
||||
|
||||
// these states must always be updated manually because they are not in the GetKeyState from SDL
|
||||
const int MouseState = SDL_GetMouseState(NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue