Mouse clicking (Right & Double)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. void draw() {
  2. stroke(255);
  3. if(mousePressed) {
  4. if (mouseEvent.getClickCount()==2) {
  5. background(0,0,random(0,255));
  6. println("<double click>");
  7. }
  8. if (mouseEvent.getButton()==MouseEvent.BUTTON3) {
  9. background(0,random(0,255),0);
  10. println("<right button>");
  11. }
  12. }
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.