-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Switch to getModifiersEx() in processing.app
#67
Comments
Created by: benfry Both Processing.py and Processing-R rely on the old constant to check whether shift is down. Inside final boolean shift = (modifiers & InputEvent.SHIFT_MASK) != 0; Sadly, in earlier releases we only set a Definitions for the old constant for shift: InputEvent.SHIFT_MASK = Event.SHIFT_MASK;
Event.SHIFT_MASK = 1 << 0; Unfortunately, the new constant uses a different value: InputEvent.SHIFT_DOWN_MASK = 1 << 6; And confirmed that void draw() {
}
void mousePressed() {
java.awt.event.MouseEvent me = (java.awt.event.MouseEvent) mouseEvent.getNative();
int modifiers = me.getModifiers();
int modifiersEx = me.getModifiersEx();
//boolean shiftOld = (modifiers & java.awt.Event.SHIFT_MASK) != 0;
//println(shiftOld);
println("mods and old shift = " + ((modifiers & java.awt.Event.SHIFT_MASK) != 0));
println("mods and new shift = " + ((modifiers & java.awt.event.InputEvent.SHIFT_DOWN_MASK) != 0));
println("exmods and old shift = " + ((modifiersEx & java.awt.Event.SHIFT_MASK) != 0));
println("exmods and new shift = " + ((modifiersEx & java.awt.event.InputEvent.SHIFT_DOWN_MASK) != 0));
println();
} So we may need to stick with the old approach and hold our nose. Could swap out a default implementation that sets the old modifiers for backwards compatibility, but is overridden by default, but we're using an |
Created by: benfry Turns out There's an open JDK bug for this, but it remains unresolved: https://bugs.openjdk.java.net/browse/JDK-8186024 |
Created by: benfry Finished swapping the other |
Created by: github-actions[bot] This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs. |
Created by: benfry
This is really just for
DefaultInputHandler
andEditorButton
, now that things have been switched over for core.The text was updated successfully, but these errors were encountered: