public class XEvent extends Event
Event.NativePreviewEvent, Event.NativePreviewHandlerFOCUSEVENTS, 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, UNDEFINEDBUTTON_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.
|
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, sinkEventsgetAltKey, getButton, getChangedTouches, getCharCode, getClientX, getClientY, getCtrlKey, getCurrentEventTarget, getDataTransfer, getEventTarget, getKeyCode, getMetaKey, getMouseWheelVelocityY, getRelatedEventTarget, getRotation, getScale, getScreenX, getScreenY, getShiftKey, getString, getTargetTouches, getTouches, getType, preventDefault, stopPropagationcast, createArray, createFunction, createObject, equals, hashCode, toSource, toStringpublic 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()Copyright © 2012. All Rights Reserved.