mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Improve error description for invalid scancodes
(cherry picked from commit 56092814f3)
This commit is contained in:
@@ -1541,7 +1541,7 @@ const char* _glfwPlatformGetScancodeName(int scancode)
|
||||
if (scancode < 0 || scancode > 0xff ||
|
||||
_glfw.ns.keycodes[scancode] == GLFW_KEY_UNKNOWN)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode");
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode %i", scancode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2067,7 +2067,7 @@ const char* _glfwPlatformGetScancodeName(int scancode)
|
||||
if (scancode < 0 || scancode > (KF_EXTENDED | 0xff) ||
|
||||
_glfw.win32.keycodes[scancode] == GLFW_KEY_UNKNOWN)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode");
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode %i", scancode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2886,7 +2886,7 @@ const char* _glfwPlatformGetScancodeName(int scancode)
|
||||
if (scancode < 0 || scancode > 0xff ||
|
||||
_glfw.x11.keycodes[scancode] == GLFW_KEY_UNKNOWN)
|
||||
{
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode");
|
||||
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode %i", scancode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user