SDL icon indicating copy to clipboard operation
SDL copied to clipboard

When using multiple keyboards and raw input, a KEY_UP event is lost if the keys are released together

Open rafccq opened this issue 7 months ago • 2 comments

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.

main.zip

rafccq avatar Apr 29 '25 03:04 rafccq

This appears to be a bug specific to GameInput, which is no longer the default for SDL 3.4

slouken avatar Oct 09 '25 23:10 slouken

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");

livinamuk avatar Nov 10 '25 12:11 livinamuk