-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
MouseEvent.getModifiers() not consistent between different renderers #3828
Comments
This looks like a Linux problem, because I'm not able to reproduce it on Windows. Could you please describe what is wrong with your output? Are you getting no modifiers, or different modifiers? Maybe a short example output? |
When pressing left, center, and right mouse buttons without pressing any modifier key in Linux I got:
I think all renderers should give the same results so that third-parties can consistently (and in an easy way) implement mouse events. I've implemented sort of a hack to deal with this issue in the past: you may refer to the |
please let me know if more details are needed.... |
This is just a duplicate of your earlier issue #1693 where I also tried to explain the different behavior. This isn't something that can be "fixed" in a way that's consistent across platforms. The practical application, and the one that can work consistently is that you'll get the correct value for the button ( For instance, a ctrl-left-click on OS X triggers the right mouse button. You can't distinguish that from an actual right mouse click that also has control pressed on OS X. So while we could hide that behavior further, the result would be running into "bugs" later in the process, when you tried to run code that depended on that behavior on OS X. Same goes for several of these other variants. Bottom line, relying on awkward key + mouse behaviors like this is simply bad practice, and you're better served by pursuing an alternate approach. |
is ok with me to remove the modifiers from mouse bindings. Didn't know about the OS X behavior... Thank you :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Run the following sketch using different renderers (e.g., JAVA2D, P2D and P3D), and press the mouse (and some modifier keys if you like) and have a look at the output:
Same mouse reports independently of the renderer.
Different reports.
P5-3.0-b6
ArchLinux-x64.
This issue probably has to do with how events are handled differently by jogl and java (see #1693) which should be consistent (libraries supporting different renderers may be affected otherwise). A possible workaround would be to filter java events to match jogl output which IMO does it correctly.
The text was updated successfully, but these errors were encountered: