mousePressed

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

mousePressed

示例
 // Click within the image to change  // the value of the rectangle
void draw()
{  
if (mousePressed == true)
{
fill(0);


  } else{
fill(255);


  }   rect(25, 25, 50, 50);


  } 
描述 The mousePressed variable stores whether or not a mouse button is currently being pressed. The value is true when any mouse button is pressed, and false if no button is pressed. The mouseButton variable (see the related reference entry) can be used to determine which button has been pressed.
相关 mouseX
mouseY
pmouseX
pmouseY
mousePressed()
mouseReleased()
mouseClicked()
mouseMoved()
mouseDragged()
mouseButton
mouseWheel()

Updated on October 2, 2018 05:02:10pm EDT

mousePressed