|
@@ -2862,6 +2862,13 @@ const char* _glfwPlatformGetScancodeName(int scancode)
|
|
if (!_glfw.x11.xkb.available)
|
|
if (!_glfw.x11.xkb.available)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
|
|
+ if (scancode < 0 || scancode > 0xff ||
|
|
|
|
+ _glfw.x11.keycodes[scancode] == GLFW_KEY_UNKNOWN)
|
|
|
|
+ {
|
|
|
|
+ _glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
const int key = _glfw.x11.keycodes[scancode];
|
|
const int key = _glfw.x11.keycodes[scancode];
|
|
const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display,
|
|
const KeySym keysym = XkbKeycodeToKeysym(_glfw.x11.display,
|
|
scancode, _glfw.x11.xkb.group, 0);
|
|
scancode, _glfw.x11.xkb.group, 0);
|