Added scancode to key callback.

This commit is contained in:
Camilla Berglund
2013-05-30 17:19:12 +02:00
parent 362bf5de64
commit 11615fcaf2
25 changed files with 125 additions and 100 deletions
+11 -11
View File
@@ -122,29 +122,29 @@ static void setStickyMouseButtons(_GLFWwindow* window, int enabled)
////// GLFW event API //////
//////////////////////////////////////////////////////////////////////////
void _glfwInputKey(_GLFWwindow* window, int key, int action, int mods)
void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods)
{
GLboolean repeated = GL_FALSE;
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;
if (key >= 0 && key <= GLFW_KEY_LAST)
{
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_RELEASE && window->stickyKeys)
window->key[key] = _GLFW_STICK;
else
window->key[key] = (char) action;
}
if (repeated)
action = GLFW_REPEAT;
if (window->callbacks.key)
window->callbacks.key((GLFWwindow*) window, key, action, mods);
window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods);
}
void _glfwInputChar(_GLFWwindow* window, unsigned int character)