Skip to content

0P Getting the mouse position

Luis Murillo Baltodano edited this page Aug 3, 2020 · 1 revision

How to use onMouseMove

Using the onMouseMove function

onMouseMove(optionalCallback)

Once this function gets called window.mousePosition gets created so it will be updated with each mouse movement

About OptionalCallback

function optionalCallback(windowEvent) {
    // this triggers every time the 'mousemove' event triggers on window
}

Using the window.mousePosition with the mouse function

mouse() // returns window.mousePosition
Clone this wiki locally