rename KeyCodes to KeyInfo
use the correct value for virtual key from sdl.
This commit is contained in:
parent
a4e17ba171
commit
dccef93604
|
|
@ -1488,7 +1488,7 @@ void PollInputEvents(void)
|
||||||
if ((CORE.Input.Keyboard.currentKeyState[key] == 0) && (CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE))
|
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].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++;
|
CORE.Input.Keyboard.keyPressedQueueCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ __declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
typedef struct { int x; int y; } Point;
|
typedef struct { int x; int y; } Point;
|
||||||
typedef struct { unsigned int width; unsigned int height; } Size;
|
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
|
// Core global state context data
|
||||||
typedef struct CoreData {
|
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
|
// 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
|
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 keyPressedQueueCount; // Input keys queue count
|
||||||
|
|
||||||
int charPressedQueue[MAX_CHAR_PRESSED_QUEUE]; // Input characters queue (unicode)
|
int charPressedQueue[MAX_CHAR_PRESSED_QUEUE]; // Input characters queue (unicode)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user