sdl2: Ignore key-repeats events.

Fixes keyboard input during gameplay.
This commit is contained in:
Ryan C. Gordon 2024-05-05 10:13:21 -04:00
parent 65b1a7dc3b
commit 851f47537b
No known key found for this signature in database
GPG Key ID: FA148B892AB48044

View File

@ -355,6 +355,7 @@ int sdlKeyFilter(const SDL_Event *event) {
switch (event->key.state) {
case SDL_PRESSED:
if (event->key.repeat) break; // ignore these, we only want to know if it's a first time pressed, not a key-repeat.
kc = sdlkeycode_to_keycode(event->key.keysym.sym);
if (event->key.keysym.mod & KMOD_CTRL) {
switch (kc) {