| Language \ Environment \ Comparison |

| Index

| The Processing 1.0 _ALPHA_ Reference is a work in progress. If you see any errors or have any comments, please write to: reas at groupc.net

Name |  | ### mousePressed
Examples |  |
    // Click within the image to change
    // the value of the rectangle
    void loop() {
      if (mousePressed == true) {
        fill(0);
      } else {
        fill(255);
      }
      rect(25, 25, 50, 50);
    }
Description |  | Processing automatically tracks if the mouse button is pressed or not (it tracks the left mouse button for mice with more than one button). The value of the system variable mousePressed is true is the button is pressed and false if the button is not pressed.
Usage |  | Web & Application
Related |  | mouseX mouseY pmouseX pmouseY mousePressed() mouseReleased() mouseMoved() mouseDragged()

| © 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea |
| Processing is an open project initiated by Ben Fry and Casey Reas |