CIUC- Mouse Actions and Mouse Functions Lesson

Mouse Actions and Mouse Functions

The mouse is an input device used for triggering events. Computer mice and other gaming input devices typically have between one and three buttons. Processing has a series of functions that determines the state of the mouse.  

When you want to use one of the functions, create the function in your program after your setup() and draw().  

void mouse click
void mouse pressed
void mouse released
void mouse moved
void mouse dragged

To find out which mouse button was pressed, use the mouseButton variable. It stores the button value as LEFT, RIGHT, or CENTER.

3-button mouse

[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION