diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 75533ec3..ae597a4d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -278,6 +278,7 @@ video tutorials. - Jonas Ådahl - Lasse Öörni - Leonard König + - Liam Malone - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/README.md b/README.md index cebe62bc..fdd67ce6 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ information on what to include when reporting a bug. ## Changelog + - Bugfix: Linux joystick handling would crash with some keyboards, indexing the + associated KeyMap with a value less than 0 - Added `GLFW_PLATFORM` init hint for runtime platform selection (#1958) - Added `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` and `GLFW_PLATFORM_NULL` symbols to diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 78d867eb..b12f6bcd 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -51,7 +51,7 @@ // static void handleKeyEvent(_GLFWjoystick* js, int code, int value) { - _glfwInputJoystickButton(js, + if (code - BTN_MISC >= 0) _glfwInputJoystickButton(js, js->linjs.keyMap[code - BTN_MISC], value ? GLFW_PRESS : GLFW_RELEASE); }