API Reference

Class List

MouseEvent

MouseEvent object that is passed to events 'mousemove', 'mouseup', 'mousedown' and 'mousewheel'.

Summary

Properties

altKey

True if the alt key was pressed when this event was fired.

button

The mouse button associated with this event.

ctrlKey

True if the ctrl key was pressed when this event was fired.

dx

The change in x coordinate since the last mouse event.

dy

The change in y coordinate since the last mouse event.

element

The element that the mouse was fired from.

event

The original browser event.

metaKey

True if the meta key was pressed when this event was fired.

shiftKey

True if the shift key was pressed when this event was fired.

wheelDelta

A value representing the amount the mouse wheel has moved, only valid for EVENT_MOUSEWHEEL events.

x

The x coordinate of the mouse pointer relative to the element Mouse is attached to.

y

The y coordinate of the mouse pointer relative to the element Mouse is attached to.

Details

Constructor

MouseEvent(mouse, event)

Create a new MouseEvent instance.

Parameters

mouseMouse

The Mouse device that is firing this event.

eventglobalThis.MouseEvent

The original browser event that fired.

Properties

booleanaltKey

True if the alt key was pressed when this event was fired.

numberbutton

The mouse button associated with this event. Can be:

booleanctrlKey

True if the ctrl key was pressed when this event was fired.

numberdx

The change in x coordinate since the last mouse event.

numberdy

The change in y coordinate since the last mouse event.

Elementelement

The element that the mouse was fired from.

globalThis.MouseEventevent

The original browser event.

booleanmetaKey

True if the meta key was pressed when this event was fired.

booleanshiftKey

True if the shift key was pressed when this event was fired.

numberwheelDelta

A value representing the amount the mouse wheel has moved, only valid for EVENT_MOUSEWHEEL events.

numberx

The x coordinate of the mouse pointer relative to the element Mouse is attached to.

numbery

The y coordinate of the mouse pointer relative to the element Mouse is attached to.