|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ibm.techexplorer.util.EventObject | +--ibm.techexplorer.awt.AWTEvent | +--ibm.techexplorer.awt.event.InputEvent | +--ibm.techexplorer.awt.event.KeyEvent
The KeyEvent
indicates that a key has been pressed, released or
typed in a techexplorer instance window. Like the Java 1.1 AWT, techexplorer
provides three types of KeyEvents
, namely KEY_PRESSED, KEY_RELEASED
and KEY_TYPED
. Keys on the keyboard are assigned a unique key code.
KeyEvent
defines a set of common key codes. Note that some keyboards may not
be able to fire all of the key codes or may have keys that do not correspond to
a key code. In the latter case, the key code VK_UNDEFINED
is used to
represent undefined key codes. Hence, key events generated by KEY_PRESSED and
KEY_RELEASED
may not correspond to Unicode characters. To check for
this situation, always use the getKeyCode
method to
obtain the virtual key code when responding to KEY_PRESSED and
KEY_RELEASED
events. KeyTyped
events are generated when the pressed
key contains a character value. In this case, use the getKetChar
method
to obtain the value.
In order for a Java object to receive key event notifications, the Java object
must register a class that implements the
ibm.techexplorer.awt.event.KeyListener
interface. Alternatively,
a key listener could make use of a
ibm.techexplorer.awt.event.KeyAdaptor
class.
Current Restriction: Note that although the techexplorer AWT event model allows a Java applet to handle key events, the generation or modification of techexplorer key events from Java is not permitted in this version.
AWTEvent
,
KeyListener
,
KeyAdaptor
Field Summary | |
static char |
CHAR_UNDEFINED
KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character are without a defined keyChar. |
static int |
KEY_PRESSED
Event identifier indicating the keyboard was pressed. |
static int |
KEY_RELEASED
Event identifier indicating the keyboard was released. |
static int |
KEY_TYPED
Event identifier indicating that a combination of a key press followed by a key release generated a character. |
static int |
VK_0
VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) |
static int |
VK_1
|
static int |
VK_2
|
static int |
VK_3
|
static int |
VK_4
|
static int |
VK_5
|
static int |
VK_6
|
static int |
VK_7
|
static int |
VK_8
|
static int |
VK_9
|
static int |
VK_A
VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) |
static int |
VK_ADD
|
static int |
VK_ALT
|
static int |
VK_B
|
static int |
VK_BACK_QUOTE
|
static int |
VK_BACK_SLASH
|
static int |
VK_BACK_SPACE
|
static int |
VK_C
|
static int |
VK_CANCEL
|
static int |
VK_CAPS_LOCK
|
static int |
VK_CLEAR
|
static int |
VK_CLOSE_BRACKET
|
static int |
VK_COMMA
|
static int |
VK_CONTROL
|
static int |
VK_D
|
static int |
VK_DECIMAL
|
static int |
VK_DELETE
|
static int |
VK_DIVIDE
|
static int |
VK_DOWN
|
static int |
VK_E
|
static int |
VK_END
|
static int |
VK_ENTER
Virtual key codes. |
static int |
VK_EQUALS
|
static int |
VK_ESCAPE
|
static int |
VK_F
|
static int |
VK_F1
|
static int |
VK_F10
|
static int |
VK_F11
|
static int |
VK_F12
|
static int |
VK_F2
|
static int |
VK_F3
|
static int |
VK_F4
|
static int |
VK_F5
|
static int |
VK_F6
|
static int |
VK_F7
|
static int |
VK_F8
|
static int |
VK_F9
|
static int |
VK_FINAL
|
static int |
VK_G
|
static int |
VK_H
|
static int |
VK_HELP
|
static int |
VK_HOME
|
static int |
VK_I
|
static int |
VK_INSERT
|
static int |
VK_J
|
static int |
VK_K
|
static int |
VK_L
|
static int |
VK_LEFT
|
static int |
VK_M
|
static int |
VK_META
|
static int |
VK_MULTIPLY
|
static int |
VK_N
|
static int |
VK_NUM_LOCK
|
static int |
VK_NUMPAD0
|
static int |
VK_NUMPAD1
|
static int |
VK_NUMPAD2
|
static int |
VK_NUMPAD3
|
static int |
VK_NUMPAD4
|
static int |
VK_NUMPAD5
|
static int |
VK_NUMPAD6
|
static int |
VK_NUMPAD7
|
static int |
VK_NUMPAD8
|
static int |
VK_NUMPAD9
|
static int |
VK_O
|
static int |
VK_OPEN_BRACKET
|
static int |
VK_P
|
static int |
VK_PAGE_DOWN
|
static int |
VK_PAGE_UP
|
static int |
VK_PAUSE
|
static int |
VK_PERIOD
|
static int |
VK_PRINTSCREEN
|
static int |
VK_Q
|
static int |
VK_QUOTE
|
static int |
VK_R
|
static int |
VK_RIGHT
|
static int |
VK_S
|
static int |
VK_SCROLL_LOCK
|
static int |
VK_SEMICOLON
|
static int |
VK_SEPARATER
|
static int |
VK_SHIFT
|
static int |
VK_SLASH
|
static int |
VK_SPACE
|
static int |
VK_SUBTRACT
|
static int |
VK_T
|
static int |
VK_TAB
|
static int |
VK_U
|
static int |
VK_UNDEFINED
KEY_TYPED events do not have a defined keyCode. |
static int |
VK_UP
|
static int |
VK_V
|
static int |
VK_W
|
static int |
VK_X
|
static int |
VK_Y
|
static int |
VK_Z
|
Fields inherited from class ibm.techexplorer.awt.event.InputEvent |
ALT_MASK,
BUTTON1_MASK,
BUTTON2_MASK,
BUTTON3_MASK,
CTRL_MASK,
META_MASK,
modifiers,
SHIFT_MASK |
Fields inherited from class ibm.techexplorer.awt.AWTEvent |
FOCUS_EVENT_MASK,
KEY_EVENT_MASK,
MOUSE_EVENT_MASK,
MOUSE_MOTION_EVENT_MASK |
Fields inherited from class ibm.techexplorer.util.EventObject |
documentName,
id,
listenerClass,
objectName,
source |
Constructor Summary | |
KeyEvent(java.lang.Object source,
java.lang.String documentName,
java.lang.String listenerClass,
java.lang.String objectName,
int id,
int modifiers,
int keyCode,
char keyChar)
Constructs a KeyEvent object with the specified techexplorer source instance, document source identifier, listener class, document object name, event type, modifiers, key code and character code. |
Method Summary | |
char |
getKeyChar()
Retrieve the character associated with the key in this event. |
int |
getKeyCode()
Retrieve the integer key code associated with the key in this event. |
Methods inherited from class ibm.techexplorer.awt.event.InputEvent |
getModifiers,
isAltDown,
isControlDown,
isShiftDown |
Methods inherited from class ibm.techexplorer.util.EventObject |
getDocumentName,
getID,
getListenerClass,
getObjectName,
getSource |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int KEY_TYPED
public static final int KEY_PRESSED
public static final int KEY_RELEASED
public static final int VK_ENTER
public static final int VK_BACK_SPACE
public static final int VK_TAB
public static final int VK_CANCEL
public static final int VK_CLEAR
public static final int VK_SHIFT
public static final int VK_CONTROL
public static final int VK_ALT
public static final int VK_PAUSE
public static final int VK_CAPS_LOCK
public static final int VK_ESCAPE
public static final int VK_SPACE
public static final int VK_PAGE_UP
public static final int VK_PAGE_DOWN
public static final int VK_END
public static final int VK_HOME
public static final int VK_LEFT
public static final int VK_UP
public static final int VK_RIGHT
public static final int VK_DOWN
public static final int VK_COMMA
public static final int VK_PERIOD
public static final int VK_SLASH
public static final int VK_0
public static final int VK_1
public static final int VK_2
public static final int VK_3
public static final int VK_4
public static final int VK_5
public static final int VK_6
public static final int VK_7
public static final int VK_8
public static final int VK_9
public static final int VK_SEMICOLON
public static final int VK_EQUALS
public static final int VK_A
public static final int VK_B
public static final int VK_C
public static final int VK_D
public static final int VK_E
public static final int VK_F
public static final int VK_G
public static final int VK_H
public static final int VK_I
public static final int VK_J
public static final int VK_K
public static final int VK_L
public static final int VK_M
public static final int VK_N
public static final int VK_O
public static final int VK_P
public static final int VK_Q
public static final int VK_R
public static final int VK_S
public static final int VK_T
public static final int VK_U
public static final int VK_V
public static final int VK_W
public static final int VK_X
public static final int VK_Y
public static final int VK_Z
public static final int VK_OPEN_BRACKET
public static final int VK_BACK_SLASH
public static final int VK_CLOSE_BRACKET
public static final int VK_NUMPAD0
public static final int VK_NUMPAD1
public static final int VK_NUMPAD2
public static final int VK_NUMPAD3
public static final int VK_NUMPAD4
public static final int VK_NUMPAD5
public static final int VK_NUMPAD6
public static final int VK_NUMPAD7
public static final int VK_NUMPAD8
public static final int VK_NUMPAD9
public static final int VK_MULTIPLY
public static final int VK_ADD
public static final int VK_SEPARATER
public static final int VK_SUBTRACT
public static final int VK_DECIMAL
public static final int VK_DIVIDE
public static final int VK_F1
public static final int VK_F2
public static final int VK_F3
public static final int VK_F4
public static final int VK_F5
public static final int VK_F6
public static final int VK_F7
public static final int VK_F8
public static final int VK_F9
public static final int VK_F10
public static final int VK_F11
public static final int VK_F12
public static final int VK_DELETE
public static final int VK_NUM_LOCK
public static final int VK_SCROLL_LOCK
public static final int VK_PRINTSCREEN
public static final int VK_INSERT
public static final int VK_HELP
public static final int VK_META
public static final int VK_BACK_QUOTE
public static final int VK_QUOTE
public static final int VK_FINAL
public static final int VK_UNDEFINED
public static final char CHAR_UNDEFINED
Constructor Detail |
public KeyEvent(java.lang.Object source, java.lang.String documentName, java.lang.String listenerClass, java.lang.String objectName, int id, int modifiers, int keyCode, char keyChar)
source
- The object where the event originated.documentName
- The name of the document that triggered the event.listenerClass
- The category of listeners that will receive notification of this event.objectName
- The name of the document object that triggered the event.id
- Event identifier (KEY_PRESSED, KEY_RELEASED and KEY_TYPED
)keyCode
- The integer key code associated with the key.keyChar
- The character associated with the key.Method Detail |
public char getKeyChar()
public int getKeyCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |