Skip to content

Commit

Permalink
rename KeyCodes to KeyInfo
Browse files Browse the repository at this point in the history
use the correct value for virtual key from sdl.
  • Loading branch information
JeffM2501 committed Dec 11, 2024
1 parent a4e17ba commit dccef93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/platforms/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down
4 changes: 2 additions & 2 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit dccef93

Please sign in to comment.