diff options
| author | ubkp <[email protected]> | 2023-12-07 15:47:58 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-07 19:47:58 +0100 |
| commit | d99617d084daeed629733419dd781f5f02422f0a (patch) | |
| tree | f505420ed7a9aee813ceb42e5c867afe4c0aae18 /src/platforms | |
| parent | 984e83c2d0c6f75053a1ab533e12aece80e24b32 (diff) | |
| download | raylib-d99617d084daeed629733419dd781f5f02422f0a.tar.gz raylib-d99617d084daeed629733419dd781f5f02422f0a.zip | |
[rcore] Fix `IsKeyPressedRepeat()` for `PLATFORM_DESKTOP_SDL` (#3605)
* Fix IsKeyPressedRepeat() for PLATFORM_DESKTOP_SDL
* Fix missing space
Diffstat (limited to 'src/platforms')
| -rw-r--r-- | src/platforms/rcore_desktop_sdl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index e684465c..127c302b 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -969,9 +969,6 @@ void PollInputEvents(void) CORE.Input.Keyboard.keyPressedQueueCount = 0; CORE.Input.Keyboard.charPressedQueueCount = 0; - // Reset key repeats - for (int i = 0; i < MAX_KEYBOARD_KEYS; i++) CORE.Input.Keyboard.keyRepeatInFrame[i] = 0; - // Reset mouse wheel CORE.Input.Mouse.currentWheelMove.x = 0; CORE.Input.Mouse.currentWheelMove.y = 0; @@ -1097,6 +1094,8 @@ void PollInputEvents(void) KeyboardKey key = ConvertScancodeToKey(event.key.keysym.scancode); if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 1; + if (event.key.repeat) CORE.Input.Keyboard.keyRepeatInFrame[key] = 1; + // TODO: Put exitKey verification outside the switch? if (CORE.Input.Keyboard.currentKeyState[CORE.Input.Keyboard.exitKey]) { |
