Reword documentation relating to mouse buttons

Change 'supported mouse buttons' to 'mouse button tokens', which makes a
lot more sense. Also improve the wording of the new mouse button
documentation overall.
This commit is contained in:
Grzesiek11 2024-02-06 17:15:47 +01:00
parent 4680da5dc9
commit d97d1944f4
No known key found for this signature in database
GPG Key ID: 4A5445FB68CDB5C4
5 changed files with 25 additions and 21 deletions

View File

@ -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)

View File

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

View File

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

View File

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

View File

@ -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.