From 223caf09eaace22fdb9d3c1e4f272d8e74fbdf33 Mon Sep 17 00:00:00 2001 From: Grzesiek11 Date: Wed, 3 Jan 2024 04:20:28 +0100 Subject: [PATCH] Add GLFW_MOUSE_BUTTON_LIMIT information to the input guide --- docs/input.dox | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/input.dox b/docs/input.dox index f57520bb..b8b1052c 100644 --- a/docs/input.dox +++ b/docs/input.dox @@ -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