MouseEvent class

An event that is dispatched into the event flow whenever mouse events occur.

A MouseEvent is usually generated by a user input device, such as a mouse or a trackball, that uses a pointer.

When nested nodes are involved, mouse events target the deepest possible nested node that is visible in the display list. This node is called the target node. To have a target node's ancestor receive notification of a mouse event, use the corresponding on...() methods:

sprite.onMouseClick.listen(_onMouseClick);
Inheritance

Constructors

MouseEvent(String type, bool bubbles, num localX, num localY, num stageX, num stageY, bool altKey, bool ctrlKey, bool shiftKey, num deltaX, num deltaY, bool buttonDown, int clickCount, DataTransfer? dataTransfer)
Creates a new MouseEvent.

Properties

altKey bool?
Indicates whether the Alt key is active (true) or inactive (false).
finalinherited
bubbles bool
Indicates whether an event is a bubbling event. If the event can bubble, this value is true; otherwise it is false.
no setterinherited
buttonDown bool
Indicates whether the primary mouse button is pressed (true) or not (false).
final
captures bool
Indicates whether an event is a capturing event.
no setterinherited
clickCount int
Indicates whether or not the mouse down event is part of a multi-click sequence.
final
ctrlKey bool?
Indicates whether the Ctrl key is active (true) or inactive (false).
finalinherited
currentTarget EventDispatcher?
The object that is actively processing the Event object with an event listener.
no setterinherited
dataTransfer DataTransfer?
final
deltaX num
The amount that is expected to scroll horizontally.
final
deltaY num
The amount that is expected to scroll vertically.
final
eventPhase EventPhase
The current phase in the event flow.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isDefaultPrevented bool
no setterinherited
isImmediatePropagationStopped bool
Indicates if the propagation of this event has been stopped.
no setterinherited
isPropagationStopped bool
Indicates if the propagation of this event has been stopped.
no setterinherited
localX num
The x-coordinate at which the event occurred relative to the containing display object.
finalinherited
localY num
The y-coordinate at which the event occurred relative to the containing display object.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shiftKey bool?
Indicates whether the Shift key is active (true) or inactive (false).
finalinherited
stageX num
The x-coordinate of the input event relative to the stage.
finalinherited
stageY num
The y-coordinate of the input event relative to the stage.
finalinherited
target EventDispatcher?
The event target.
no setterinherited
type String
The type of event.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preventDefault() → void
inherited
stopImmediatePropagation() → void
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
inherited
stopPropagation() → void
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

CLICK → const String
CONTEXT_MENU → const String
DOUBLE_CLICK → const String
DRAG_ENTER → const String
DRAG_LEAVE → const String
DROP → const String
MIDDLE_CLICK → const String
MIDDLE_MOUSE_DOWN → const String
MIDDLE_MOUSE_UP → const String
MOUSE_DOWN → const String
MOUSE_MOVE → const String
MOUSE_OUT → const String
MOUSE_OVER → const String
MOUSE_UP → const String
MOUSE_WHEEL → const String
RIGHT_CLICK → const String
RIGHT_MOUSE_DOWN → const String
RIGHT_MOUSE_UP → const String
ROLL_OUT → const String
ROLL_OVER → const String