From 20a7962a9bd3b7b8561a5ccf0c2bd82225b6419e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 19 Jul 2021 19:05:32 +0200 Subject: [PATCH] Improve error description for invalid scancodes (cherry picked from commit 56092814f3a1338a219dcab275b22463d6f95182) --- src/cocoa_window.m | 2 +- src/win32_window.c | 2 +- src/x11_window.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 6f442134..3ee0e72d 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -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; } diff --git a/src/win32_window.c b/src/win32_window.c index d17b6da4..2fa4f2e1 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -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; } diff --git a/src/x11_window.c b/src/x11_window.c index d52ebc4d..e5333d4e 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -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; }