MouseEvent class

The interface represents events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown. derives from UIEvent, which in turn derives from Event. Though the MouseEvent.initMouseEvent() method is kept for backward compatibility, creating of a object should be done using the MouseEvent() constructor.

Several more specific events are based on , including WheelEvent, DragEvent, and PointerEvent.

Event

UIEvent

MouseEvent

Implemented types
Implementers
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

MouseEvent(String type, [MouseEventInit? eventInitDict])
factory

Properties

altKey bool

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
bubbles bool

Available on Event, provided by the PropsEvent extension

no setter
button int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
buttons int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
cancelable bool

Available on Event, provided by the PropsEvent extension

no setter
cancelBubble bool

Available on Event, provided by the PropsEvent extension

getter/setter pair
clientX int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
clientY int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
composed bool

Available on Event, provided by the PropsEvent extension

no setter
ctrlKey bool

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
currentTarget EventTarget?

Available on Event, provided by the PropsEvent extension

no setter
defaultPrevented bool

Available on Event, provided by the PropsEvent extension

no setter
detail int

Available on UIEvent, provided by the PropsUIEvent extension

no setter
eventPhase int

Available on Event, provided by the PropsEvent extension

no setter
hashCode int
The hash code for this object.
no setterinherited
isTrusted bool

Available on Event, provided by the PropsEvent extension

no setter
metaKey bool

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
movementX double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
movementY double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
offsetX double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
offsetY double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
pageX double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
pageY double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
relatedTarget EventTarget?

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
returnValue ↔ dynamic

Available on Event, provided by the PropsEvent extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenX int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
screenY int

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
shiftKey bool

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
sourceCapabilities InputDeviceCapabilities?

Available on UIEvent, provided by the PropsUIEvent extension

no setter
srcElement EventTarget?

Available on Event, provided by the PropsEvent extension

no setter
target EventTarget?

Available on Event, provided by the PropsEvent extension

no setter
timeStamp double

Available on Event, provided by the PropsEvent extension

no setter
type String

Available on Event, provided by the PropsEvent extension

no setter
view Window?

Available on UIEvent, provided by the PropsUIEvent extension

no setter
which int

Available on UIEvent, provided by the PropsUIEvent extension

no setter
x double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter
y double

Available on MouseEvent, provided by the PropsMouseEvent extension

no setter

Methods

composedPath() Iterable<EventTarget>

Available on Event, provided by the PropsEvent extension

getModifierState(String keyArg) bool

Available on MouseEvent, provided by the PropsMouseEvent extension

initEvent(String type, [bool? bubbles = false, bool? cancelable = false]) → void

Available on Event, provided by the PropsEvent extension

initMouseEvent(String typeArg, [bool? bubblesArg = false, bool? cancelableArg = false, Window? viewArg, int? detailArg = 0, int? screenXArg = 0, int? screenYArg = 0, int? clientXArg = 0, int? clientYArg = 0, bool? ctrlKeyArg = false, bool? altKeyArg = false, bool? shiftKeyArg = false, bool? metaKeyArg = false, int? buttonArg = 0, EventTarget? relatedTargetArg]) → void

Available on MouseEvent, provided by the PropsMouseEvent extension

initUIEvent(String typeArg, [bool? bubblesArg = false, bool? cancelableArg = false, Window? viewArg, int? detailArg = 0]) → void

Available on UIEvent, provided by the PropsUIEvent extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preventDefault() → void

Available on Event, provided by the PropsEvent extension

stopImmediatePropagation() → void

Available on Event, provided by the PropsEvent extension

stopPropagation() → void

Available on Event, provided by the PropsEvent extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited