public class MouseEvent extends UIEvent
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
Modifier and Type | Field and Description |
---|---|
static int |
BUTTON_LEFT
The code for left mouse button.
|
static int |
BUTTON_MIDDLE
The code for middle mouse button.
|
static int |
BUTTON_RIGHT
The code for right mouse button.
|
static int |
MOZ_SOURCE_CURSOR
Constant for
MOZ_SOURCE_CURSOR . |
static int |
MOZ_SOURCE_ERASER
Constant for
MOZ_SOURCE_ERASER . |
static int |
MOZ_SOURCE_KEYBOARD
Constant for
MOZ_SOURCE_KEYBOARD . |
static int |
MOZ_SOURCE_MOUSE
Constant for
MOZ_SOURCE_MOUSE . |
static int |
MOZ_SOURCE_PEN
Constant for
MOZ_SOURCE_PEN . |
static int |
MOZ_SOURCE_TOUCH
Constant for
MOZ_SOURCE_TOUCH . |
static int |
MOZ_SOURCE_UNKNOWN
Constant for
MOZ_SOURCE_UNKNOWN . |
static String |
TYPE_CLICK
The click event type, triggered by
onclick event handlers. |
static String |
TYPE_CONTEXT_MENU
The context menu event type, triggered by
oncontextmenu event handlers. |
static String |
TYPE_DBL_CLICK
The dblclick event type, triggered by
ondblclick event handlers. |
static String |
TYPE_MOUSE_DOWN
The mouse down event type, triggered by
onmousedown event handlers. |
static String |
TYPE_MOUSE_MOVE
The mouse move event type, triggered by
onmousemove event handlers. |
static String |
TYPE_MOUSE_OUT
The mouse out event type, triggered by
onmouseout event handlers. |
static String |
TYPE_MOUSE_OVER
The mouse over event type, triggered by
onmouseover event handlers. |
static String |
TYPE_MOUSE_UP
The mouse up event type, triggered by
onmouseup event handlers. |
SCROLL_PAGE_DOWN, SCROLL_PAGE_UP
ALT_MASK, AT_TARGET, BUBBLING_PHASE, CAPTURING_PHASE, CONTROL_MASK, KEY_CURRENT_EVENT, META_MASK, NONE, SHIFT_MASK, TYPE_ABORT, TYPE_AFTERPRINT, TYPE_AFTERSCRIPTEXECUTE, TYPE_ANIMATIONCANCEL, TYPE_ANIMATIONEND, TYPE_ANIMATIONITERATION, TYPE_ANIMATIONSTART, TYPE_AUXCLICK, TYPE_BEFORE_UNLOAD, TYPE_BEFORECOPY, TYPE_BEFORECUT, TYPE_BEFOREPASTE, TYPE_BEFOREPRINT, TYPE_BEFORESCRIPTEXECUTE, TYPE_BLUR, TYPE_CANCEL, TYPE_CANPLAY, TYPE_CANPLAYTHROUGH, TYPE_CHANGE, TYPE_CLOSE, TYPE_COPY, TYPE_CUECHANGE, TYPE_CUT, TYPE_DEVICEMOTION, TYPE_DEVICEORIENTATION, TYPE_DEVICEORIENTATIONABSOLUTE, TYPE_DOM_DOCUMENT_LOADED, TYPE_DRAG, TYPE_DRAGEND, TYPE_DRAGENTER, TYPE_DRAGLEAVE, TYPE_DRAGOVER, TYPE_DRAGSTART, TYPE_DROP, TYPE_DURATIONCHANGE, TYPE_EMPTIED, TYPE_ENDED, TYPE_ERROR, TYPE_FOCUS, TYPE_FOCUS_IN, TYPE_FOCUS_OUT, TYPE_GAMEPAD_CONNECTED, TYPE_GAMEPAD_DISCONNECTED, TYPE_GOTPOINTERCAPTURE, TYPE_HASH_CHANGE, TYPE_INPUT, TYPE_INVALID, TYPE_KEY_DOWN, TYPE_KEY_PRESS, TYPE_KEY_UP, TYPE_LANGUAGECHANGE, TYPE_LOAD, TYPE_LOAD_END, TYPE_LOAD_START, TYPE_LOADEDDATA, TYPE_LOADEDMETADATA, TYPE_LOSTPOINTERCAPTURE, TYPE_MESSAGE, TYPE_MOUDEENTER, TYPE_MOUSELEAVE, TYPE_MOUSEWHEEL, TYPE_MOZFULLSCREENCHANGE, TYPE_MOZFULLSCREENERROR, TYPE_MSSITEMODEJUMPLISTITEMREMOVED, TYPE_OFFLINE, TYPE_ONLINE, TYPE_ONMESSAGEERROR, TYPE_ONTRANSITIONCANCEL, TYPE_ONTRANSITIONEND, TYPE_ONTRANSITIONRUN, TYPE_ONTRANSITIONSTART, TYPE_OPEN, TYPE_PAGEHIDE, TYPE_PAGESHOW, TYPE_PASTE, TYPE_PAUSE, TYPE_PLAY, TYPE_PLAYING, TYPE_POINTERCANCEL, TYPE_POINTERDOWN, TYPE_POINTERENTER, TYPE_POINTERLEAVE, TYPE_POINTERLOCKCHANGE, TYPE_POINTERLOCKERROR, TYPE_POINTERMOVE, TYPE_POINTEROUT, TYPE_POINTEROVER, TYPE_POINTERUP, TYPE_POPSTATE, TYPE_PROGRESS, TYPE_PROPERTY_CHANGE, TYPE_RATECHANGE, TYPE_READY_STATE_CHANGE, TYPE_REJECTIONHANDLED, TYPE_RESET, TYPE_RESIZE, TYPE_SCROLL, TYPE_SCROLLEND, TYPE_SEARCH, TYPE_SEEKED, TYPE_SEEKING, TYPE_SELECT, TYPE_SELECTIONCHANGE, TYPE_SELECTSTART, TYPE_STALLED, TYPE_STORAGE, TYPE_SUBMIT, TYPE_SUSPEND, TYPE_TIMEOUT, TYPE_TIMEUPDATE, TYPE_TOGGLE, TYPE_TRANSITIONEND, TYPE_UNHANDLEDREJECTION, TYPE_UNLOAD, TYPE_VOLUMECHANGE, TYPE_WAITING, TYPE_WEBANIMATIONSTART, TYPE_WEBKITANIMATIONEND, TYPE_WEBKITANIMATIONITERATION, TYPE_WEBKITFULLSCREENCHANGE, TYPE_WEBKITFULLSCREENERROR, TYPE_WEBKITTRANSITIONEND, TYPE_WHEEL
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
MouseEvent()
Used to build the prototype.
|
MouseEvent(DomNode domNode,
String type,
boolean shiftKey,
boolean ctrlKey,
boolean altKey,
int button,
int detail)
Creates a new event instance.
|
Modifier and Type | Method and Description |
---|---|
void |
disableProcessLabelAfterBubbling()
Disable the lable processing if we are already processing one.
|
int |
getButton()
Gets the button code.
|
int |
getButtons()
Gets the button code.
|
int |
getClientX()
The horizontal coordinate at which the event occurred relative to the DOM implementation's client area.
|
int |
getClientY()
The vertical coordinate at which the event occurred relative to the DOM implementation's client area.
|
static MouseEvent |
getCurrentMouseEvent()
Returns the mouse event currently firing, or
null if no mouse event is being processed. |
boolean |
getMetaKey()
Returns whether or not the "meta" key was pressed during the event firing.
|
int |
getPageX()
Returns the horizontal coordinate of the event relative to whole document..
|
int |
getPageY()
Returns the vertical coordinate of the event relative to the whole document.
|
int |
getScreenX()
The horizontal coordinate at which the event occurred relative to the origin of the screen
coordinate system.
|
int |
getScreenY()
The vertical coordinate at which the event occurred relative to the origin of the screen
coordinate system.
|
int |
getWhich()
Special for FF (old stuff from Netscape time).
|
void |
initMouseEvent(String type,
boolean bubbles,
boolean cancelable,
Object view,
int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button,
Object relatedTarget)
Implementation of the DOM Level 2 Event method for initializing the mouse event.
|
boolean |
isAltKey()
Returns whether
ALT has been pressed during this event or not. |
boolean |
isCtrlKey()
Returns whether
CTRL has been pressed during this event or not. |
static boolean |
isMouseEvent(String type)
Returns
true if the specified event type should be managed as a mouse event. |
boolean |
isShiftKey()
Returns whether
SHIFT has been pressed during this event or not. |
void |
jsConstructor(String type,
org.htmlunit.corejs.javascript.ScriptableObject details)
JavaScript constructor.
|
boolean |
processLabelAfterBubbling()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
|
void |
setButton(int value)
Sets the button code.
|
void |
setButtons(int value)
Sets the button code.
|
void |
setClientX(int value)
Sets the clientX value.
|
void |
setClientY(int value)
Sets the clientY value.
|
protected void |
setMetaKey(boolean metaKey) |
getDetail, getView, initUIEvent, setDetail
createPropertyChangeEvent, endFire, eventCreated, getComposed, getCurrentTarget, getEventPhase, getKeyCode, getPropertyName, getReturnValue, getSrcElement, getTarget, getTimeStamp, getType, initEvent, isAborted, isBubbles, isCancelable, isCancelBubble, isDefaultPrevented, isImmediatePropagationStopped, isMissingOrUndefined, isPropagationStopped, preventDefault, setAltKey, setBubbles, setCancelable, setCancelBubble, setCtrlKey, setCurrentTarget, setEventPhase, setEventType, setKeyCode, setReturnValue, setShiftKey, setSrcElement, setTarget, setType, startFire, stopImmediatePropagation, stopPropagation, toString
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public static final int MOZ_SOURCE_UNKNOWN
MOZ_SOURCE_UNKNOWN
.public static final int MOZ_SOURCE_MOUSE
MOZ_SOURCE_MOUSE
.public static final int MOZ_SOURCE_PEN
MOZ_SOURCE_PEN
.public static final int MOZ_SOURCE_ERASER
MOZ_SOURCE_ERASER
.public static final int MOZ_SOURCE_CURSOR
MOZ_SOURCE_CURSOR
.public static final int MOZ_SOURCE_TOUCH
MOZ_SOURCE_TOUCH
.public static final int MOZ_SOURCE_KEYBOARD
MOZ_SOURCE_KEYBOARD
.public static final String TYPE_CLICK
onclick
event handlers.public static final String TYPE_DBL_CLICK
ondblclick
event handlers.public static final String TYPE_MOUSE_OVER
onmouseover
event handlers.public static final String TYPE_MOUSE_MOVE
onmousemove
event handlers.public static final String TYPE_MOUSE_OUT
onmouseout
event handlers.public static final String TYPE_MOUSE_DOWN
onmousedown
event handlers.public static final String TYPE_MOUSE_UP
onmouseup
event handlers.public static final String TYPE_CONTEXT_MENU
oncontextmenu
event handlers.public static final int BUTTON_LEFT
public static final int BUTTON_MIDDLE
public static final int BUTTON_RIGHT
public MouseEvent()
public MouseEvent(DomNode domNode, String type, boolean shiftKey, boolean ctrlKey, boolean altKey, int button, int detail)
domNode
- the DOM node that triggered the eventtype
- the event typeshiftKey
- true if SHIFT is pressedctrlKey
- true if CTRL is pressedaltKey
- true if ALT is pressedbutton
- the button code, must be BUTTON_LEFT
, BUTTON_MIDDLE
or BUTTON_RIGHT
detail
- the detail valuepublic void jsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details)
jsConstructor
in class UIEvent
type
- the event typedetails
- the event details (optional)public int getClientX()
public void setClientX(int value)
value
- the clientX valuepublic int getScreenX()
public int getPageX()
getScreenX()
)public int getClientY()
public void setClientY(int value)
value
- the clientY valuepublic int getScreenY()
public int getPageY()
getScreenY()
)public int getButton()
public void setButton(int value)
value
- the button codepublic int getButtons()
public void setButtons(int value)
value
- the button codepublic int getWhich()
getWhich
in class UIEvent
public void initMouseEvent(String type, boolean bubbles, boolean cancelable, Object view, int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button, Object relatedTarget)
type
- the event typebubbles
- can the event bubblecancelable
- can the event be canceledview
- the view to use for this eventdetail
- the detail to set for the eventscreenX
- the initial value of screenXscreenY
- the initial value of screenYclientX
- the initial value of clientXclientY
- the initial value of clientYctrlKey
- is the control key pressedaltKey
- is the alt key pressedshiftKey
- is the shift key pressedmetaKey
- is the meta key pressedbutton
- what mouse button is pressedrelatedTarget
- is there a related target for the eventpublic static MouseEvent getCurrentMouseEvent()
null
if no mouse event is being processed.public static boolean isMouseEvent(String type)
true
if the specified event type should be managed as a mouse event.type
- the type of event to checktrue
if the specified event type should be managed as a mouse eventpublic boolean isAltKey()
ALT
has been pressed during this event or not. Overridden to modify browser configurations.public boolean isCtrlKey()
CTRL
has been pressed during this event or not. Overridden to modify browser configurations.public boolean isShiftKey()
SHIFT
has been pressed during this event or not. Overridden to modify browser configurations.isShiftKey
in class Event
SHIFT
has been pressed during this event or notpublic boolean processLabelAfterBubbling()
processLabelAfterBubbling
in class Event
public void disableProcessLabelAfterBubbling()
public boolean getMetaKey()
protected void setMetaKey(boolean metaKey)
metaKey
- whether Meta has been pressed during this event or notCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.