Fix double-click handling with gfx_asyncrender_old 0

We need to call `SDL_PumpEvents()` to ensure that we have the latest keyboard, mouse and joystick state before we use it.

See:
- https://wiki.libsdl.org/SDL2/SDL_GetKeyboardState
- https://wiki.libsdl.org/SDL3/SDL_GetMouseState#code-examples

Closes #7052.
This commit is contained in:
Robert Müller 2023-09-22 17:06:45 +02:00
parent c975c3944f
commit 98bfed7859

View file

@ -557,6 +557,9 @@ int CInput::Update()
// keep the counter between 1..0xFFFF, 0 means not pressed
m_InputCounter = (m_InputCounter % 0xFFFF) + 1;
// Ensure that we have the latest keyboard, mouse and joystick state
SDL_PumpEvents();
int NumKeyStates;
const Uint8 *pState = SDL_GetKeyboardState(&NumKeyStates);
if(NumKeyStates >= KEY_MOUSE_1)