Skip to content
SiteEmail

MouseEvent

Module: JavaScript DOM API

#include <MouseEvent.idl>

Inherits from UIEvent, Event

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

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 Attributes inherited from UIEvent

Name
readonly attribute longdetail

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
readonly attribute booleancomposed
MouseEvent MouseEvent(
DOMInternedString type,
optional MouseEventInit eventInitDict
)
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
)
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.

readonly attribute long screenX;
readonly attribute long screenY;
readonly attribute long movementX;
readonly attribute long movementY;
readonly attribute long clientX;
readonly attribute long clientY;
readonly attribute long x;
readonly attribute long y;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute short button;
readonly attribute unsigned short buttons;
readonly attribute float deltaX;
readonly attribute float deltaY;
readonly attribute unsigned short deltaMode;
readonly attribute EventTarget relatedTarget;