浏览代码

Reviewed issue with negative key #2619

pull/2620/head
Ray 3 年前
父节点
当前提交
2c0071c851
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      src/rcore.c

+ 2
- 0
src/rcore.c 查看文件

@ -5265,6 +5265,8 @@ static void WindowFocusCallback(GLFWwindow *window, int focused)
// GLFW3 Keyboard Callback, runs on key pressed // GLFW3 Keyboard Callback, runs on key pressed
static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) 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 // WARNING: GLFW could return GLFW_REPEAT, we need to consider it as 1
// to work properly with our implementation (IsKeyDown/IsKeyUp checks) // to work properly with our implementation (IsKeyDown/IsKeyUp checks)
if (action == GLFW_RELEASE) CORE.Input.Keyboard.currentKeyState[key] = 0; if (action == GLFW_RELEASE) CORE.Input.Keyboard.currentKeyState[key] = 0;

正在加载...
取消
保存