diff options
| author | Ray <[email protected]> | 2020-12-18 18:58:02 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2020-12-18 18:58:02 +0100 |
| commit | 96542269d0ad8f7be9cfb4f0e9d02df2c45703ff (patch) | |
| tree | fd64502ec8534fc312f88e04401ac46db7f317af /src/raylib.h | |
| parent | 893a64712e6702ac14d2001c064b56da0538b1ce (diff) | |
| download | raylib-96542269d0ad8f7be9cfb4f0e9d02df2c45703ff.tar.gz raylib-96542269d0ad8f7be9cfb4f0e9d02df2c45703ff.zip | |
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.
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/raylib.h b/src/raylib.h index 75ed3ffb..fe0ce04c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -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 |
