Class Event

public final class Event
extends JavaScriptObject
An opaque handle to a native DOM Event. An Event cannot be created directly. Instead, use the Event type when returning a native DOM event from JSNI methods. An Event passed back into JSNI becomes the original DOM event the Event was created from, and can be accessed in JavaScript code as expected. This is typically done by calling methods in the DOM class.

Fields

BUTTON_LEFTThe left mouse button (used in DOM.eventGetButton(Event)).
BUTTON_MIDDLEThe middle mouse button (used in DOM.eventGetButton(Event)).
BUTTON_RIGHTThe right mouse button (used in DOM.eventGetButton(Event)).
FOCUSEVENTSA bit-mask covering both focus events (focus and blur).
KEYEVENTSA bit-mask covering all keyboard events (down, up, and press).
MOUSEEVENTSA bit-mask covering all mouse events (down, up, move, over, and out), but not click, dblclick, or wheel events.
ONBLURFired when an element loses keyboard focus.
ONCHANGEFired when the value of an input element changes.
ONCLICKFired when the user clicks on an element.
ONDBLCLICKFired when the user double-clicks on an element.
ONERRORFired when an image encounters an error.
ONFOCUSFired when an element receives keyboard focus.
ONKEYDOWNFired when the user depresses a key.
ONKEYPRESSFired when the a character is generated from a keypress (either directly or through auto-repeat).
ONKEYUPFired when the user releases a key.
ONLOADFired when an element (normally an IMG) finishes loading.
ONLOSECAPTUREFired when an element that has mouse capture loses it.
ONMOUSEDOWNFired when the user depresses a mouse button over an element.
ONMOUSEMOVEFired when the mouse is moved within an element's area.
ONMOUSEOUTFired when the mouse is moved out of an element's area.
ONMOUSEOVERFired when the mouse is moved into an element's area.
ONMOUSEUPFired when the user releases a mouse button over an element.
ONMOUSEWHEELFired when the user scrolls the mouse wheel over an element.
ONSCROLLFired when a scrollable element's scroll offset changes.
UNDEFINEDError code returned by DOM.getEventXXX methods when the actual integer value is undefined.

Constructors

Event()Not directly instantiable.

Methods

equals(Object)
hashCode()
toString()

Field Detail

BUTTON_LEFT

public static final int BUTTON_LEFT
The left mouse button (used in DOM.eventGetButton(Event)).

BUTTON_MIDDLE

public static final int BUTTON_MIDDLE
The middle mouse button (used in DOM.eventGetButton(Event)).

BUTTON_RIGHT

public static final int BUTTON_RIGHT
The right mouse button (used in DOM.eventGetButton(Event)).

FOCUSEVENTS

public static final int FOCUSEVENTS
A bit-mask covering both focus events (focus and blur).

KEYEVENTS

public static final int KEYEVENTS
A bit-mask covering all keyboard events (down, up, and press).

MOUSEEVENTS

public static final int MOUSEEVENTS
A bit-mask covering all mouse events (down, up, move, over, and out), but not click, dblclick, or wheel events.

ONBLUR

public static final int ONBLUR
Fired when an element loses keyboard focus.

ONCHANGE

public static final int ONCHANGE
Fired when the value of an input element changes.

ONCLICK

public static final int ONCLICK
Fired when the user clicks on an element.

ONDBLCLICK

public static final int ONDBLCLICK
Fired when the user double-clicks on an element.

ONERROR

public static final int ONERROR
Fired when an image encounters an error.

ONFOCUS

public static final int ONFOCUS
Fired when an element receives keyboard focus.

ONKEYDOWN

public static final int ONKEYDOWN
Fired when the user depresses a key.

ONKEYPRESS

public static final int ONKEYPRESS
Fired when the a character is generated from a keypress (either directly or through auto-repeat).

ONKEYUP

public static final int ONKEYUP
Fired when the user releases a key.

ONLOAD

public static final int ONLOAD
Fired when an element (normally an IMG) finishes loading.

ONLOSECAPTURE

public static final int ONLOSECAPTURE
Fired when an element that has mouse capture loses it.

ONMOUSEDOWN

public static final int ONMOUSEDOWN
Fired when the user depresses a mouse button over an element.

ONMOUSEMOVE

public static final int ONMOUSEMOVE
Fired when the mouse is moved within an element's area.

ONMOUSEOUT

public static final int ONMOUSEOUT
Fired when the mouse is moved out of an element's area.

ONMOUSEOVER

public static final int ONMOUSEOVER
Fired when the mouse is moved into an element's area.

ONMOUSEUP

public static final int ONMOUSEUP
Fired when the user releases a mouse button over an element.

ONMOUSEWHEEL

public static final int ONMOUSEWHEEL
Fired when the user scrolls the mouse wheel over an element.

ONSCROLL

public static final int ONSCROLL
Fired when a scrollable element's scroll offset changes.

UNDEFINED

public static final int UNDEFINED
Error code returned by DOM.getEventXXX methods when the actual integer value is undefined. For example, DOM.getEventKeyCode returns UNDEFINED for some non-keyboard events. For some events, some browsers return undefined while others return data for certain events.

Constructor Detail

Event

protected Event()
Not directly instantiable. Subclasses should also define a protected no-arg constructor to prevent client code from directly instantiating the class.

Method Detail

equals

public boolean equals(Object other)

Parameters

other

hashCode

public int hashCode()

toString

public String toString()