diff --git a/README.md b/README.md index 3920c1e3..8981a2e6 100644 --- a/README.md +++ b/README.md @@ -155,8 +155,8 @@ information on what to include when reporting a bug. - Added `GLFW_X11_XCB_VULKAN_SURFACE` init hint for selecting X11 Vulkan surface extension (#1793) - Added `GLFW_WIN32_KEYBOARD_MENU` window hint for enabling access to the window menu - - Added `GLFW_MOUSE_BUTTON_LIMIT` init hint for removing the limit of reporting - only the 8 supported mouse buttons (#2423) + - Added `GLFW_MOUSE_BUTTON_LIMIT` init hint for disabling the limit of reported + mouse buttons to only those with associated mouse button tokens (#2423) - Added `GLFW_NATIVE_INCLUDE_NONE` for disabling inclusion of native headers (#1348) - Added `GLFW_BUILD_WIN32` CMake option for enabling Win32 support (#1958) - Added `GLFW_BUILD_COCOA` CMake option for enabling Cocoa support (#1958) diff --git a/docs/input.dox b/docs/input.dox index b8b1052c..58c74253 100644 --- a/docs/input.dox +++ b/docs/input.dox @@ -494,8 +494,9 @@ a mouse button callback. glfwSetMouseButtonCallback(window, mouse_button_callback); @endcode -To handle all mouse buttons, instead of only the [supported ones](@ref buttons), -set the @ref GLFW_MOUSE_BUTTON_LIMIT initialization hint to `GLFW_FALSE`. +To handle all mouse buttons, instead of only ones with associated +[button tokens](@ref buttons), set the @ref GLFW_MOUSE_BUTTON_LIMIT +initialization hint to `GLFW_FALSE`. @code glfwInitHint(GLFW_MOUSE_BUTTON_LIMIT, GLFW_FALSE); @@ -513,12 +514,12 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) @endcode The mouse button is an integer that can be one of the -[supported mouse buttons](@ref buttons) or, if @ref GLFW_MOUSE_BUTTON_LIMIT is +[mouse button tokens](@ref buttons) or, if @ref GLFW_MOUSE_BUTTON_LIMIT is set to `GLFW_FALSE`, any other value. The action is one of `GLFW_PRESS` or `GLFW_RELEASE`. -The last reported state for every [supported mouse button](@ref buttons) is also +The last reported state for every [mouse button token](@ref buttons) is also saved in per-window state arrays that can be polled with @ref glfwGetMouseButton. @@ -553,7 +554,7 @@ had been processed in the meantime, the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`. The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any -[supported mouse button](@ref buttons). +[mouse button token](@ref buttons). @subsection scrolling Scroll input diff --git a/docs/intro.dox b/docs/intro.dox index 3b143c4b..27b00297 100644 --- a/docs/intro.dox +++ b/docs/intro.dox @@ -120,11 +120,12 @@ extension. This extension is not used if this hint is `GLFW_ANGLE_PLATFORM_TYPE_NONE`, which is the default value. @anchor GLFW_MOUSE_BUTTON_LIMIT -__GLFW_MOUSE_BUTTON_LIMIT__ specifies whether to limit reported mouse buttons to -only the supported buttons, for compatibility with earlier versions of GLFW that -could only report buttons from the supported set, as users might have assumed -@ref GLFW_MOUSE_BUTTON_LAST to be the last possible mouse button, and not the -last supported mouse button. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. +__GLFW_MOUSE_BUTTON_LIMIT__ specifies whether to limit reported mouse buttons +to only those that have an associated button token, for compatibility with +earlier versions of GLFW that would only report buttons with an associated +button token: users may have assumed that reported buttons always are in the +range of @ref GLFW_MOUSE_BUTTON_1 to @ref GLFW_MOUSE_BUTTON_LAST. Possible +values are `GLFW_TRUE` and `GLFW_FALSE`. @subsubsection init_hints_osx macOS specific init hints diff --git a/docs/news.dox b/docs/news.dox index 69b9658b..52492485 100644 --- a/docs/news.dox +++ b/docs/news.dox @@ -105,10 +105,11 @@ applications. @subsubsection features_34_disable_mouse_button_limit Allow disabling the mouse button limit -GLFW now allows disabling the limit of reporting only 8 -[supported mouse buttons](@ref buttons). For compatibility with older versions, -the @ref GLFW_MOUSE_BUTTON_LIMIT init hint needs to be set to `GLFW_FALSE` to -make use of this. +GLFW now allows disabling the limit of reported mouse buttons to only those with +associated [button tokens](@ref buttons). This allows using mouse buttons with +values over 8. For compatibility with older versions, the +@ref GLFW_MOUSE_BUTTON_LIMIT init hint needs to be set to `GLFW_FALSE` to make +use of this. @subsection caveats Caveats for version 3.4 diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index eb4edcec..d6e50bd3 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -5198,13 +5198,14 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * is called when a mouse button is pressed or released. * * When a window loses input focus, it will generate synthetic mouse button - * release events for all pressed supported mouse buttons. You can tell these - * events from user-generated events by the fact that the synthetic ones are - * generated after the focus loss event has been processed, i.e. after the - * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. + * release events for all pressed mouse buttons with associated button tokens. + * You can tell these events from user-generated events by the fact that the + * synthetic ones are generated after the focus loss event has been processed, + * i.e. after the [window focus callback](@ref glfwSetWindowFocusCallback) has + * been called. * * The reported `button` value can be higher than `GLFW_MOUSE_BUTTON_LAST` if - * the button is not a [supported button](@ref buttons) and the + * the button does not have an associated [button token](@ref buttons) and the * @ref GLFW_MOUSE_BUTTON_LIMIT init hint is set to `GLFW_FALSE`. * * @param[in] window The window whose callback to set.