import Event from "./Event"; import InteractiveObject from "../display/InteractiveObject"; declare namespace openfl.events { /** * 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 [Capturing mouse input](https://books.openfl.org/openfl-developers-guide/mouse-input/capturing-mouse-input.html) * */ export class MouseEvent extends Event { /** * Creates an Event object that contains information about mouse events. * Event objects are passed as parameters to event listeners. * * @param type The type of the event. Possible values are: * `MouseEvent.CLICK`, * `MouseEvent.DOUBLE_CLICK`, * `MouseEvent.MOUSE_DOWN`, * `MouseEvent.MOUSE_MOVE`, * `MouseEvent.MOUSE_OUT`, * `MouseEvent.MOUSE_OVER`, * `MouseEvent.MOUSE_UP`, * `MouseEvent.MIDDLE_CLICK`, * `MouseEvent.MIDDLE_MOUSE_DOWN`, * `MouseEvent.MIDDLE_MOUSE_UP`, * `MouseEvent.RIGHT_CLICK`, * `MouseEvent.RIGHT_MOUSE_DOWN`, * `MouseEvent.RIGHT_MOUSE_UP`, * `MouseEvent.MOUSE_WHEEL`, * `MouseEvent.ROLL_OUT`, and * `MouseEvent.ROLL_OVER`. * @param bubbles Determines whether the Event object participates in * the bubbling phase of the event flow. * @param cancelable Determines whether the Event object can be canceled. * @param localX The horizontal coordinate at which the event occurred * relative to the containing sprite. * @param localY The vertical coordinate at which the event occurred * relative to the containing sprite. * @param relatedObject The complementary InteractiveObject instance that is * affected by the event. For example, when a * `mouseOut` event occurs, * `relatedObject` represents the display * list object to which the pointing device now points. * @param 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. * @param altKey Indicates whether the Alt key is activated (Windows * or Linux only). * @param shiftKey Indicates whether the Shift key is activated. * @param buttonDown Indicates whether the primary mouse button is * pressed. * @param 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 * `MouseEvent.mouseWheel` event. * */ constructor(type: string, bubbles?: boolean, cancelable?: boolean, localX?: number, localY?: number, relatedObject?: InteractiveObject, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, buttonDown?: boolean, delta?: number, commandKey?: boolean, controlKey?: boolean, clickCount?: number); /** * 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. | * */ static readonly CLICK = "click"; /** * 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. | * */ static readonly DOUBLE_CLICK = "doubleClick"; /** * 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. | * */ static readonly MIDDLE_CLICK = "middleClick"; /** * 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. | * */ static readonly MIDDLE_MOUSE_DOWN = "middleMouseDown"; /** * 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. | * */ static readonly MIDDLE_MOUSE_UP = "middleMouseUp"; /** * 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. | * */ static readonly MOUSE_DOWN = "mouseDown"; /** * 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. | * */ static readonly MOUSE_MOVE = "mouseMove"; /** * 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. | * */ static readonly MOUSE_OUT = "mouseOut"; /** * 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. | * */ static readonly MOUSE_OVER = "mouseOver"; /** * 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. | * */ static readonly MOUSE_UP = "mouseUp"; /** * 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. | * */ static readonly MOUSE_WHEEL = "mouseWheel"; /** * Defines the value of the `type` property of a * `releaseOutside` event object. * * This event has the following properties: * */ static readonly RELEASE_OUTSIDE = "releaseOutside"; /** * 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. | * */ static readonly RIGHT_CLICK = "rightClick"; /** * 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. | * */ static readonly RIGHT_MOUSE_DOWN = "rightMouseDown"; /** * 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. | * */ static readonly RIGHT_MOUSE_UP = "rightMouseUp"; /** * 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. | * */ static readonly ROLL_OUT = "rollOut"; /** * 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. | * */ static readonly ROLL_OVER = "rollOver"; /** * 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`. * */ altKey: boolean; /** * Indicates whether the primary mouse button is pressed (`true`) * or not (`false`). * */ buttonDown: boolean; /** * 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. * */ commandKey: boolean; /** * Indicates whether the Control key is activated on Mac and whether the * Ctrl key is activated on Windows or Linux. * */ controlKey: boolean; /** * 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. * */ clickCount: number; /** * 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. * */ ctrlKey: boolean; /** * 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. * */ delta: number; /** * 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. * */ isRelatedObjectInaccessible: boolean; /** * The horizontal coordinate at which the event occurred relative to the * containing sprite. * */ localX: number; /** * The vertical coordinate at which the event occurred relative to the * containing sprite. * */ localY: number; /** * 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. * */ relatedObject: InteractiveObject; /** * Indicates whether the Shift key is active (`true`) or inactive * (`false`). * */ shiftKey: boolean; /** * The horizontal coordinate at which the event occurred in global Stage * coordinates. This property is calculated when the `localX` * property is set. * */ stageX: number; /** * The vertical coordinate at which the event occurred in global Stage * coordinates. This property is calculated when the `localY` * property is set. * */ stageY: number; override clone(): MouseEvent; override toString(): string; /** * 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. * */ updateAfterEvent(): void; } } export default openfl.events.MouseEvent;