MouseEvent : UIEvent
Constructors
Creates a new MouseEvent of the specified type
and initial properties.
Instance Properties
true
if the Alt key (Option on Mac) on the keyboard was pressed at the time the event was generated. See also getModifierState()
.
Example:
RunResults:
The bitwise combinations of mouse buttons pressed. 1
is the primary (left) button. 2
is the secondary (right) button. 4
is the middle button. 8
is the back mouse button. 16
is the forward mouse button. Will be 0
when no buttons are pressed. See also button
.
true
if the Control key on the keyboard was pressed at the time the event was generated. See also getModifierState()
.
Example:
RunResults:
true
if the keyboard's meta (Command on Mac, not available on Windows) key was pressed at the time the event was generated. See also getModifierState()
.
Example:
RunResults:
The change in x position of the pointer since the last time the mouse move event fired. See the corresponding movementY
and element.requestPointerLock().
Example:
RunResults:
The change in y position of the pointer since the last time the mouse move event fired. See the corresponding movementX
and element.requestPointerLock().
Example:
RunResults:
The x position of the pointer relative to the page at the time the event fired. Same as this.clientX + window.scrollX
. See the corresponding pageY
and alternative coordinates x
, clientX
, offsetX
, and screenX
.
Example:
RunResults:
The y position of the pointer relative to the page at the time the event fired. Same as this.clientY + window.scrollY
. See the corresponding pageX
and alternative coordinates y
, clientY
, offsetY
, and screenY
.
Example:
RunResults:
Only applies to focusin, focusout, mouseenter, mouseleave, mouseout, mouseover, dragenter, and dragexit events. It is the element that receives the opposite event pair for this event. For example, the relatedTarget
of a mouseenter is the element that will receive the mouseleave event.
true
if the Shift key on the keyboard was pressed at the time the event was generated. See also getModifierState()
.