summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2022-08-07 19:19:18 +0200
committerRay <[email protected]>2022-08-07 19:19:18 +0200
commit2c0071c8516e89d2e0ac6733cb2fff2f7c887866 (patch)
treea02b5eabbba44f9ef2b2d6aa7be97fd1d5b65734 /src
parent63a23a6b744a0a4cd79698eeec0db531a8c3fd40 (diff)
downloadraylib-2c0071c8516e89d2e0ac6733cb2fff2f7c887866.tar.gz
raylib-2c0071c8516e89d2e0ac6733cb2fff2f7c887866.zip
Reviewed issue with negative key #2619
Diffstat (limited to 'src')
-rw-r--r--src/rcore.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 5953b138..dbdec801 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -5265,6 +5265,8 @@ static void WindowFocusCallback(GLFWwindow *window, int focused)
// GLFW3 Keyboard Callback, runs on key pressed
static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
{
+ if (key < 0) return; // Security check, macOS fn key generates -1
+
// WARNING: GLFW could return GLFW_REPEAT, we need to consider it as 1
// to work properly with our implementation (IsKeyDown/IsKeyUp checks)
if (action == GLFW_RELEASE) CORE.Input.Keyboard.currentKeyState[key] = 0;