We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello! I want to use both mouse button, but in P3D mode, mouseButton only returns left button.
void setup() {
size(100, 100);
//size(100, 100, P3D);
fill(255);
}
boolean LMB, RMB;
void draw() {
if (LMB) {
background(0);
if (RMB) {
rect(30, 30, 40, 40);
}
} else {
background(255);
}
}
void mousePressed() {
if (mouseButton==LEFT) {
LMB=true;
} else {
RMB=true;
}
}
void mouseReleased() {
if (mouseButton==LEFT) {
LMB=false;
} else {
RMB=false;
if (LMB) {
println("success");
}
}
}
This works, but doesn't in P3D mode. Please help me.
Answers
Indeed all renderers but JAVA2D is bugged for mouseButton under P3! :-O
You should report it here: https://GitHub.com/processing/processing/issues
Also mention your forum thread here there, so you don't need to explain from zero. O:-)
This is the rest of the full report below: :-B
http://studio.ProcessingTogether.com/sp/pad/export/ro.9$uOULvJSGGfw
I reported it and wait for this bug is fixed. Thank you!
https://GitHub.com/processing/processing/issues/4361