MouseEvent インターフェイスはマウスイベントに関連する文脈情報を提供する。
UIEvent から継承される detail プロパティは、ユーザアクション中にマウスボタンが同じスクリーン位置上で押し離された回数をあらわす。ユーザがこのアクションを開始し、押して放すフルシーケンスそれぞれについて1増加する時、、このプロパティ値は 1 である。mousedown と mouseup の間にユーザがマウスを動かす場合は、クリックは発生せず、値に 0 が設定される。
ネストしたエレメントの場合には、マウスイベントは常に、最も深くネストされたエレメントをターゲットにする。ターゲットとされたエレメントの祖先はその子孫エレメント内に生じるマウスイベントの通知を得るためにバブリングを使用してよい。
altKeyboolean型, 読取専用
clientXlong型, 読取専用
clientYlong型, 読取専用
ctrlKeyboolean型, 読取専用
metaKeyboolean型, 読取専用
screenXlong型, 読取専用
screenYlong型, 読取専用
shiftKeyboolean型, 読取専用
initMouseEvent( typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg )initMouseEvent メソッドは DocumentEvent を通して作成される MouseEvent の値を初期化する。このメソッドは、必要ならばフェイズ中に複数回呼び出してよいが、 MouseEvent が DispachEvent メソッド経由で送信される前にのみ呼ぶことができる。複数回呼び出す場合は、最後に実施されるものが先行する。
Event の AbstractView。Event のマウスクリックカウント。Event のスクリーンの X 座標。Event のスクリーンの Y 座標。Event のクライアントの X 座標。Event のクライアントの Y 座標。Event 中にコントロールキーが押されていたかどうか。Event 中に alt キーが押されていたかどうか。Event 中にシフトキーが押されていたかどうかEvent 中にメタキーが押されていたかどうか。Event のマウスボタンEvent の関連する EventTarget。(無し)
mousedown
mouseup
click
| Bubbles | true |
| Cancelable | true |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail |
| Bubbles | true |
| Cancelable | true |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail |
| Bubbles | true |
| Cancelable | true |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, button, detail |
| Bubbles | true |
| Cancelable | true |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, relatedTarget indicates the EventTarget the pointing device is exiting. |
| Bubbles | true |
| Cancelable | false |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey |
| Bubbles | true |
| Cancelable | true |
| Context Info | screenX, screenY, clientX, clientY, altKey, ctrlKey, shiftKey, metaKey, relatedTarget indicates the EventTarget the pointing device is entering. |
// Introduced in DOM Level 2:
interface MouseEvent : UIEvent {
readonly attribute long screenX;
readonly attribute long screenY;
readonly attribute long clientX;
readonly attribute long clientY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute unsigned short button;
readonly attribute EventTarget relatedTarget;
void initMouseEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in views::AbstractView viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in unsigned short buttonArg,
in EventTarget relatedTargetArg);
};