FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   mouse input - left/right button, double-click?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: mouse input - left/right button, double-click?  (Read 309 times)
TomC

WWW
mouse input - left/right button, double-click?
« on: Mar 5th, 2004, 5:17pm »

Anybody know if there's a neat and easy way to distinguish between left and right mouse clicks, or to catch a double-click?
 
toxi_
Guest
Email
Re: mouse input - left/right button, double-click?
« Reply #1 on: Mar 5th, 2004, 5:26pm »

tom, you have to override the mousePressed() or mouseReleased() method like that...
 
Code:
public void mouseReleased(MouseEvent e) {
  println(e.getButton()+" "+e.getClickCount());
}

 
not sure what mac mice produce for the CTRL+left click, ie. if this already is transformed into a right-click on system level or not... can any of you mac users let us know please?
 
best,k.
 
fry


WWW
Re: mouse input - left/right button, double-click?
« Reply #2 on: Mar 5th, 2004, 5:53pm »

to work reliably on both mac and pc, you have to use the isPopupTrigger() method.  
 
also, when you override the mouseReleased(MouseEvent e) event (the full one with the "MouseEvent" parameter) you should call super.mouseEvent(e) if you want p5 to properly handle mousePressed being unset.
 
Pages: 1 

« Previous topic | Next topic »