Scratch for Java

Stage::isMouseDown()

Returns true if the left mouse button is down.

Examples

import org.openpatch.scratch.*;
 
public class StageIsMouseDown {
  public StageIsMouseDown() {
    Stage myStage = new Stage(600, 240);
 
    while (myStage.getTimer().forMillis(3000)) {
      myStage.display("Mouse down? " + myStage.isMouseDown());
    }
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new StageIsMouseDown();
  }
}
 

View on GitHub

Syntax

Java

.isMouseDown()

Scratch

mouse down?

Return

boolean

isMouseDown()