-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
GLMakie: ignore mouse buttons beyond the first three #3144
Conversation
Prevents an error message from being thrown. Allowing those buttons to be used would require additions to mousestatemachine.
Thanks :) |
GLMakie/src/events.jl
Outdated
@@ -99,7 +99,9 @@ function Makie.mouse_buttons(scene::Scene, window::GLFW.Window) | |||
event = scene.events.mousebutton | |||
function mousebuttons(window, button, action, mods) | |||
@print_error begin | |||
event[] = MouseButtonEvent(Mouse.Button(Int(button)), Mouse.Action(Int(action))) | |||
if Int(button) < 3 # ignore mouse buttons beyond 3 |
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.
Should we ignore them, or just pass through?
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.
I got an error in makielayout/mousestatemachine.jl.
To allow extra buttons to be used, the enum MouseEventTypes
would need to be expanded hugely, and all the @match
uses in that file too. I'd be willing to go through and do that if it's of interest.
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.
Ok, I think we should merge this PR first then, and fix this once demand arises!
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.
Sounds good. I have a mouse with lots of buttons on the side and I'm almost always annoyed when they actually do something!
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.
I think rather than discarding the event we should ignore it in mousestatemachine then.
Description
Fixes #3125
Prevents an error from being thrown when you press an exotic mouse button. Allowing those buttons to be used would require additions to mousestatemachine.
Type of change
Delete options that do not apply:
Checklist