public class NativeEvent extends JavaScriptObject
| Modifier and Type | Field and Description |
|---|---|
static int |
BUTTON_LEFT
The left mouse button.
|
static int |
BUTTON_MIDDLE
The middle mouse button.
|
static int |
BUTTON_RIGHT
The right mouse button.
|
| Modifier | Constructor and Description |
|---|---|
protected |
NativeEvent()
Required constructor for GWT compiler to function.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAltKey()
Gets whether the ALT key was depressed when the given event occurred.
|
int |
getButton()
Gets the mouse buttons that were depressed when the given event occurred.
|
JsArray<Touch> |
getChangedTouches()
Get an array of touches which have changed since the last touch event.
|
int |
getCharCode()
Gets the Unicode codepoint of the character generated by this key event.
|
int |
getClientX()
Gets the mouse x-position within the browser window's client area.
|
int |
getClientY()
Gets the mouse y-position within the browser window's client area.
|
boolean |
getCtrlKey()
Gets whether the CTRL key was depressed when the given event occurred.
|
EventTarget |
getCurrentEventTarget()
Gets the current target element of this event.
|
DataTransfer |
getDataTransfer()
Get the
DataTransfer associated with the current drag event. |
EventTarget |
getEventTarget()
Returns the element that was the actual target of the given event.
|
int |
getKeyCode()
Gets the key code (code associated with the physical key) associated with
this event.
|
boolean |
getMetaKey()
Gets whether the META key was depressed when the given event occurred.
|
int |
getMouseWheelVelocityY()
Gets the velocity of the mouse wheel associated with the event along the Y
axis.
|
EventTarget |
getRelatedEventTarget()
Gets the related target for this event.
|
double |
getRotation()
Get the rotation in degrees, with positive values indicating clockwise rotation.
|
double |
getScale()
Get the amount scaled since the gesture started, with 1.0 representing no scaling.
|
int |
getScreenX()
Gets the mouse x-position on the user's display.
|
int |
getScreenY()
Gets the mouse y-position on the user's display.
|
boolean |
getShiftKey()
Gets whether the shift key was depressed when the given event occurred.
|
java.lang.String |
getString()
Gets a string representation of this event.
|
JsArray<Touch> |
getTargetTouches()
Get an array of touches which have changed since the last touch event.
|
JsArray<Touch> |
getTouches()
Get an array of touches which have changed since the last touch event.
|
java.lang.String |
getType()
Gets the enumerated type of this event.
|
void |
preventDefault()
Prevents the browser from taking its default action for the given event.
|
void |
stopPropagation()
Stops the event from being propagated to parent elements.
|
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toStringpublic static final int BUTTON_LEFT
public static final int BUTTON_MIDDLE
public static final int BUTTON_RIGHT
protected NativeEvent()
public final boolean getAltKey()
true if ALT was depressed when the event occurredpublic final int getButton()
BUTTON_LEFT,
BUTTON_MIDDLE, and
BUTTON_RIGHTpublic final JsArray<Touch> getChangedTouches()
public final int getCharCode()
public final int getClientX()
public final int getClientY()
public final boolean getCtrlKey()
true if CTRL was depressed when the event occurredpublic final EventTarget getCurrentEventTarget()
public final DataTransfer getDataTransfer()
DataTransfer associated with the current drag event.DataTransfer object, or null if not a drag eventpublic final EventTarget getEventTarget()
public final int getKeyCode()
KeyCodespublic final boolean getMetaKey()
true if META was depressed when the event occurredpublic final int getMouseWheelVelocityY()
The velocity of the event is an artificial measurement for relative comparisons of wheel activity. It is affected by some non-browser factors, including choice of input hardware and mouse acceleration settings. The sign of the velocity measurement agrees with the screen coordinate system; negative values are towards the origin and positive values are away from the origin. Standard scrolling speed is approximately ten units per event.
public final EventTarget getRelatedEventTarget()
public final double getRotation()
public final double getScale()
public final int getScreenX()
public final int getScreenY()
public final boolean getShiftKey()
true if shift was depressed when the event occurredpublic final java.lang.String getString()
JavaScriptObject.toString() because it is final in
JavaScriptObject.public final JsArray<Touch> getTargetTouches()
public final JsArray<Touch> getTouches()
public final java.lang.String getType()
public final void preventDefault()
public final void stopPropagation()