public class XEvent
extends Event
Modifier | Constructor and Description |
---|---|
protected |
XEvent() |
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. |
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 Event#getRelatedEventTarget()
@Deprecated public final int getMouseWheelVelocityFix()
Copyright © 2018. All rights reserved.