Improve error description for invalid scancodes

(cherry picked from commit 56092814f3)
This commit is contained in:
Camilla Löwy 2021-07-19 19:05:32 +02:00
parent 44ad296813
commit 20a7962a9b
3 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}