Prevent change of mouseX/Y outside sketch window when pressed
Answered
- Need more info
- Answered
- Working on it
in
Programming Questions
•
3 years ago
Does anybody know a simple line of code to prevent the mouse to return mouseX and mouseY values from outside the sketch window when the mouse is pressed ?
when not beeing pressed, mouseX stays where it left the window, but when beeing pressed it keeps changing, get negative etc...
try it by pressing the mouse and leave the screen.
when not beeing pressed, mouseX stays where it left the window, but when beeing pressed it keeps changing, get negative etc...
try it by pressing the mouse and leave the screen.
- void setup() {
size(600,400);
}
void draw() {
println(mouseX+":"+mouseY);
}
1