Browse Source

rename KeyCodes to KeyInfo

use the correct value for virtual key from sdl.
pull/4481/head
Jeffery Myers 6 days ago
parent
commit
dccef93604
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/platforms/rcore_desktop_sdl.c
  2. +2
    -2
      src/rcore.c

+ 1
- 1
src/platforms/rcore_desktop_sdl.c View File

@ -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++;
}

+ 2
- 2
src/rcore.c View File

@ -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)

Loading…
Cancel
Save