public class XEvent extends Event
Event.NativePreviewEvent, Event.NativePreviewHandler
FOCUSEVENTS, GESTUREEVENTS, KEYEVENTS, MOUSEEVENTS, ONBLUR, ONCHANGE, ONCLICK, ONCONTEXTMENU, ONDBLCLICK, ONERROR, ONFOCUS, ONGESTURECHANGE, ONGESTUREEND, ONGESTURESTART, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONLOSECAPTURE, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONMOUSEWHEEL, ONPASTE, ONSCROLL, ONTOUCHCANCEL, ONTOUCHEND, ONTOUCHMOVE, ONTOUCHSTART, TOUCHEVENTS, UNDEFINED
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT
Modifier and Type | Method and Description |
---|---|
boolean |
getCtrlOrMetaKey()
Returns true if the control or meta key was depressed.
|
XElement |
getEventTargetEl()
Returns the event target element.
|
int |
getMouseWheelVelocityFix()
Deprecated.
this method will be removed when the bug is fixed
|
XElement |
getTargetEl(String selector,
int maxDepth)
Returns the matching parent using the specified selector.
|
Point |
getXY()
Returns the mouse location.
|
boolean |
isNavKeyPress()
Returns true if the key is a "navigation" key.
|
boolean |
isNavKeyPress(int k)
Returns true if the key is a "navigation" key.
|
boolean |
isRightClick()
Returns
true if the event is a right click. |
boolean |
isSpecialKey()
Returns true if the key is a "special" key.
|
boolean |
isSpecialKey(int k)
Returns true if the key is a "special" key.
|
void |
stopEvent()
Stops the event (stopPropagation and preventDefault).
|
boolean |
within(Element element)
Returns
true if the target of this event equals or is a child
of the given element. |
boolean |
within(Element element,
boolean toElement)
Returns
true if the target of this event equals or is a child
of the given element. |
addEventPreview, addNativePreviewHandler, as, cancelBubble, fireNativePreviewEvent, getCurrentEvent, getCurrentTarget, getEventListener, getEventsSunk, getFromElement, getRelatedTarget, getRepeat, getTarget, getToElement, getTypeInt, getTypeInt, releaseCapture, removeEventPreview, setCapture, setEventListener, sinkEvents
getAltKey, getButton, getChangedTouches, getCharCode, getClientX, getClientY, getCtrlKey, getCurrentEventTarget, getDataTransfer, getEventTarget, getKeyCode, getMetaKey, getMouseWheelVelocityY, getRelatedEventTarget, getRotation, getScale, getScreenX, getScreenY, getShiftKey, getString, getTargetTouches, getTouches, getType, preventDefault, stopPropagation
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
public final boolean getCtrlOrMetaKey()
public final XElement getEventTargetEl()
public final XElement getTargetEl(String selector, int maxDepth)
selector
- the CSS selectormaxDepth
- the maximum number of parents to searchpublic final Point getXY()
public final boolean isNavKeyPress()
public final boolean isNavKeyPress(int k)
k
- the key codepublic final boolean isRightClick()
true
if the event is a right click.public final boolean isSpecialKey()
public final boolean isSpecialKey(int k)
k
- the key codepublic final void stopEvent()
public final boolean within(Element element)
true
if the target of this event equals or is a child
of the given element.element
- the elementpublic final boolean within(Element element, boolean toElement)
true
if the target of this event equals or is a child
of the given element.element
- the elementtoElement
- true to use NativeEvent.getRelatedEventTarget()
@Deprecated public final int getMouseWheelVelocityFix()
Copyright © 2015. All rights reserved.