if (mouseButton === LEFT) { // LEFT MOUSE BUTTON
//do stuff...
}
else if (mouseButton === RIGHT) { // RIGHT MOUSE BUTTON
//do other stuff...
}
else if (mouseButton === CENTER) { // MOUSE WHEEL
//do other stuff...
}
var rightPressed = false;
function mouseClicked() {
if(mouseButton === RIGHT) {
rightPressed = true;
}
}