|
Author |
Topic: Mouse Button Events (Read 1576 times) |
|
firdosh
|
Mouse Button Events
« on: Jun 7th, 2004, 4:48pm » |
|
how do i know whay button the user pressed on the mouse. Left / right / middle click??
|
|
|
|
marcello
|
Re: Mouse Button Events
« Reply #1 on: Jun 8th, 2004, 4:14pm » |
|
Hi, Here is a very simple code I’ve extracted from the TechNotes section of this web site: http://processing.org/reference/technotes/index.html There I’ve found many answers to my questions (thanks to all contributors) Code: void loop() { } void mousePressed() { if ( (mouseEvent.getModifiers() & InputEvent.BUTTON1_MASK ) !=0) { println('1'); } else if ( (mouseEvent.getModifiers() & InputEvent.BUTTON2_MASK) != 0) { println('2'); } else if ( (mouseEvent.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { println('3'); } } |
|
|
|
|
|
Flux Guest
|
Re: Mouse Button Events
« Reply #2 on: Jun 9th, 2004, 9:42pm » |
|
heya. does this technique work with exported applets as well?
|
|
|
|
|