class js.html.MouseEvent extends UIEvent

Available on js

The DOM MouseEvent represents events that occur due to the user interacting with a pointing device (such as a mouse). It's represented by the nsINSDOMMouseEvent  interface, which extends the nsIDOMMouseEvent interface.

Documentation for this class was provided by MDN.

Instance Fields

var altKey:Bool

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

var button:Int

The button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. Read only.

var clientX:Int

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

var clientY:Int

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

var ctrlKey:Bool

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

var metaKey:Bool

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

var relatedTarget:EventTarget

The target to which the event applies. Read only.

var screenX:Int

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

var screenY:Int

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

var shiftKey:Bool

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

var x:Int

var y:Int

function initMouseEvent(type:String, canBubble:Bool, cancelable:Bool, view:DOMWindow, detail:Int, screenX:Int, screenY:Int, clientX:Int, clientY:Int, ctrlKey:Bool, altKey:Bool, shiftKey:Bool, metaKey:Bool, button:Int, relatedTarget:EventTarget):Void