Skip to content
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

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

jwahlstrand
Copy link
Contributor

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:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

Prevents an error message from being thrown. Allowing those buttons to
be used would require additions to mousestatemachine.
@SimonDanisch
Copy link
Member

Thanks :)

@@ -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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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!

Copy link
Contributor Author

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!

Copy link
Collaborator

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.

@SimonDanisch SimonDanisch merged commit f1fb6c0 into MakieOrg:master Aug 14, 2023
13 checks passed
@jwahlstrand jwahlstrand deleted the buttons branch September 4, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mice with more than three buttons cause errors
3 participants