KeyEvent Members

KeyEvent Members

Class Overview | This Package | All Packages

Fields
Name Description
CHAR_UNDEFINED KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character do not have a defined keyChar.
KEY_FIRST Marks the first integer id for the range of key event ids.
KEY_LAST Marks the last integer id for the range of key event ids.
KEY_PRESSED The key pressed event type.
KEY_RELEASED The key released event type.
KEY_TYPED The key typed event type.
VK_0 VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
VK_1  
VK_2  
VK_3  
VK_4  
VK_5  
VK_6  
VK_7  
VK_8  
VK_9  
VK_A VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
VK_ACCEPT  
VK_ADD  
VK_ALT  
VK_B  
VK_BACK_QUOTE  
VK_BACK_SLASH  
VK_BACK_SPACE  
VK_C  
VK_CANCEL  
VK_CAPS_LOCK  
VK_CLEAR  
VK_CLOSE_BRACKET  
VK_COMMA  
VK_CONTROL  
VK_CONVERT  
VK_D  
VK_DECIMAL  
VK_DELETE  
VK_DIVIDE  
VK_DOWN  
VK_E  
VK_END  
VK_ENTER Virtual key codes.
VK_EQUALS  
VK_ESCAPE  
VK_F  
VK_F1  
VK_F10  
VK_F11  
VK_F12  
VK_F2  
VK_F3  
VK_F4  
VK_F5  
VK_F6  
VK_F7  
VK_F8  
VK_F9  
VK_FINAL for Asian Keyboard
VK_G  
VK_H  
VK_HELP  
VK_HOME  
VK_I  
VK_INSERT  
VK_J  
VK_K  
VK_KANA  
VK_KANJI  
VK_L  
VK_LEFT  
VK_M  
VK_META  
VK_MODECHANGE  
VK_MULTIPLY  
VK_N  
VK_NONCONVERT  
VK_NUM_LOCK  
VK_NUMPAD0  
VK_NUMPAD1  
VK_NUMPAD2  
VK_NUMPAD3  
VK_NUMPAD4  
VK_NUMPAD5  
VK_NUMPAD6  
VK_NUMPAD7  
VK_NUMPAD8  
VK_NUMPAD9  
VK_O  
VK_OPEN_BRACKET  
VK_P  
VK_PAGE_DOWN  
VK_PAGE_UP  
VK_PAUSE  
VK_PERIOD  
VK_PRINTSCREEN  
VK_Q  
VK_QUOTE  
VK_R  
VK_RIGHT  
VK_S  
VK_SCROLL_LOCK  
VK_SEMICOLON  
VK_SEPARATER  
VK_SHIFT  
VK_SLASH  
VK_SPACE  
VK_SUBTRACT  
VK_T  
VK_TAB  
VK_U  
VK_UNDEFINED KEY_TYPED events do not have a defined keyCode.
VK_UP  
VK_V  
VK_W  
VK_X  
VK_Y  
VK_Z  

Constructors
Name Description
KeyEvent(Component, int, long, int, int)  
KeyEvent(Component, int, long, int, int, char) Constructs a KeyEvent object with the specified source component, type, modifiers, and key.

Methods
Name Description
getKeyChar() Returns the character associated with the key in this event.
getKeyCode() Returns the integer key-code associated with the key in this event.
getKeyModifiersText(int) Returns a String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".
getKeyText(int) Returns a String describing the keyCode, such as "HOME", "F1" or "A".
isActionKey() Returns whether or not the key in this event is an "action" key, as defined in Event.java.
paramString()  
setKeyChar(char)  
setKeyCode(int)  
setModifiers(int)