MouseEvent
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.
Instance Members
screenX: IntThe X coordinate of the mouse pointer in global (screen) coordinates.
screenY: IntThe Y coordinate of the mouse pointer in global (screen) coordinates.
clientX: IntThe X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY: IntThe Y coordinate of the mouse pointer in local (DOM content) coordinates.
x: IntAlias for MouseEvent.clientX.
y: IntAlias for MouseEvent.clientY
offsetX: IntThe X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
offsetY: IntThe Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
ctrlKey: BoolReturns true if the control key was down when the mouse event was fired.
shiftKey: BoolReturns true if the shift key was down when the mouse event was fired.
altKey: BoolReturns true if the alt key was down when the mouse event was fired.
metaKey: BoolReturns true if the meta key was down when the mouse event was fired.
button: IntThe button number that was pressed (if applicable) when the mouse event was fired.
buttons: IntThe buttons being depressed (if any) when the mouse event was fired.
The secondary target for the event, if there is one.
region: StringReturns the id of the hit region affected by the event. If no hit region is affected, null is returned.
movementX: IntThe X coordinate of the mouse pointer relative to the position of the last mousemove event.
movementY: IntThe Y coordinate of the mouse pointer relative to the position of the last mousemove event.
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): VoidInitializes the value of a MouseEvent created. If the event has already being dispatched, this method does nothing.
| Name | Type | Default |
|---|---|---|
typeArg |
String | |
canBubbleArg |
Bool | false |
cancelableArg |
Bool | false |
viewArg |
Window | (optional) |
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 | (optional) |
Returns the current state of the specified modifier key. See the KeyboardEvent.getModifierState() for details.
| Name | Type |
|---|---|
keyArg |
String |
| Returns |
|---|
| Bool |
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| Name | Type | Default |
|---|---|---|
typeArg |
String | |
canBubbleArg |
Bool | false |
cancelableArg |
Bool | false |
viewArg |
Window | (optional) |
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 | (optional) |
pressure |
Float | 0.0 |
inputSourceArg |
Int | 0 |
new(typeArg: String, ?mouseEventInitDict: Null<MouseEventInit>): Void| Name | Type | Default |
|---|---|---|
typeArg |
String | |
mouseEventInitDict |
Null<MouseEventInit> | (optional) |