Java java.awt.event KeyEvent fields, constructors, methods, implement or subclass

Example usage for Java java.awt.event KeyEvent fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt.event KeyEvent.

The text is from its open source code.

Field

intKEY_TYPED
The "key typed" event.
intKEY_PRESSED
The "key pressed" event.
intKEY_RELEASED
The "key released" event.
intVK_ENTER
Constant for the ENTER virtual key.
intVK_BACK_SPACE
Constant for the BACK_SPACE virtual key.
intVK_TAB
Constant for the TAB virtual key.
intVK_CANCEL
Constant for the CANCEL virtual key.
intVK_CLEAR
Constant for the CLEAR virtual key.
intVK_SHIFT
Constant for the SHIFT virtual key.
intVK_CONTROL
Constant for the CONTROL virtual key.
intVK_ALT
Constant for the ALT virtual key.
intVK_PAUSE
Constant for the PAUSE virtual key.
intVK_CAPS_LOCK
Constant for the CAPS_LOCK virtual key.
intVK_ESCAPE
Constant for the ESCAPE virtual key.
intVK_SPACE
Constant for the SPACE virtual key.
intVK_PAGE_UP
Constant for the PAGE_UP virtual key.
intVK_PAGE_DOWN
Constant for the PAGE_DOWN virtual key.
intVK_END
Constant for the END virtual key.
intVK_HOME
Constant for the HOME virtual key.
intVK_LEFT
Constant for the non-numpad left arrow key.
intVK_UP
Constant for the non-numpad up arrow key.
intVK_RIGHT
Constant for the non-numpad right arrow key.
intVK_DOWN
Constant for the non-numpad down arrow key.
intVK_COMMA
Constant for the comma key, ","
intVK_MINUS
Constant for the minus key, "-"
intVK_PERIOD
Constant for the period key, "."
intVK_SLASH
Constant for the forward slash key, "/"
intVK_0
Constant for the "0" key.
intVK_1
Constant for the "1" key.
intVK_2
Constant for the "2" key.
intVK_3
Constant for the "3" key.
intVK_4
Constant for the "4" key.
intVK_5
Constant for the "5" key.
intVK_6
Constant for the "6" key.
intVK_7
Constant for the "7" key.
intVK_8
Constant for the "8" key.
intVK_9
Constant for the "9" key.
intVK_SEMICOLON
Constant for the semicolon key, ";"
intVK_EQUALS
Constant for the equals key, "="
intVK_A
Constant for the "A" key.
intVK_B
Constant for the "B" key.
intVK_C
Constant for the "C" key.
intVK_D
Constant for the "D" key.
intVK_E
Constant for the "E" key.
intVK_F
Constant for the "F" key.
intVK_G
Constant for the "G" key.
intVK_H
Constant for the "H" key.
intVK_I
Constant for the "I" key.
intVK_J
Constant for the "J" key.
intVK_K
Constant for the "K" key.
intVK_L
Constant for the "L" key.
intVK_M
Constant for the "M" key.
intVK_N
Constant for the "N" key.
intVK_O
Constant for the "O" key.
intVK_P
Constant for the "P" key.
intVK_Q
Constant for the "Q" key.
intVK_R
Constant for the "R" key.
intVK_S
Constant for the "S" key.
intVK_T
Constant for the "T" key.
intVK_U
Constant for the "U" key.
intVK_V
Constant for the "V" key.
intVK_W
Constant for the "W" key.
intVK_X
Constant for the "X" key.
intVK_Y
Constant for the "Y" key.
intVK_Z
Constant for the "Z" key.
intVK_OPEN_BRACKET
Constant for the open bracket key, "["
intVK_BACK_SLASH
Constant for the back slash key, "\"
intVK_CLOSE_BRACKET
Constant for the close bracket key, "]"
intVK_NUMPAD0
Constant for the number pad "0" key.
intVK_NUMPAD1
Constant for the number pad "1" key.
intVK_NUMPAD2
Constant for the number pad "2" key.
intVK_NUMPAD3
Constant for the number pad "3" key.
intVK_NUMPAD4
Constant for the number pad "4" key.
intVK_NUMPAD5
Constant for the number pad "5" key.
intVK_NUMPAD6
Constant for the number pad "6" key.
intVK_NUMPAD7
Constant for the number pad "7" key.
intVK_NUMPAD8
Constant for the number pad "8" key.
intVK_NUMPAD9
Constant for the number pad "9" key.
intVK_MULTIPLY
Constant for the number pad multiply key.
intVK_ADD
Constant for the number pad add key.
intVK_SEPARATER
This constant is obsolete, and is included only for backwards compatibility.
intVK_SEPARATOR
Constant for the Numpad Separator key.
intVK_SUBTRACT
Constant for the number pad subtract key.
intVK_DECIMAL
Constant for the number pad decimal point key.
intVK_DIVIDE
Constant for the number pad divide key.
intVK_DELETE
Constant for the delete key.
intVK_NUM_LOCK
Constant for the NUM_LOCK key.
intVK_SCROLL_LOCK
Constant for the SCROLL_LOCK key.
intVK_F1
Constant for the F1 function key.
intVK_F2
Constant for the F2 function key.
intVK_F3
Constant for the F3 function key.
intVK_F4
Constant for the F4 function key.
intVK_F5
Constant for the F5 function key.
intVK_F6
Constant for the F6 function key.
intVK_F7
Constant for the F7 function key.
intVK_F8
Constant for the F8 function key.
intVK_F9
Constant for the F9 function key.
intVK_F10
Constant for the F10 function key.
intVK_F11
Constant for the F11 function key.
intVK_F12
Constant for the F12 function key.
intVK_F13
Constant for the F13 function key.
intVK_F14
Constant for the F14 function key.
intVK_F15
Constant for the F15 function key.
intVK_F16
Constant for the F16 function key.
intVK_F17
Constant for the F17 function key.
intVK_F18
Constant for the F18 function key.
intVK_F19
Constant for the F19 function key.
intVK_F20
Constant for the F20 function key.
intVK_F21
Constant for the F21 function key.
intVK_F22
Constant for the F22 function key.
intVK_F23
Constant for the F23 function key.
intVK_F24
Constant for the F24 function key.
intVK_PRINTSCREEN
Constant for the PRINTSCREEN key.
intVK_INSERT
Constant for the INSERT key.
intVK_HELP
Constant for the HELP key.
intVK_META
Constant for the META key.
intVK_BACK_QUOTE
Constant for the BACK_QUOTE key.
intVK_QUOTE
Constant for the QUOTE key.
intVK_KP_UP
Constant for the numeric keypad up arrow key.
intVK_KP_DOWN
Constant for the numeric keypad down arrow key.
intVK_KP_LEFT
Constant for the numeric keypad left arrow key.
intVK_KP_RIGHT
Constant for the numeric keypad right arrow key.
intVK_DEAD_GRAVE
intVK_DEAD_ACUTE
intVK_DEAD_CIRCUMFLEX
intVK_DEAD_TILDE
intVK_DEAD_MACRON
intVK_DEAD_BREVE
intVK_DEAD_ABOVEDOT
intVK_DEAD_DIAERESIS
intVK_DEAD_ABOVERING
intVK_DEAD_DOUBLEACUTE
intVK_DEAD_CARON
intVK_DEAD_CEDILLA
intVK_DEAD_OGONEK
intVK_DEAD_IOTA
intVK_DEAD_VOICED_SOUND
intVK_DEAD_SEMIVOICED_SOUND
intVK_AMPERSAND
intVK_ASTERISK
intVK_QUOTEDBL
intVK_LESS
intVK_GREATER
intVK_BRACELEFT
intVK_BRACERIGHT
intVK_AT
Constant for the "@" key.
intVK_COLON
Constant for the ":" key.
intVK_CIRCUMFLEX
Constant for the "^" key.
intVK_DOLLAR
Constant for the "$" key.
intVK_EURO_SIGN
Constant for the Euro currency sign key.
intVK_EXCLAMATION_MARK
Constant for the "!"
intVK_INVERTED_EXCLAMATION_MARK
Constant for the inverted exclamation mark key.
intVK_LEFT_PARENTHESIS
Constant for the "(" key.
intVK_NUMBER_SIGN
Constant for the "#" key.
intVK_PLUS
Constant for the "+" key.
intVK_RIGHT_PARENTHESIS
Constant for the ")" key.
intVK_UNDERSCORE
Constant for the "_" key.
intVK_WINDOWS
Constant for the Microsoft Windows "Windows" key.
intVK_CONTEXT_MENU
Constant for the Microsoft Windows Context Menu key.
intVK_FINAL
Constant for the FINAL key.
intVK_CONVERT
Constant for the Convert function key.
intVK_NONCONVERT
Constant for the Don't Convert function key.
intVK_ACCEPT
Constant for the Accept or Commit function key.
intVK_MODECHANGE
Constant for the MODECHANGE key.
intVK_KANA
Constant for the KANA lock key.
intVK_KANJI
Constant for KANJI.
intVK_ALPHANUMERIC
Constant for the Alphanumeric function key.
intVK_KATAKANA
Constant for the Katakana function key.
intVK_HIRAGANA
Constant for the Hiragana function key.
intVK_FULL_WIDTH
Constant for the Full-Width Characters function key.
intVK_HALF_WIDTH
Constant for the Half-Width Characters function key.
intVK_ROMAN_CHARACTERS
Constant for the Roman Characters function key.
intVK_ALL_CANDIDATES
Constant for the All Candidates function key.
intVK_PREVIOUS_CANDIDATE
Constant for the Previous Candidate function key.
intVK_CODE_INPUT
Constant for the Code Input function key.
intVK_JAPANESE_KATAKANA
Constant for the Japanese-Katakana function key.
intVK_JAPANESE_HIRAGANA
Constant for the Japanese-Hiragana function key.
intVK_JAPANESE_ROMAN
Constant for the Japanese-Roman function key.
intVK_KANA_LOCK
Constant for the locking Kana function key.
intVK_INPUT_METHOD_ON_OFF
Constant for the input method on/off key.
intVK_CUT
intVK_COPY
intVK_PASTE
intVK_UNDO
intVK_AGAIN
intVK_FIND
intVK_PROPS
intVK_STOP
intVK_COMPOSE
Constant for the Compose function key.
intVK_ALT_GRAPH
Constant for the AltGraph function key.
intVK_UNDEFINED
This value is used to indicate that the keyCode is unknown.
charCHAR_UNDEFINED
KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character use this for the keyChar value.
intKEY_LOCATION_UNKNOWN
A constant indicating that the keyLocation is indeterminate or not relevant.
intKEY_LOCATION_STANDARD
A constant indicating that the key pressed or released is not distinguished as the left or right version of a key, and did not originate on the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad).
intKEY_LOCATION_LEFT
A constant indicating that the key pressed or released is in the left key location (there is more than one possible location for this key).
intKEY_LOCATION_RIGHT
A constant indicating that the key pressed or released is in the right key location (there is more than one possible location for this key).
intKEY_LOCATION_NUMPAD
A constant indicating that the key event originated on the numeric keypad or with a virtual key corresponding to the numeric keypad.

