WARNING: GetKeyPressed() <-> GetCharPressed() #1336

Previous GetKeyPressed() method was actually returning unicode codepoints equivalent values instead of the key-code of the pressed key. So, it has been replaced by GetCharPressed(), returning unicode codepoints and GetKeyPressed() now returns key-codes.
This commit is contained in:
Ray 2020-12-18 18:58:02 +01:00
parent 893a64712e
commit 96542269d0
3 changed files with 141 additions and 90 deletions

View file

@ -492,7 +492,9 @@ typedef enum {
LOG_NONE // Disable logging
} TraceLogType;
// Keyboard keys
// Keyboard keys (US keyboard layout)
// NOTE: Use GetKeyPressed() to allow redefining
// required keys for alternative layouts
typedef enum {
// Alphanumeric keys
KEY_APOSTROPHE = 39,
@ -1015,7 +1017,8 @@ RLAPI bool IsKeyDown(int key); // Detect if a key
RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once
RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed
RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
RLAPI int GetKeyPressed(void); // Get key pressed, call it multiple times for chars queued
RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued
RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued
// Input-related functions: gamepads
RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available