Noob need to record mouse when on another window

Hi!

I would like to record the mouse’s mouvement when working on a software like photoshop.

The code below is perfect but how to use it when the mouse is on another window ?

void setup() {
  size(640, 360);
  background(102);
}

void draw() {
  stroke(255);
  if (mousePressed == true) {
    line(mouseX, mouseY, pmouseX, pmouseY);
  }
}

Hope we can find a solution !
I have never use code before beware !

1 Like

Hi, you will need to use some extra Java functions.

Maybe you can look at this:
https://forum.processing.org/one/topic/global-mouse.html

And this:

1 Like