Class zwt.event.KeyboardEvent
Extends
zwt.event.UIEvent.
A keyboard event object is emitted when a keyboard event occurs.
Defined in: KeyboardEvent.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.event.KeyboardEvent(event, zwt_ui_Widget_widget, int_type)
Construct a keyboard event.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.event.KeyboardEvent.KEY_DOWN
Constant used to indicate a key down event
|
<static> |
zwt.event.KeyboardEvent.KEY_PRESS
Constant used to indicate a key press event
|
<static> |
zwt.event.KeyboardEvent.KEY_UP
Constant used to indicate a key up event
|
Method Attributes | Method Name and Description |
---|---|
getKey()
Return the key code.
|
|
isAlt()
Return true if the Alt key was pressed when the event occurs.
|
|
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
|
|
isMeta()
Return true if the Meta key was pressed when the event occurs.
|
|
isShift()
Return true if the Shift key was pressed when the event occurs.
|
- Methods borrowed from class zwt.event.UIEvent:
- getBrowserEvent, getBrowserEventTarget, getReturn, getWidget, setReturn
- Methods borrowed from class zwt.event.Event:
- getType, isCancelBubble, setCancelBubble, touch
Class Detail
zwt.event.KeyboardEvent(event, zwt_ui_Widget_widget, int_type)
Construct a keyboard event.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {Event} event
- The javaScript event object
- {zwt.ui.Widget} zwt_ui_Widget_widget
- The widget linked to the event
- {Integer} int_type
- The event type
Field Detail
<static>
{Integer}
zwt.event.KeyboardEvent.KEY_DOWN
Constant used to indicate a key down event
<static>
{Integer}
zwt.event.KeyboardEvent.KEY_PRESS
Constant used to indicate a key press event
<static>
{Integer}
zwt.event.KeyboardEvent.KEY_UP
Constant used to indicate a key up event
Method Detail
{Integer}
getKey()
Return the key code.
- Returns:
- The key code
{Boolean}
isAlt()
Return true if the Alt key was pressed when the event occurs.
- Returns:
- true if Alt was pressed
{Boolean}
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
- Returns:
- true if Ctrl was pressed
{Boolean}
isMeta()
Return true if the Meta key was pressed when the event occurs.
- Returns:
- true if Meta was pressed
{Boolean}
isShift()
Return true if the Shift key was pressed when the event occurs.
- Returns:
- true if Shift was pressed