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)
Creates a new MouseEvent.

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Constants

CLICK → const String
"click"
CONTEXT_MENU → const String
"contextMenu"
DOUBLE_CLICK → const String
"doubleClick"
MIDDLE_CLICK → const String
"middleClick"
MIDDLE_MOUSE_DOWN → const String
"middleMouseDown"
MIDDLE_MOUSE_UP → const String
"middleMouseUp"
MOUSE_DOWN → const String
"mouseDown"
MOUSE_MOVE → const String
"mouseMove"
MOUSE_OUT → const String
"mouseOut"
MOUSE_OVER → const String
"mouseOver"
MOUSE_UP → const String
"mouseUp"
MOUSE_WHEEL → const String
"mouseWheel"
RIGHT_CLICK → const String
"rightClick"
RIGHT_MOUSE_DOWN → const String
"rightMouseDown"
RIGHT_MOUSE_UP → const String
"rightMouseUp"
ROLL_OUT → const String
"rollOut"
ROLL_OVER → const String
"rollOver"