OverviewSingleDeprecated

jsx3.gui

class Event

Object
->jsx3.lang.Object
  ->jsx3.gui.Event

class Event
extends jsx3.lang.Object
Native browser event wrapper.

Since:

3.1

Field Summary
static String
BEFOREUNLOAD
The browser native event type beforeunload.
static String
BLUR
The browser native event type blur.
static String
CHANGE
The browser native event type change.
static String
CLICK
The browser native event type click.
static String
DOUBLECLICK
The browser native event type dblclick.
static String
ERROR
The browser native event type error.
static String
FOCUS
The browser native event type focus.
static String
KEYDOWN
The browser native event type keydown.
static String
KEYPRESS
The browser native event type keypress.
static String
KEYUP
The browser native event type keyup.
static int
KEY_0
The browser native key code for the 0 key.
static int
KEY_9
The browser native key code for the 9 key.
static int
KEY_A
The browser native key code for the A key.
static int
KEY_ALT
The browser native key code for the Alt key.
static int
KEY_ARROW_DOWN
The browser native key code for the down arrow key.
static int
KEY_ARROW_LEFT
The browser native key code for the left arrow key.
static int
KEY_ARROW_RIGHT
The browser native key code for the right arrow key.
static int
KEY_ARROW_UP
The browser native key code for the up arrow key.
static int
KEY_BACKSPACE
The browser native key code for the Backspace key.
static int
KEY_CONTROL
The browser native key code for the Ctrl key.
static int
KEY_DELETE
The browser native key code for the Delete key.
static int
KEY_END
The browser native key code for the End key.
static int
KEY_ENTER
The browser native key code for the Enter key.
static int
KEY_ESCAPE
The browser native key code for the Esc key.
static int
KEY_F1
The browser native key code for the F1 key.
static int
KEY_F15
The browser native key code for the F15 key.
static int
KEY_HOME
The browser native key code for the Home key.
static int
KEY_INSERT
The browser native key code for the Insert key.
static int
KEY_META
The browser native key code for the Meta key.
static int
KEY_NP0
The browser native key code for the number pad 0 key.
static int
KEY_NP9
The browser native key code for the number pad 9 key.
static int
KEY_NPADD
The browser native key code for the number pad addition (+) key.
static int
KEY_NPDEC
The browser native key code for the number pad decimal (.
static int
KEY_NPDIV
The browser native key code for the number pad division (/) key.
static int
KEY_NPMUL
The browser native key code for the number pad multiply (*) key.
static int
KEY_NPSUB
The browser native key code for the number pad subtract (-) key.
static int
KEY_PAGE_DOWN
The browser native key code for the Page Down key.
static int
KEY_PAGE_UP
The browser native key code for the Page Up key.
static int
KEY_SHIFT
The browser native key code for the Shift key.
static int
KEY_SPACE
The browser native key code for the space bar key.
static int
KEY_TAB
The browser native key code for the Tab key.
static int
KEY_Z
The browser native key code for the Z key.
static String
LOAD
The browser native event type load.
static String
MOUSEDOWN
The browser native event type mousedown.
static String
MOUSEMOVE
The browser native event type mousemove.
static String
MOUSEOUT
The browser native event type mouseout.
static String
MOUSEOVER
The browser native event type mouseover.
static String
MOUSEUP
The browser native event type mouseup.
static String
MOUSEWHEEL
The browser native event type mousewheel.
static String
RESIZE
The browser native event type resize.
static String
UNLOAD
The browser native event type unload.
Method Summary
boolean
Returns true if the alt key was pressed.
boolean
Returns true if the backspace key was pressed.
int
Returns integer designating the mouse button clicked/moused-down/moused-up; 1 (left), 2 (right), and as supported.
void
Cancels event bubbling for the event.
void
Cancels the key from firing by setting the keyCode to 0 (zero) for the event.
void
Cancels the return value for the event.
int
Returns the clientX property for the event (where it occurred on-screen).
int
Returns the clientY property for the event (where it occurred on-screen).
boolean
Returns true the ctrl key was pressed.
boolean
Returns true if the delete key was pressed.
boolean
Returns true if the down-arrow key was pressed.
boolean
Returns true if the end key was pressed.
boolean
Returns true if the enter key was pressed.
boolean
Returns true if the escape key was pressed.
boolean
Deprecated.
HTMLElement
Returns handle to the HTML element that was moused away from (onmouseout).
int
Returns the actual position in the browser from the left edge for where the event occurred.
int
Returns the actual position in the browser from the top edge for where the event occurred.
String
Returns the type of event, e.g.
boolean
Returns true if the home key was pressed.
boolean
Returns true if the insert key was pressed.
boolean
Whether one of the four arrow keys was pressed.
boolean
Whether one of the 15 function keys was pressed.
int
Returns integer representing the key code of the key just pressed/keyed-down.
boolean
Returns true if the left-arrow key was pressed.
boolean
Returns true if the left-mouse-button was clicked.
boolean
Returns true if the page-down key was pressed.
boolean
Returns true if the page-up key was pressed.
boolean
Returns true if the right-arrow key was pressed
boolean
Returns true if the right-mouse-button was clicked.
void
setReturn(strReturn : String)
Sets the the return value for the event.
boolean
Returns true if the shift key was pressed.
boolean
Returns true if the space bar was pressed.
HTMLElement
Returns handle to the HTML element acted upon (click, mousedown, etc).
static void
subscribe(strEventId : String, objHandler : ?, objFunction : ?)
Subscribes an event handler to events of type strEventId that bubble all the way up to the browser window.
boolean
Returns true if the tab key was pressed.
HTMLElement
Returns handle to the HTML element that was moused over (onmouseover).
static void
unsubscribe(strEventId : String, objHandler : ?)
Unsubscribes an event handler from events of type strEventId that bubble all the way up to the browser window.
static void
unsubscribeAll(strEventId : String)
Unsubscribes all event handlers from a events of type strEventId that bubble all the way up to the browser window.
boolean
Returns true if the up-arrow key was pressed.
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf, toString
Field Detail

BEFOREUNLOAD

static final String BEFOREUNLOAD
The browser native event type beforeunload.

BLUR

static final String BLUR
The browser native event type blur.

CHANGE

static final String CHANGE
The browser native event type change.

CLICK

static final String CLICK
The browser native event type click.

DOUBLECLICK

static final String DOUBLECLICK
The browser native event type dblclick.

ERROR

static final String ERROR
The browser native event type error.

FOCUS

static final String FOCUS
The browser native event type focus.

KEYDOWN

static final String KEYDOWN
The browser native event type keydown.

KEYPRESS

static final String KEYPRESS
The browser native event type keypress.

KEYUP

static final String KEYUP
The browser native event type keyup.

KEY_0

static final int KEY_0
The browser native key code for the 0 key.

KEY_9

static final int KEY_9
The browser native key code for the 9 key.

KEY_A

static final int KEY_A
The browser native key code for the A key.

KEY_ALT

static final int KEY_ALT
The browser native key code for the Alt key.

KEY_ARROW_DOWN

static final int KEY_ARROW_DOWN
The browser native key code for the down arrow key.

KEY_ARROW_LEFT

static final int KEY_ARROW_LEFT
The browser native key code for the left arrow key.

KEY_ARROW_RIGHT

static final int KEY_ARROW_RIGHT
The browser native key code for the right arrow key.

KEY_ARROW_UP

static final int KEY_ARROW_UP
The browser native key code for the up arrow key.

KEY_BACKSPACE

static final int KEY_BACKSPACE
The browser native key code for the Backspace key.

KEY_CONTROL

static final int KEY_CONTROL
The browser native key code for the Ctrl key.

KEY_DELETE

static final int KEY_DELETE
The browser native key code for the Delete key.

KEY_END

static final int KEY_END
The browser native key code for the End key.

KEY_ENTER

static final int KEY_ENTER
The browser native key code for the Enter key.

KEY_ESCAPE

static final int KEY_ESCAPE
The browser native key code for the Esc key.

KEY_F1

static final int KEY_F1
The browser native key code for the F1 key.

KEY_F15

static final int KEY_F15
The browser native key code for the F15 key.

KEY_HOME

static final int KEY_HOME
The browser native key code for the Home key.

KEY_INSERT

static final int KEY_INSERT
The browser native key code for the Insert key.

KEY_META

static final int KEY_META
The browser native key code for the Meta key.

KEY_NP0

static final int KEY_NP0
The browser native key code for the number pad 0 key.

KEY_NP9

static final int KEY_NP9
The browser native key code for the number pad 9 key.

KEY_NPADD

static final int KEY_NPADD
The browser native key code for the number pad addition (+) key.

KEY_NPDEC

static final int KEY_NPDEC
The browser native key code for the number pad decimal (.) key.

KEY_NPDIV

static final int KEY_NPDIV
The browser native key code for the number pad division (/) key.

KEY_NPMUL

static final int KEY_NPMUL
The browser native key code for the number pad multiply (*) key.

KEY_NPSUB

static final int KEY_NPSUB
The browser native key code for the number pad subtract (-) key.

KEY_PAGE_DOWN

static final int KEY_PAGE_DOWN
The browser native key code for the Page Down key.

KEY_PAGE_UP

static final int KEY_PAGE_UP
The browser native key code for the Page Up key.

KEY_SHIFT

static final int KEY_SHIFT
The browser native key code for the Shift key.

KEY_SPACE

static final int KEY_SPACE
The browser native key code for the space bar key.

KEY_TAB

static final int KEY_TAB
The browser native key code for the Tab key.

KEY_Z

static final int KEY_Z
The browser native key code for the Z key.

LOAD

static final String LOAD
The browser native event type load.

MOUSEDOWN

static final String MOUSEDOWN
The browser native event type mousedown.

MOUSEMOVE

static final String MOUSEMOVE
The browser native event type mousemove.

MOUSEOUT

static final String MOUSEOUT
The browser native event type mouseout.

MOUSEOVER

static final String MOUSEOVER
The browser native event type mouseover.

MOUSEUP

static final String MOUSEUP
The browser native event type mouseup.

MOUSEWHEEL

static final String MOUSEWHEEL
The browser native event type mousewheel.

RESIZE

static final String RESIZE
The browser native event type resize.

UNLOAD

static final String UNLOAD
The browser native event type unload.
Method Detail

altKey

boolean altKey()
Returns true if the alt key was pressed.

Returns:

 

backspaceKey

boolean backspaceKey()
Returns true if the backspace key was pressed.

Returns:

 

button

int button()
Returns integer designating the mouse button clicked/moused-down/moused-up; 1 (left), 2 (right), and as supported.

Returns:

 

cancelBubble

void cancelBubble()
Cancels event bubbling for the event.

cancelKey

void cancelKey()
Cancels the key from firing by setting the keyCode to 0 (zero) for the event.

cancelReturn

void cancelReturn()
Cancels the return value for the event.

clientX

int clientX()
Returns the clientX property for the event (where it occurred on-screen).

Returns:

pixel position  

clientY

int clientY()
Returns the clientY property for the event (where it occurred on-screen).

Returns:

pixel position  

ctrlKey

boolean ctrlKey()
Returns true the ctrl key was pressed.

Returns:

 

deleteKey

boolean deleteKey()
Returns true if the delete key was pressed.

Returns:

 

downArrow

boolean downArrow()
Returns true if the down-arrow key was pressed.

Returns:

 

endKey

boolean endKey()
Returns true if the end key was pressed.

Returns:

 

enterKey

boolean enterKey()
Returns true if the enter key was pressed.

Returns:

 

escapeKey

boolean escapeKey()
Returns true if the escape key was pressed.

Returns:

 

exists

boolean exists()
Deprecated.
Returns true if the native event object is present (if an event of any type actualy occurred).

Returns:

 

fromElement

HTMLElement fromElement()
Returns handle to the HTML element that was moused away from (onmouseout).

Returns:

HTML object  

getTrueX

int getTrueX()
Returns the actual position in the browser from the left edge for where the event occurred.

Returns:

pixel position  

getTrueY

int getTrueY()
Returns the actual position in the browser from the top edge for where the event occurred.

Returns:

pixel position  

getType

String getType()
Returns the type of event, e.g. mousedown, click, etc.

Returns:

event type  

homeKey

boolean homeKey()
Returns true if the home key was pressed.

Returns:

 

insertKey

boolean insertKey()
Returns true if the insert key was pressed.

Returns:

 

isArrowKey

boolean isArrowKey()
Whether one of the four arrow keys was pressed.

Returns:

 

isFunctionKey

boolean isFunctionKey()
Whether one of the 15 function keys was pressed.

Returns:

 

keyCode

int keyCode()
Returns integer representing the key code of the key just pressed/keyed-down.

Returns:

keycode  

leftArrow

boolean leftArrow()
Returns true if the left-arrow key was pressed.

Returns:

 

leftButton

boolean leftButton()
Returns true if the left-mouse-button was clicked.

Returns:

 

pageDownKey

boolean pageDownKey()
Returns true if the page-down key was pressed.

Returns:

 

pageUpKey

boolean pageUpKey()
Returns true if the page-up key was pressed.

Returns:

 

rightArrow

boolean rightArrow()
Returns true if the right-arrow key was pressed

Returns:

 

rightButton

boolean rightButton()
Returns true if the right-mouse-button was clicked.

Returns:

 

setReturn

void setReturn(strReturn : String)
Sets the the return value for the event.

Parameters:

strReturnstring message to set on the returnValue for the event

shiftKey

boolean shiftKey()
Returns true if the shift key was pressed.

Returns:

 

spaceKey

boolean spaceKey()
Returns true if the space bar was pressed.

Returns:

 

srcElement

HTMLElement srcElement()
Returns handle to the HTML element acted upon (click, mousedown, etc).

Returns:

HTML object  

subscribe

static void subscribe(strEventId : String, objHandler : ?, objFunction : ?)
Subscribes an event handler to events of type strEventId that bubble all the way up to the browser window.

Parameters:

strEventIdthe event type, e.g. jsx3.gui.Event.CLICK.
objHandler
objFunction

See Also:

jsx3.util.EventDispatcher.subscribe()

tabKey

boolean tabKey()
Returns true if the tab key was pressed.

Returns:

 

toElement

HTMLElement toElement()
Returns handle to the HTML element that was moused over (onmouseover).

Returns:

HTML object  

unsubscribe

static void unsubscribe(strEventId : String, objHandler : ?)
Unsubscribes an event handler from events of type strEventId that bubble all the way up to the browser window.

Parameters:

strEventIdthe event type, e.g. jsx3.gui.Event.CLICK.
objHandler

cancelKey

void cancelKey()
Cancels the key from firing by setting the keyCode to 0 (zero) for the event.

cancelReturn

void cancelReturn()
Cancels the return value for the event.

clientX

int clientX()
Returns the clientX property for the event (where it occurred on-screen).

Returns:

pixel position  

clientY

int clientY()
Returns the clientY property for the event (where it occurred on-screen).

Returns:

pixel position  

ctrlKey

boolean ctrlKey()
Returns true the ctrl key was pressed.

Returns:

 

deleteKey

boolean deleteKey()
Returns true if the delete key was pressed.

Returns:

 

downArrow

boolean downArrow()
Returns true if the down-arrow key was pressed.

Returns:

 

endKey

boolean endKey()
Returns true if the end key was pressed.

Returns:

 

enterKey

boolean enterKey()
Returns true if the enter key was pressed.

Returns:

 

escapeKey

boolean escapeKey()
Returns true if the escape key was pressed.

Returns:

 

exists

boolean exists()
Deprecated.
Returns true if the native event object is present (if an event of any type actualy occurred).

Returns:

 

fromElement

HTMLElement fromElement()
Returns handle to the HTML element that was moused away from (onmouseout).

Returns:

HTML object  

getTrueX

int getTrueX()
Returns the actual position in the browser from the left edge for where the event occurred.

Returns:

pixel position  

getTrueY

int getTrueY()
Returns the actual position in the browser from the top edge for where the event occurred.

Returns:

pixel position  

getType

String getType()
Returns the type of event, e.g. mousedown, click, etc.

Returns:

event type  

homeKey

boolean homeKey()
Returns true if the home key was pressed.

Returns:

 

insertKey

boolean insertKey()
Returns true if the insert key was pressed.

Returns:

 

isArrowKey

boolean isArrowKey()
Whether one of the four arrow keys was pressed.

Returns:

 

isFunctionKey


isFunctionKey

boolean isFunctionKey()
Whether one of the 15 function keys was pressed.

Returns:

 

keyCode

int keyCode()
Returns integer representing the key code of the key just pressed/keyed-down.

Returns:

keycode  

leftArrow

boolean leftArrow()
Returns:
 

keyCode

int keyCode()
Returns integer representing the key code of the key just pressed/keyed-down.

Returns:

keycode  

leftArrow

boolean leftArrow()
Returns true if the left-arrow key was pressed.

Returns:

 

leftButton

boolean leftButton()
Returns true if the left-mouse-button was clicked.

Returns:

 

pageDownKey

boolean pageDownKey()
 

pageDownKey

boolean pageDownKey()
Returns true if the page-down key was pressed.

Returns:

 

pageUpKey

boolean pageUpKey()
Returns true if the page-up key was pressed.

Returns:

 

rightArrow

boolean rightArrow()
Returns true if the right-arrow key was pressed

Returns:

 

rightButton

boolean rightButton()
Returns true if the right-mouse-button was clicked.

Returns:

 

setReturn

void setReturn(strReturn : String)
Sets the the return value for the event.

Parameters:

strReturnstring message to set on the returnValue for the event

shiftKey

boolean shiftKey()
Returns true if the shift key was pressed.

Returns:

 

spaceKey

boolean spaceKey()
Returns true if the space bar was pressed.

Returns:

 

srcElement

HTMLElement srcElement()
Returns handle to the HTML element acted upon (click, mousedown, etc).

Returns:

HTML object  

subscribe

static void subscribe(strEventId : String, objHandler : ?, objFunction : ?)
Subscribes an event handler to events of type strEventId that bubble all the way up to the browser window.

Parameters:

strEventIdthe event type, e.g. jsx3.gui.Event.CLICK.
objHandler
objFunction

See Also:


tabKey

boolean tabKey()
Returns true if the tab key was pressed.

Returns:

 

toElement

HTMLElement toElement()
Returns handle to the HTML element that was moused over (onmouseover).

Returns:

HTML object  

unsubscribe

static void unsubscribe(strEventId : String, objHandler : ?)
Unsubscribes an event handler from events of type strEventId that bubble all the way up to the browser window.

Parameters:

strEventIdthe event type, e.g. jsx3.gui.Event.CLICK.
objHandler

See Also:


unsubscribeAll

static void unsubscribeAll(strEventId : String)
Unsubscribes all event handlers from a events of type strEventId that bubble all the way up to the browser window.

Parameters:

strEventIdthe event type, e.g. jsx3.gui.Event.CLICK.

See Also:


upArrow

boolean upArrow()
Returns true if the up-arrow key was pressed.

Returns: