Task

Get the current location of the mouse cursor relative to the active window.

Please specify if the window may be externally created.




void setup(){
    size(640, 480);
}
 
void draw(){
  // mouseX and mouseY provide the current mouse position
  ellipse(mouseX, mouseY, 5, 5); // graphic output example
  println("x:" + mouseX + " y:" + mouseY);
}