Detecting mouse clicks that are outside the canvas?

I have researched all that I could for this, there is not many stuff to see. I read somewhere that this is not possible but I feel like it is. Does anyone know?

Like when I do

void mousePressed() {
}

that only works when clicked inside the canvas. I want it to also work when clicked outside the canvas.

I have seen that, that is not exactly what I need. That is for p5.js and it is for ignoring the clicks outside the window.

Oh … sorry, I don’t think it’s possible in Java.

I dont think you can do it in Java version its broken