mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Cleanup
Thanks to glfwGetKeyScancode we can now pass only a scancode to the platform layer for glfwGetKeyName.
This commit is contained in:
+1
-7
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user