pub static mouseMoved: MouseMovedInternalTypeExpand description
The mouseMoved() function is called every time the mouse moves and a mouse
button is not pressed.
Browsers may have different default
behaviors attached to various mouse events. To prevent any default
behavior for this event, add "return false" to the end of the method.
Examples
// Move the mouse across the page
// to change its value
let value = 0;
function draw() {
fill(value);
rect(25, 25, 50, 50);
}
function mouseMoved() {
value = value + 5;
if (value > 255) {
value = 0;
}
}function mouseMoved() {
ellipse(mouseX, mouseY, 5, 5);
// prevent default
return false;
}// returns a MouseEvent object
// as a callback argument
function mouseMoved(event) {
console.log(event);
}Parameters
event? optional MouseEvent callback argument.