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
+4 -4
View File
@@ -83,8 +83,8 @@ static int translateKey(int keycode)
// Use the pre-filled LUT (see updateKeyCodeLUT() in x11_init.c)
if ((keycode >= 0) && (keycode < 256))
return _glfw.x11.keyCodeLUT[keycode];
else
return -1;
return GLFW_KEY_UNKNOWN;
}
// Translates an X Window event to Unicode
@@ -515,7 +515,7 @@ static void processEvent(XEvent *event)
const int key = translateKey(event->xkey.keycode);
const int mods = translateState(event->xkey.state);
_glfwInputKey(window, key, GLFW_PRESS, mods);
_glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods);
if (!(mods & GLFW_MOD_CONTROL) && !(mods & GLFW_MOD_ALT))
_glfwInputChar(window, translateChar(&event->xkey));
@@ -528,7 +528,7 @@ static void processEvent(XEvent *event)
const int key = translateKey(event->xkey.keycode);
const int mods = translateState(event->xkey.state);
_glfwInputKey(window, key, GLFW_RELEASE, mods);
_glfwInputKey(window, key, event->xkey.keycode, GLFW_RELEASE, mods);
break;
}