Thanks to glfwGetKeyScancode we can now pass only a scancode to the
platform layer for glfwGetKeyName.
This commit is contained in:
Camilla Löwy
2017-07-11 23:00:17 +02:00
parent d3247a8c83
commit 82284b86eb
8 changed files with 21 additions and 37 deletions
+1 -7
View File
@@ -2474,17 +2474,11 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
XFlush(_glfw.x11.display);
}
const char* _glfwPlatformGetKeyName(int key, int scancode)
const char* _glfwPlatformGetScancodeName(int scancode)
{
if (!_glfw.x11.xkb.available)
return NULL;
if (key != GLFW_KEY_UNKNOWN)
scancode = _glfw.x11.scancodes[key];
if (!_glfwIsPrintable(_glfw.x11.keycodes[scancode]))
return NULL;
const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, 0, 0);
if (keysym == NoSymbol)
return NULL;