Add GLFW_MOUSE_BUTTON_LIMIT information to the input guide

This commit is contained in:
Grzesiek11 2024-01-03 04:20:28 +01:00
parent 912cb9dd31
commit 223caf09ea
No known key found for this signature in database
GPG Key ID: 4A5445FB68CDB5C4

View File

@ -494,8 +494,15 @@ a mouse button callback.
glfwSetMouseButtonCallback(window, mouse_button_callback);
@endcode
The callback function receives the [mouse button](@ref buttons), button action
and [modifier bits](@ref mods).
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`.
@code
glfwInitHint(GLFW_MOUSE_BUTTON_LIMIT, GLFW_FALSE);
@endcode
The callback function receives the mouse button, button action and
[modifier bits](@ref mods).
@code
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
@ -505,6 +512,10 @@ 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
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