mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user