Ver Fonte

Added filtering of duplicate key releases.

Camilla Berglund há 12 anos atrás
pai
commit
11b7d17ea0
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      src/input.c

+ 3 - 0
src/input.c

@@ -129,6 +129,9 @@ void _glfwInputKey(_GLFWwindow* window, int key, int action, int mods)
     if (key < 0 || key > GLFW_KEY_LAST)
         return;
 
+    if (action == GLFW_RELEASE && window->key[key] == GLFW_RELEASE)
+        return;
+
     if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS)
         repeated = GL_TRUE;