-
Notifications
You must be signed in to change notification settings - Fork 933
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
Add MouseButton::{Back, Forward} to mouse input events on Wayland, X11, Windows, macOS and Web #2770
Conversation
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.
Tested with xev and the values for X11 appear to be correct.
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.
macOS impl looks simple enough, though I can't test it since I don't have a mouse with those buttons.
Maybe you could document the variants a bit more to describe what "forward" and "backward" mouse buttons actually mean (or link to a Wikipedia article or something), I suspect I'm not the only one that don't know how those actually look
Looking more into it I think macOS doesn't officially support these buttons, I got them from this project which looking at it now it's a hack specifically to address this shortcoming. I found this documentation page about possible mouse buttons:
The question now is if treating |
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.
let me know if you still want to work on that, otherwise I'll push it myself.
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.
LGTM except the nits.
@bbb651 ping me if you want me to take care of the web backend. |
@daxpedda I'd appreciate it |
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.
Seems like your rebase went wrong.
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.
@bbb651 Web backend is done.
(only approving the Web backend here)
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.
MacOS looks good now
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.
Windows changes also fine
This is a breaking change because MouseButton isn't #[non_exhaustive], it's supported on wayland, x11, windows, macos and web, all other platforms (orbital doesn't support these buttons at all, android and ios don't have mouse support in winit).
…:{Back, Forward} This seems to be what [chromium does](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/ui/ozone/platform/wayland/host/wayland_pointer.cc).
Thanks! |
Fixes #1785. This is a breaking change because MouseButton isn't #[non_exhaustive],
it's supported on wayland, x11, windows, macos and web, all other platforms (orbital doesn't support these buttons at all, android and ios don't have mouse support in winit).
CHANGELOG.md
if knowledge of this change could be valuable to users