MouseEvent

package js.html

extends UIEventEvent

extended by DragEvent, MouseScrollEvent, PointerEvent, WheelEvent

Available on js

The MouseEvent 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.

Documentation MouseEvent by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(typeArg:String, ?mouseEventInitDict:Null<MouseEventInit>)

Throws:

null

DOMError

Variables

read onlyaltKey:Bool

Returns true if the alt key was down when the mouse event was fired.

read onlybutton:Int

The button number that was pressed (if applicable) when the mouse event was fired.

read onlybuttons:Int

The buttons being depressed (if any) when the mouse event was fired.

read onlyclientX:Int

The X coordinate of the mouse pointer in local (DOM content) coordinates.

read onlyclientY:Int

The Y coordinate of the mouse pointer in local (DOM content) coordinates.

read onlyctrlKey:Bool

Returns true if the control key was down when the mouse event was fired.

read onlymetaKey:Bool

Returns true if the meta key was down when the mouse event was fired.

read onlymovementX:Int

The X coordinate of the mouse pointer relative to the position of the last mousemove event.

read onlymovementY:Int

The Y coordinate of the mouse pointer relative to the position of the last mousemove event.

read onlyoffsetX:Int

The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.

read onlyoffsetY:Int

The Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.

read onlyregion:String

Returns the id of the hit region affected by the event. If no hit region is affected, null is returned.

read onlyrelatedTarget:EventTarget

The secondary target for the event, if there is one.

read onlyscreenX:Int

The X coordinate of the mouse pointer in global (screen) coordinates.

read onlyscreenY:Int

The Y coordinate of the mouse pointer in global (screen) coordinates.

read onlyshiftKey:Bool

Returns true if the shift key was down when the mouse event was fired.

read onlyx:Int

Alias for MouseEvent.clientX.

read onlyy:Int

Alias for MouseEvent.clientY

Methods

getModifierState(keyArg:String):Bool

Returns the current state of the specified modifier key. See the KeyboardEvent.getModifierState() for details.

initMouseEvent(typeArg:String, canBubbleArg:Bool = false, cancelableArg:Bool = false, ?viewArg:Window, detailArg:Int = 0, screenXArg:Int = 0, screenYArg:Int = 0, clientXArg:Int = 0, clientYArg:Int = 0, ctrlKeyArg:Bool = false, altKeyArg:Bool = false, shiftKeyArg:Bool = false, metaKeyArg:Bool = false, buttonArg:Int = 0, ?relatedTargetArg:EventTarget):Void

Initializes the value of a MouseEvent created. If the event has already being dispatched, this method does nothing.

initNSMouseEvent(typeArg:String, canBubbleArg:Bool = false, cancelableArg:Bool = false, ?viewArg:Window, detailArg:Int = 0, screenXArg:Int = 0, screenYArg:Int = 0, clientXArg:Int = 0, clientYArg:Int = 0, ctrlKeyArg:Bool = false, altKeyArg:Bool = false, shiftKeyArg:Bool = false, metaKeyArg:Bool = false, buttonArg:Int = 0, ?relatedTargetArg:EventTarget, pressure:Float = 0.0, inputSourceArg:Int = 0):Void

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/MouseEvent.html