|
Author |
Topic: mouse input - left/right button, double-click? (Read 309 times) |
|
TomC
|
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
|
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
|
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.
|
|
|
|
|