From dccef9360433feecfc8b696ef5bcc47ff6575658 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Wed, 11 Dec 2024 15:59:38 -0800 Subject: [PATCH] rename KeyCodes to KeyInfo use the correct value for virtual key from sdl. --- src/platforms/rcore_desktop_sdl.c | 2 +- src/rcore.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 8af56b6d4..a1ffb7f98 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1488,7 +1488,7 @@ void PollInputEvents(void) if ((CORE.Input.Keyboard.currentKeyState[key] == 0) && (CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE)) { CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount].keycode = key; - CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount].scancode = event.key.keysym.scancode; + CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount].scancode = event.key.keysym.sym; CORE.Input.Keyboard.keyPressedQueueCount++; } diff --git a/src/rcore.c b/src/rcore.c index fdbc332be..bc0e4984b 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -268,7 +268,7 @@ __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod) //---------------------------------------------------------------------------------- typedef struct { int x; int y; } Point; typedef struct { unsigned int width; unsigned int height; } Size; -typedef struct { int keycode; int scancode; } KeyCodes; +typedef struct { int keycode; int scancode; } KeyInfo; // Core global state context data typedef struct CoreData { @@ -311,7 +311,7 @@ typedef struct CoreData { // NOTE: Since key press logic involves comparing prev vs cur key state, we need to handle key repeats specially char keyRepeatInFrame[MAX_KEYBOARD_KEYS]; // Registers key repeats for current frame - KeyCodes keyPressedQueue[MAX_KEY_PRESSED_QUEUE]; // Input keys queue + KeyInfo keyPressedQueue[MAX_KEY_PRESSED_QUEUE]; // Input keys queue int keyPressedQueueCount; // Input keys queue count int charPressedQueue[MAX_CHAR_PRESSED_QUEUE]; // Input characters queue (unicode)