p5 editor mouse press down code example
Example 1: if mousepressed javascript
var mouseDown = 0;
document.body.onmousedown = function() {
++mouseDown;
}
document.body.onmouseup = function() {
--mouseDown;
}
Example 2: p5 on mouse press
function mousePressed() {
ellipse(mouseX, mouseY, 5, 5);
// prevent default
return false;
}