Fixed broken key repeat detection.

This commit is contained in:
Camilla Berglund 2014-05-19 15:00:50 +02:00
parent 22e1b525a5
commit dc5c264e26
1 changed files with 6 additions and 1 deletions

View File

@ -132,15 +132,20 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m
{
if (key >= 0 && key <= GLFW_KEY_LAST)
{
GLboolean repeated = GL_FALSE;
if (action == GLFW_RELEASE && window->key[key] == GLFW_RELEASE)
return;
if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS)
repeated = GL_TRUE;
if (action == GLFW_RELEASE && window->stickyKeys)
window->key[key] = _GLFW_STICK;
else
window->key[key] = (char) action;
if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS)
if (repeated)
action = GLFW_REPEAT;
}