diff options
| author | Ray <[email protected]> | 2022-09-29 11:08:00 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-09-29 11:08:00 +0200 |
| commit | 0ced04f0df789fef5a7e3ff7ff89c67d3e4bdd3a (patch) | |
| tree | 7f4fa8082270cfd7ccdb20c77a39b2ebf032bb05 | |
| parent | 8f88c61bdfe1e6e009dd6f182bc7a2f5c8b38f15 (diff) | |
| download | raylib-0ced04f0df789fef5a7e3ff7ff89c67d3e4bdd3a.tar.gz raylib-0ced04f0df789fef5a7e3ff7ff89c67d3e4bdd3a.zip | |
Fix #2722
| -rw-r--r-- | src/rcore.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c index c7986dfb..7bb71f18 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)) |
