SDL
SDL copied to clipboard
When using multiple keyboards and raw input, a KEY_UP event is lost if the keys are released together
How to reproduce:
- 2 keyboards are plugged
- Press the same key on keyboard 0, then press the same key on keyboard 1 (doesn't have to be at the same time)
- Release both keys at roughly the same time
After doing this, only one SDL_EVENT_KEY_UP is received.
I provided a simple test application, it listens to events asynchronously via SDL_AddEventWatch and prints: event key keyboard_id frame_number.
Here's a sample output:
DOWN W 0001004f 87
DOWN W 01b509c1 88
UP W 01b509c1 90
Note: Tested on Windows 10. I also tried setting the hint SDL_HINT_WINDOWS_GAMEINPUT, it didn't solve it.
This appears to be a bug specific to GameInput, which is no longer the default for SDL 3.4
It still happens on my Windows 10 machine without using the SDL_HINT_WINDOWS_GAMEINPUT hint:
SDL_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "1");
//SDL_SetHint(SDL_HINT_WINDOWS_GAMEINPUT, "1");