From 0ced04f0df789fef5a7e3ff7ff89c67d3e4bdd3a Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 29 Sep 2022 11:08:00 +0200 Subject: [PATCH] Fix #2722 --- src/rcore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index c7986dfb7..7bb71f18c 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -4134,11 +4134,11 @@ static bool InitGraphicsDevice(int width, int height) glfwSetScrollCallback(CORE.Window.handle, MouseScrollCallback); glfwSetCursorEnterCallback(CORE.Window.handle, CursorEnterCallback); - glfwSetInputMode(CORE.Window.handle, GLFW_LOCK_KEY_MODS, GLFW_TRUE); // Enable lock keys modifiers (CAPS, NUM) - glfwMakeContextCurrent(CORE.Window.handle); #if !defined(PLATFORM_WEB) + glfwSetInputMode(CORE.Window.handle, GLFW_LOCK_KEY_MODS, GLFW_TRUE); // Enable lock keys modifiers (CAPS, NUM) + glfwSwapInterval(0); // No V-Sync by default #endif @@ -5267,9 +5267,11 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i if (action == GLFW_RELEASE) CORE.Input.Keyboard.currentKeyState[key] = 0; else CORE.Input.Keyboard.currentKeyState[key] = 1; +#if !defined(PLATFORM_WEB) // WARNING: Check if CAPS/NUM key modifiers are enabled and force down state for those keys if (((key == KEY_CAPS_LOCK) && ((mods & GLFW_MOD_CAPS_LOCK) > 0)) || ((key == KEY_NUM_LOCK) && ((mods & GLFW_MOD_NUM_LOCK) > 0))) CORE.Input.Keyboard.currentKeyState[key] = 1; +#endif // Check if there is space available in the key queue if ((CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE) && (action == GLFW_PRESS))