🖲 Define this function to respond to mouse wheel events.
event.deltaX and event.deltaY are the horizontal and vertical scroll amounts, respectively.
event.deltaX
event.deltaY
Return true to allow the default behavior of scrolling the page.
let x = 0;let y = 0;q5.draw = function () { circle(x, y, 10);};q5.mouseWheel = function (e) { x += e.deltaX; y += e.deltaY; return false;}; Copy
let x = 0;let y = 0;q5.draw = function () { circle(x, y, 10);};q5.mouseWheel = function (e) { x += e.deltaX; y += e.deltaY; return false;};
🖲 Define this function to respond to mouse wheel events.
event.deltaXandevent.deltaYare the horizontal and vertical scroll amounts, respectively.Return true to allow the default behavior of scrolling the page.