MouseEvent

Module: JavaScript DOM API

#include <MouseEvent.idl>

Inherits from UIEvent, Event

Public Functions

Name
MouseEventMouseEvent(DOMInternedString type, optional MouseEventInit eventInitDict)
voidinitMouseEvent(optional DOMInternedString typeArg, optional boolean canBubbleArg, optional boolean cancelableArg, optional Window? viewArg, optional long detailArg, optional long screenXArg, optional long screenYArg, optional long clientXArg, optional long clientYArg, optional boolean ctrlKeyArg, optional boolean altKeyArg, optional boolean shiftKeyArg, optional boolean metaKeyArg, optional short buttonArg, optional Node? relatedTargetArg)
booleangetModifierState(DOMString keyIdentifier)
Queries the state of a modifier using a key value.

Public Attributes

Name
readonly attribute longscreenX
readonly attribute longscreenY
readonly attribute longmovementX
readonly attribute longmovementY
readonly attribute longclientX
readonly attribute longclientY
readonly attribute longx
readonly attribute longy
readonly attribute booleanctrlKey
readonly attribute booleanshiftKey
readonly attribute booleanaltKey
readonly attribute booleanmetaKey
readonly attribute shortbutton
readonly attribute unsigned shortbuttons
readonly attribute floatdeltaX
readonly attribute floatdeltaY
readonly attribute unsigned shortdeltaMode
readonly attribute EventTargetrelatedTarget

Additional inherited members

Public Functions inherited from UIEvent

Name
UIEventUIEvent(DOMInternedString type, optional UIEventInit initEvent)
voidinitUIEvent(optional DOMInternedString type, optional boolean canBubble, optional boolean cancelable, optional Window? view, optional long detail)

Public Functions inherited from Event

Name
EventEvent(DOMInternedString type, optional EventInit initEvent)
voidstopPropagation()
voidpreventDefault()
voidinitEvent(optional DOMInternedString eventTypeArg, optional boolean canBubbleArg, optional boolean cancelableArg)
voidstopImmediatePropagation()

Public Attributes inherited from Event

Name
const unsigned shortNONE
const unsigned shortCAPTURING_PHASE
const unsigned shortAT_TARGET
const unsigned shortBUBBLING_PHASE
readonly attribute DOMStringtype
readonly attribute EventTargettarget
readonly attribute EventTargetcurrentTarget
readonly attribute unsigned shorteventPhase
readonly attribute booleanbubbles
readonly attribute booleancancelable
readonly attribute booleandefaultPrevented

Public Functions Documentation

function MouseEvent

MouseEvent MouseEvent(
    DOMInternedString type,
    optional MouseEventInit eventInitDict
)

function initMouseEvent

void initMouseEvent(
    optional DOMInternedString typeArg,
    optional boolean canBubbleArg,
    optional boolean cancelableArg,
    optional Window? viewArg,
    optional long detailArg,
    optional long screenXArg,
    optional long screenYArg,
    optional long clientXArg,
    optional long clientYArg,
    optional boolean ctrlKeyArg,
    optional boolean altKeyArg,
    optional boolean shiftKeyArg,
    optional boolean metaKeyArg,
    optional short buttonArg,
    optional Node? relatedTargetArg
)

function getModifierState

boolean getModifierState(
    DOMString keyIdentifier
)

Queries the state of a modifier using a key value.

Parameters:

  • keyIdentifier A modifier key value.

Return: true if it is a modifier key and the modifier is activated, false otherwise.

Public Attributes Documentation

variable screenX

readonly attribute long screenX;

variable screenY

readonly attribute long screenY;

variable movementX

readonly attribute long movementX;

variable movementY

readonly attribute long movementY;

variable clientX

readonly attribute long clientX;

variable clientY

readonly attribute long clientY;

variable x

readonly attribute long x;

variable y

readonly attribute long y;

variable ctrlKey

readonly attribute boolean ctrlKey;

variable shiftKey

readonly attribute boolean shiftKey;

variable altKey

readonly attribute boolean altKey;

variable metaKey

readonly attribute boolean metaKey;

variable button

readonly attribute short button;

variable buttons

readonly attribute unsigned short buttons;

variable deltaX

readonly attribute float deltaX;

variable deltaY

readonly attribute float deltaY;

variable deltaMode

readonly attribute unsigned short deltaMode;

variable relatedTarget

readonly attribute EventTarget relatedTarget;