mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
REVIEWED: SDL text input to Unicode codepoints #3650
REVIEWED: GLFW naming conventions to reflect codepoints reading
This commit is contained in:
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user