[−][src]Static p5_sys::global::doubleClicked
pub static doubleClicked: DoubleClickedInternalType
The doubleClicked() function is executed every time a event listener has detected a dblclick event which is a part of the DOM L3 specification. The doubleClicked event is fired when a pointing device button (usually a mouse's primary button) is clicked twice on a single element. For more info on the dblclick event refer to mozilla's documentation here: https://developer.mozilla.org/en-US/docs/Web/Events/dblclick
Examples
// Click within the image to change // the value of the rectangle // after the mouse has been double clicked let value = 0; function draw() { fill(value); rect(25, 25, 50, 50); } function doubleClicked() { if (value === 0) { value = 255; } else { value = 0; } }
function doubleClicked() { ellipse(mouseX, mouseY, 5, 5); // prevent default return false; }
// returns a MouseEvent object // as a callback argument function doubleClicked(event) { console.log(event); }
Parameters
event?
optional MouseEvent callback argument.