Constructor

Method

voidconsume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.
ClassgetClass()
Returns the runtime class of this Object .
ComponentgetComponent()
Returns the originator of the event.
intgetExtendedKeyCode()
Returns an extended key code for the event.
intgetExtendedKeyCodeForChar(int c)
Returns an extended key code for a unicode character.
intgetID()
Returns the event type.
chargetKeyChar()
Returns the character associated with the key in this event.
intgetKeyCode()
Returns the integer keyCode associated with the key in this event.
intgetKeyLocation()
Returns the location of the key that originated this key event.
StringgetKeyModifiersText(int modifiers)
Returns a String describing the modifier key(s), such as "Shift", or "Ctrl+Shift".
StringgetKeyText(int keyCode)
Returns a String describing the keyCode, such as "HOME", "F1" or "A".
intgetModifiers()
Returns the modifier mask for this event.
intgetModifiersEx()
Returns the extended modifier mask for this event.
ObjectgetSource()
The object on which the Event initially occurred.
longgetWhen()
Returns the difference in milliseconds between the timestamp of when this event occurred and midnight, January 1, 1970 UTC.
booleanisActionKey()
Returns whether the key in this event is an "action" key.
booleanisAltDown()
Returns whether or not the Alt modifier is down on this event.
booleanisAltGraphDown()
Returns whether or not the AltGraph modifier is down on this event.
booleanisConsumed()
Returns whether or not this event has been consumed.
booleanisControlDown()
Returns whether or not the Control modifier is down on this event.
booleanisMetaDown()
Returns whether or not the Meta modifier is down on this event.
booleanisShiftDown()
Returns whether or not the Shift modifier is down on this event.
voidsetKeyChar(char keyChar)
Set the keyChar value to indicate a logical character.
voidsetSource(Object newSource)
Retargets an event to a new source.
StringtoString()
Returns a String representation of this object.