Hello. I am trying to access the mouse position through mouseX and mouseY within a keypressed function, but I have translations and scales in the draw function of my sketch, and I think this is causing me to get a mouse position that I do not want within keypressed.
Look at screenX please —- in a 3D Sketch
I don’t think p5.js has screenX.
You might be interested in this past thread:
screenX screenY equivalent in p5.js
- …in particular the link to https://github.com/processing/p5.js/issues/1553
…and possibly the approaches used in this Java library: