diff options
| author | Ray <[email protected]> | 2023-12-23 12:04:19 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-12-23 12:04:19 +0100 |
| commit | efe3510a9a2863afc48c50d38679c0d2ef1929d4 (patch) | |
| tree | 2a344e774336a3a8ffcd84638a27a4a9dc1863ec /src/platforms/rcore_desktop.c | |
| parent | 1792bce2924d2cfed9f63aa855dc56be449334f2 (diff) | |
| download | raylib-efe3510a9a2863afc48c50d38679c0d2ef1929d4.tar.gz raylib-efe3510a9a2863afc48c50d38679c0d2ef1929d4.zip | |
REVIEWED: SDL text input to Unicode codepoints #3650
REVIEWED: GLFW naming conventions to reflect codepoints reading
Diffstat (limited to 'src/platforms/rcore_desktop.c')
| -rw-r--r-- | src/platforms/rcore_desktop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index 0dfcacd8..2bbb3f2b 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -126,7 +126,7 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths // Input callbacks events static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods); // GLFW3 Keyboard Callback, runs on key pressed -static void CharCallback(GLFWwindow *window, unsigned int key); // GLFW3 Char Key Callback, runs on key pressed (get char value) +static void CharCallback(GLFWwindow *window, unsigned int codepoint); // GLFW3 Char Callback, runs on key pressed (get codepoint value) static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods); // GLFW3 Mouse Button Callback, runs on mouse button pressed static void MouseCursorPosCallback(GLFWwindow *window, double x, double y); // GLFW3 Cursor Position Callback, runs on mouse move static void MouseScrollCallback(GLFWwindow *window, double xoffset, double yoffset); // GLFW3 Scrolling Callback, runs on mouse wheel @@ -1714,10 +1714,10 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i if ((key == CORE.Input.Keyboard.exitKey) && (action == GLFW_PRESS)) glfwSetWindowShouldClose(platform.handle, GLFW_TRUE); } -// GLFW3 Char Key Callback, runs on key down (gets equivalent unicode char value) -static void CharCallback(GLFWwindow *window, unsigned int key) +// GLFW3 Char Callback, get unicode codepoint value +static void CharCallback(GLFWwindow *window, unsigned int codepoint) { - //TRACELOG(LOG_DEBUG, "Char Callback: KEY:%i(%c)", key, key); + //TRACELOG(LOG_DEBUG, "Char Callback: Codepoint: %i", codepoint); // NOTE: Registers any key down considering OS keyboard layout but // does not detect action events, those should be managed by user... @@ -1728,7 +1728,7 @@ static void CharCallback(GLFWwindow *window, unsigned int key) if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE) { // Add character to the queue - CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = key; + CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = codepoint; CORE.Input.Keyboard.charPressedQueueCount++; } } |
