public interface MouseEvent extends UIEvent
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.Modifier and Type | Interface and Description |
---|---|
static interface |
MouseEvent.Button
Contains the set of standard values returned by
#button . |
AT_TARGET, BEFORECOPY, BEFORECUT, BEFOREPASTE, BLUR, BUBBLING_PHASE, CAPTURING_PHASE, CHANGE, CLICK, CONTEXTMENU, COPY, CUT, DBLCLICK, DRAG, DRAGEND, DRAGENTER, DRAGLEAVE, DRAGOVER, DRAGSTART, DROP, ERROR, FOCUS, FOCUSIN, FOCUSOUT, INPUT, INVALID, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP, MOUSEWHEEL, NONE, PASTE, RESIZE, SCROLL, SELECTSTART, SUBMIT, TOUCHCANCEL, TOUCHEND, TOUCHMOVE, TOUCHSTART, WEBKITANIMATIONEND, WEBKITANIMATIONITERATION, WEBKITANIMATIONSTART, WEBKITTRANSITIONEND
Modifier and Type | Method and Description |
---|---|
int |
getButton()
The button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2.
|
int |
getClientX()
The X coordinate of the mouse pointer in local (DOM content) coordinates.
|
int |
getClientY()
The Y coordinate of the mouse pointer in local (DOM content) coordinates.
|
Clipboard |
getDataTransfer() |
Node |
getFromElement() |
int |
getOffsetX() |
int |
getOffsetY() |
EventTarget |
getRelatedTarget()
The target to which the event applies.
|
int |
getScreenX()
The X coordinate of the mouse pointer in global (screen) coordinates.
|
int |
getScreenY()
The Y coordinate of the mouse pointer in global (screen) coordinates.
|
Node |
getToElement() |
int |
getWebkitMovementX() |
int |
getWebkitMovementY() |
int |
getX() |
int |
getY() |
void |
initMouseEvent(String type,
boolean canBubble,
boolean cancelable,
Window view,
int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button,
EventTarget relatedTarget) |
boolean |
isAltKey()
true if the alt key was down when the mouse event was fired. |
boolean |
isCtrlKey()
true if the control key was down when the mouse event was fired. |
boolean |
isMetaKey()
true if the meta key was down when the mouse event was fired. |
boolean |
isShiftKey()
true if the shift key was down when the mouse event was fired. |
getCharCode, getDetail, getKeyCode, getLayerX, getLayerY, getPageX, getPageY, getView, getWhich, initUIEvent
getClipboardData, getCurrentTarget, getEventPhase, getSrcElement, getTarget, getTimeStamp, getType, initEvent, isBubbles, isCancelable, isCancelBubble, isDefaultPrevented, isReturnValue, preventDefault, setCancelBubble, setReturnValue, stopImmediatePropagation, stopPropagation
boolean isAltKey()
true
if the alt key was down when the mouse event was fired. Read only.int getButton()
int getClientX()
int getClientY()
boolean isCtrlKey()
true
if the control key was down when the mouse event was fired. Read only.Clipboard getDataTransfer()
Node getFromElement()
boolean isMetaKey()
true
if the meta key was down when the mouse event was fired. Read only.int getOffsetX()
int getOffsetY()
EventTarget getRelatedTarget()
int getScreenX()
int getScreenY()
boolean isShiftKey()
true
if the shift key was down when the mouse event was fired. Read only.Node getToElement()
int getWebkitMovementX()
int getWebkitMovementY()
int getX()
int getY()
void initMouseEvent(String type, boolean canBubble, boolean cancelable, Window view, int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button, EventTarget relatedTarget)
Copyright © 2016. All rights reserved.