class MouseEvent
package openfl.events
extends Event
extended by ScreenMouseEvent
Available on all platforms
A MouseEvent object is dispatched into the event flow whenever mouse events occur. A mouse event 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 EventDispatcher.addEventListener()
on
the ancestor node with the type
parameter set to the specific
mouse event you want to detect.
See also:
Static variables
staticinlineread onlyCLICK:EventType<MouseEvent> = "click"
Defines the value of the type
property of a click
event object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | For click events, this value is always false . |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyDOUBLE_CLICK:EventType<MouseEvent> = "doubleClick"
Defines the value of the type
property of a doubleClick
event
object. The doubleClickEnabled
property must be true
for an object
to generate the doubleClick
event.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | For double-click events, this value is always false . |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMIDDLE_CLICK:EventType<MouseEvent> = "middleClick"
Defines the value of the type
property of a middleClick
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | For middle-click events, this property is always false . |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMIDDLE_MOUSE_DOWN:EventType<MouseEvent> = "middleMouseDown"
Defines the value of the type
property of a middleMouseDown
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the middle mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMIDDLE_MOUSE_UP:EventType<MouseEvent> = "middleMouseUp"
Defines the value of the type
property of a middleMouseUp
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the middle mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_DOWN:EventType<MouseEvent> = "mouseDown"
Defines the value of the type
property of a mouseDown
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows and Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_MOVE:EventType<MouseEvent> = "mouseMove"
Defines the value of the type
property of a mouseMove
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_OUT:EventType<MouseEvent> = "mouseOut"
Defines the value of the type
property of a mouseOut
event object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
relatedObject | The display list object to which the pointing device now points. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_OVER:EventType<MouseEvent> = "mouseOver"
Defines the value of the type
property of a mouseOver
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
relatedObject | The display list object to which the pointing device was pointing. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_UP:EventType<MouseEvent> = "mouseUp"
Defines the value of the type
property of a mouseUp
event object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMOUSE_WHEEL:EventType<MouseEvent> = "mouseWheel"
Defines the value of the type
property of a mouseWheel
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
delta | The number of lines that that each notch on the mouse wheel represents. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyRELEASE_OUTSIDE:EventType<MouseEvent> = "releaseOutside"
Defines the value of the type
property of a
releaseOutside
event object.
This event has the following properties:
staticinlineread onlyRIGHT_CLICK:EventType<MouseEvent> = "rightClick"
Defines the value of the type
property of a rightClick
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | For right-click events, this property is always false . |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyRIGHT_MOUSE_DOWN:EventType<MouseEvent> = "rightMouseDown"
Defines the value of the type
property of a rightMouseDown
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | For right-click events, this property is always true . |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyRIGHT_MOUSE_UP:EventType<MouseEvent> = "rightMouseUp"
Defines the value of the type
property of a rightMouseUp
event
object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | true |
buttonDown | true if the right mouse button is pressed; false otherwise. |
cancelable | false ; the default behavior cannot be canceled. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
clickCount | Count of the number of mouse clicks to indicate whether the event is part of a multi-click sequence. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyROLL_OUT:EventType<MouseEvent> = "rollOut"
Defines the value of the type
property of a rollOut
event object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | false |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
relatedObject | The display list object to which the pointing device now points. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyROLL_OVER:EventType<MouseEvent> = "rollOver"
Defines the value of the type
property of a rollOver
event object.
This event has the following properties:
Property | Value |
---|---|
altKey | true if the Alt key is active (Windows). |
bubbles | false |
buttonDown | true if the primary mouse button is pressed; false otherwise. |
cancelable | false ; there is no default behavior to cancel. |
commandKey | true on the Mac if the Command key is active; false if it is inactive. Always false on Windows. |
controlKey | true if the Ctrl or Control key is active; false if it is inactive. |
ctrlKey | true on Windows or Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
relatedObject | The display list object to which the pointing device was pointing. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
shiftKey | true if the Shift key is active; false if it is inactive. |
stageX | The horizontal coordinate at which the event occurred in global stage coordinates. |
stageY | The vertical coordinate at which the event occurred in global stage coordinates. |
target | The InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
Constructor
new(type:String, bubbles:Bool = true, cancelable:Bool = false, localX:Float = 0, localY:Float = 0, ?relatedObject:InteractiveObject, ctrlKey:Bool = false, altKey:Bool = false, shiftKey:Bool = false, buttonDown:Bool = false, delta:Int = 0, commandKey:Bool = false, controlKey:Bool = false, clickCount:Int = 0)
Creates an Event object that contains information about mouse events. Event objects are passed as parameters to event listeners.
Parameters:
type | The type of the event. Possible values are:
|
---|---|
bubbles | Determines whether the Event object participates in the bubbling phase of the event flow. |
cancelable | Determines whether the Event object can be canceled. |
localX | The horizontal coordinate at which the event occurred relative to the containing sprite. |
localY | The vertical coordinate at which the event occurred relative to the containing sprite. |
relatedObject | The complementary InteractiveObject instance that is
affected by the event. For example, when a
|
ctrlKey | On Windows or Linux, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. |
altKey | Indicates whether the Alt key is activated(Windows or Linux only). |
shiftKey | Indicates whether the Shift key is activated. |
buttonDown | Indicates whether the primary mouse button is pressed. |
delta | Indicates how many lines should be scrolled for each
unit the user rotates the mouse wheel. A positive
delta value indicates an upward scroll; a negative
value indicates a downward scroll. Typical values are
1 to 3, but faster rotation may produce larger
values. This parameter is used only for the
|
Variables
altKey:Bool
Indicates whether the Alt key is active (true
) or inactive
(false
). Supported for Windows only. On other operating
systems, this property is always set to false
.
clickCount:Int
Indicates whether or not the mouse down event is part of a multi-click sequence.
This parameter will be zero for all mouse events other than MouseEvent.mouseDown
,
MouseEvent.mouseUp
, MouseEvent.middleMouseDown
, MouseEvent.middleMouseUp
,
MouseEvent.rightMouseDown
, and MouseEvent.rightMouseUp
. Listening for single
clicks, double clicks, or any multi-click sequence is possible with the
clickCount
parameter. For example, an initial MouseEvent.mouseDown
and
MouseEvent.mouseUp
will have a clickCount
of 1, and the second
MouseEvent.mouseDown
and MouseEvent.mouseUp
in a double-click sequence will
have a clickCount
of 2. If the mouse moves sufficiently or the multi-click
sequence is interrupted for some reason, then the next MouseEvent.mouseDown
will have a clickCount
of 1. The doubleClick
event will continue to fire as
expected.
commandKey:Bool
Indicates whether the command key is activated (Mac only.)
The value of property commandKey
will have the same value as property
ctrlKey
on the Mac. Always false
on Windows or Linux.
controlKey:Bool
Indicates whether the Control key is activated on Mac and whether the Ctrl key is activated on Windows or Linux.
ctrlKey:Bool
On Windows or Linux, indicates whether the Ctrl key is active
(true
) or inactive (false
). On Macintosh,
indicates whether either the Control key or the Command key is activated.
delta:Int
Indicates how many lines should be scrolled for each unit the user rotates
the mouse wheel. A positive delta value indicates an upward scroll; a
negative value indicates a downward scroll. Typical values are 1 to 3, but
faster rotation may produce larger values. This setting depends on the
device and operating system and is usually configurable by the user. This
property applies only to the MouseEvent.mouseWheel
event.
isRelatedObjectInaccessible:Bool
If true
, the relatedObject
property is set to null
for reasons related to
security sandboxes. If the nominal value of relatedObject
is a reference to a
DisplayObject in another sandbox, relatedObject
is set to null
unless there is
permission in both directions across this sandbox boundary. Permission is
established by calling Security.allowDomain()
from a SWF file, or by providing a
policy file from the server of an image file, and setting the
LoaderContext.checkPolicyFile
property when loading the image.
localX:Float
The horizontal coordinate at which the event occurred relative to the containing sprite.
relatedObject:InteractiveObject
A reference to a display list object that is related to the event. For
example, when a mouseOut
event occurs,
relatedObject
represents the display list object to which the
pointing device now points. This property applies to the
mouseOut
, mouseOver
, rollOut
, and
rollOver
events.
The value of this property can be null
in two
circumstances: if there no related object, or there is a related object,
but it is in a security sandbox to which you don't have access. Use the
isRelatedObjectInaccessible()
property to determine which of
these reasons applies.
stageX:Float
The horizontal coordinate at which the event occurred in global Stage
coordinates. This property is calculated when the localX
property is set.
stageY:Float
The vertical coordinate at which the event occurred in global Stage
coordinates. This property is calculated when the localY
property is set.
Methods
updateAfterEvent():Void
Instructs OpenFL to render after processing of this event completes, if the display list has been modified.
On all targets except Flash/AIR, requires
openfl_always_dispatch_mouse_events
to be defined because OpenFL will
throttle mouse events to the frame rate.