-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow disabling the mouse button limit #2423
Changes from all commits
42cc770
9f6bf2c
7a0012a
4bc709b
747d072
a255fd8
c224eee
912cb9d
223caf0
18a10d0
4680da5
d97d194
cfdc3de
571dfb8
e23231d
7496168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -494,6 494,20 @@ a mouse button callback. | |
glfwSetMouseButtonCallback(window, mouse_button_callback); | ||
@endcode | ||
|
||
@anchor GLFW_DISABLE_MOUSE_BUTTON_LIMIT | ||
To handle all mouse buttons, instead of only ones with associated | ||
[button tokens](@ref buttons), set the @ref GLFW_DISABLE_MOUSE_BUTTON_LIMIT | ||
input mode. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to make clear that this only works for the callback, and not for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assumed this would be redundant, as this section of the documentation talks about the callback specifically, and when If you think clarifying it would be good regardless, I can do that. I will do the |
||
|
||
@code | ||
glfwSetInputMode(window, GLFW_DISABLE_MOUSE_BUTTON_LIMIT, GLFW_TRUE); | ||
@endcode | ||
|
||
When this input mode is enabled, GLFW doesn't limit the reported mouse buttons | ||
to only those that have an associated button token, for compatibility with | ||
earlier versions of GLFW, which never reported any buttons over | ||
@ref GLFW_MOUSE_BUTTON_LAST, on which users could have relied on. | ||
|
||
The callback function receives the [mouse button](@ref buttons), button action | ||
and [modifier bits](@ref mods). | ||
|
||
|
@@ -505,9 519,13 @@ 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 | ||
[mouse button tokens](@ref buttons) or, if the | ||
@ref GLFW_DISABLE_MOUSE_BUTTON_LIMIT input mode is set, any other value. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to change |
||
|
||
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. | ||
|
||
|
@@ -542,7 560,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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contributors are normally alphabetic by last or only name, but I can fix that up after merge if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I'm already listed in the proper position, and this is just a duplicate coming from my error during merging back master.