Hey There!
There is a void mousePressed method within processing !
https://processing.org/reference/mousePressed_.html