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
@@ -1609,16 +1609,10 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
updateCursorImage(window);
}
const char* _glfwPlatformGetKeyName(int key, int scancode)
const char* _glfwPlatformGetScancodeName(int scancode)
{
WCHAR name[16];
if (key != GLFW_KEY_UNKNOWN)
scancode = _glfw.win32.scancodes[key];
if (!_glfwIsPrintable(_glfw.win32.keycodes[scancode]))
return NULL;
if (!GetKeyNameTextW(scancode << 16, name, sizeof(name) / sizeof(WCHAR)))
return NULL;