com.jogamp.newt.event
Class KeyEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jogamp.newt.event.NEWTEvent
          extended by com.jogamp.newt.event.InputEvent
              extended by com.jogamp.newt.event.KeyEvent
All Implemented Interfaces:
Serializable

public class KeyEvent
extends InputEvent

Key events are delivered in the following order:

#Event Type Constraints Notes
1EVENT_KEY_PRESSED excluding auto-repeat modifier keys
2EVENT_KEY_RELEASED excluding auto-repeat modifier keys
3EVENT_KEY_TYPED only for printable and non auto-repeat keysDeprecated: Use EVENT_KEY_RELEASED and apply constraints.

In case the native platform does not deliver keyboard events in the above order or skip events, the NEWT driver will reorder and inject synthetic events if required.

Besides regular modifiers like InputEvent.SHIFT_MASK etc., the InputEvent.AUTOREPEAT_MASK bit is added if repetition is detected, following above constraints.

Auto-Repeat shall behave as follow:

    P = pressed, R = released, T = typed
    0 = normal, 1 = auto-repeat

    P(0), [ R(1), P(1), R(1), ..], R(0) T(0)    
 
The idea is if you mask out auto-repeat in your event listener or catch typed events only, you just get one long pressed P/R/T triple for printable keys. Action keys would produce one long pressed P/R tuple in case you mask out auto-repeat .

Action keys will produce pressed and released events including auto-repeat.

Printable keys will produce pressed, released and typed events, the latter is excluded for auto-repeat events.

Modifier keys will produce pressed and released events excluding auto-repeat. They will also influence subsequent event's modifier bits while pressed.

See Also:
Serialized Form

Field Summary
static short EVENT_KEY_PRESSED
          A key has been pressed, excluding auto-repeat modifier keys.
static short EVENT_KEY_RELEASED
          A key has been released, excluding auto-repeat modifier keys.
static short EVENT_KEY_TYPED
          Deprecated. Redundant, will be removed soon. Use EVENT_KEY_RELEASED and exclude non printable keys and auto-repeat.
static short VK_0
          VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
static short VK_1
           
static short VK_2
           
static short VK_3
           
static short VK_4
           
static short VK_5
           
static short VK_6
           
static short VK_7
           
static short VK_8
           
static short VK_9
           
static short VK_A
          VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
static short VK_ACCEPT
          Constant for the Accept or Commit function key.
static short VK_ADD
           
static short VK_AGAIN
           
static short VK_ALL_CANDIDATES
          Constant for the All Candidates function key.
static short VK_ALPHANUMERIC
          Constant for the Alphanumeric function key.
static short VK_ALT
           
static short VK_ALT_GRAPH
          Constant for the AltGraph function key.
static short VK_AMPERSAND
          For European keyboards
static short VK_ASTERISK
          For European keyboards
static short VK_AT
          Constant for the "@" key.
static short VK_B
           
static short VK_BACK_QUOTE
           
static short VK_BACK_SLASH
          Constant for the back slash key, "\"
static short VK_BACK_SPACE
           
static short VK_BEGIN
          Constant for the Begin key.
static short VK_BRACELEFT
          For European keyboards
static short VK_BRACERIGHT
          For European keyboards
static short VK_C
           
static short VK_CANCEL
           
static short VK_CAPS_LOCK
           
static short VK_CIRCUMFLEX
          Constant for the "^" key.
static short VK_CLEAR
           
static short VK_CLOSE_BRACKET
          Constant for the close bracket key, "]"
static short VK_CODE_INPUT
          Constant for the Code Input function key.
static short VK_COLON
          Constant for the ":" key.
static short VK_COMMA
          Constant for the comma key, ","
static short VK_COMPOSE
          Constant for the Compose function key.
static short VK_CONTEXT_MENU
          Constant for the Microsoft Windows Context Menu key.
static short VK_CONTROL
           
static short VK_CONVERT
          Constant for the Convert function key.
static short VK_COPY
           
static short VK_CUT
           
static short VK_D
           
static short VK_DEAD_ABOVEDOT
          For European keyboards
static short VK_DEAD_ABOVERING
          For European keyboards
static short VK_DEAD_ACUTE
          For European keyboards
static short VK_DEAD_BREVE
          For European keyboards
static short VK_DEAD_CARON
          For European keyboards
static short VK_DEAD_CEDILLA
          For European keyboards
static short VK_DEAD_CIRCUMFLEX
          For European keyboards
static short VK_DEAD_DIAERESIS
          For European keyboards
static short VK_DEAD_DOUBLEACUTE
          For European keyboards
static short VK_DEAD_GRAVE
          For European keyboards
static short VK_DEAD_IOTA
          For European keyboards
static short VK_DEAD_MACRON
          For European keyboards
static short VK_DEAD_OGONEK
          For European keyboards
static short VK_DEAD_SEMIVOICED_SOUND
          For European keyboards
static short VK_DEAD_TILDE
          For European keyboards
static short VK_DEAD_VOICED_SOUND
          For European keyboards
static short VK_DECIMAL
           
static short VK_DELETE
           
static short VK_DIVIDE
           
static short VK_DOLLAR
          Constant for the "$" key.
static short VK_DOWN
          Constant for the non-numpad down arrow key.
static short VK_E
           
static short VK_END
           
static short VK_ENTER
           
static short VK_EQUALS
          Constant for the equals key, "="
static short VK_ESCAPE
           
static short VK_EURO_SIGN
          Constant for the Euro currency sign key.
static short VK_EXCLAMATION_MARK
          Constant for the "!" key.
static short VK_F
           
static short VK_F1
          Constant for the F1 function key.
static short VK_F10
          Constant for the F10 function key.
static short VK_F11
          Constant for the F11 function key.
static short VK_F12
          Constant for the F12 function key.
static short VK_F13
          Constant for the F13 function key.
static short VK_F14
          Constant for the F14 function key.
static short VK_F15
          Constant for the F15 function key.
static short VK_F16
          Constant for the F16 function key.
static short VK_F17
          Constant for the F17 function key.
static short VK_F18
          Constant for the F18 function key.
static short VK_F19
          Constant for the F19 function key.
static short VK_F2
          Constant for the F2 function key.
static short VK_F20
          Constant for the F20 function key.
static short VK_F21
          Constant for the F21 function key.
static short VK_F22
          Constant for the F22 function key.
static short VK_F23
          Constant for the F23 function key.
static short VK_F24
          Constant for the F24 function key.
static short VK_F3
          Constant for the F3 function key.
static short VK_F4
          Constant for the F4 function key.
static short VK_F5
          Constant for the F5 function key.
static short VK_F6
          Constant for the F6 function key.
static short VK_F7
          Constant for the F7 function key.
static short VK_F8
          Constant for the F8 function key.
static short VK_F9
          Constant for the F9 function key.
static short VK_FINAL
           
static short VK_FIND
           
static short VK_FULL_WIDTH
          Constant for the Full-Width Characters function key.
static short VK_G
           
static short VK_GREATER
          For European keyboards
static short VK_H
           
static short VK_HALF_WIDTH
          Constant for the Half-Width Characters function key.
static short VK_HELP
           
static short VK_HIRAGANA
          Constant for the Hiragana function key.
static short VK_HOME
           
static short VK_I
           
static short VK_INPUT_METHOD_ON_OFF
          Constant for the input method on/off key.
static short VK_INSERT
           
static short VK_INVERTED_EXCLAMATION_MARK
          Constant for the inverted exclamation mark key.
static short VK_J
           
static short VK_JAPANESE_HIRAGANA
          Constant for the Japanese-Hiragana function key.
static short VK_JAPANESE_KATAKANA
          Constant for the Japanese-Katakana function key.
static short VK_JAPANESE_ROMAN
          Constant for the Japanese-Roman function key.
static short VK_K
           
static short VK_KANA
           
static short VK_KANA_LOCK
          Constant for the locking Kana function key.
static short VK_KANJI
           
static short VK_KATAKANA
          Constant for the Katakana function key.
static short VK_KEYBOARD_INVISIBLE
          Constant for Keyboard became invisible, e.g.
static short VK_KP_DOWN
          Constant for the numeric keypad down arrow key.
static short VK_KP_LEFT
          Constant for the numeric keypad left arrow key.
static short VK_KP_RIGHT
          Constant for the numeric keypad right arrow key.
static short VK_KP_UP
          Constant for the numeric keypad up arrow key.
static short VK_L
           
static short VK_LEFT
          Constant for the non-numpad left arrow key.
static short VK_LEFT_PARENTHESIS
          Constant for the "(" key.
static short VK_LESS
          For European keyboards
static short VK_M
           
static short VK_META
           
static short VK_MINUS
          Constant for the minus key, "-"
static short VK_MODECHANGE
           
static short VK_MULTIPLY
           
static short VK_N
           
static short VK_NONCONVERT
          Constant for the Don't Convert function key.
static short VK_NUM_LOCK
           
static short VK_NUMBER_SIGN
          Constant for the "#" key.
static short VK_NUMPAD0
           
static short VK_NUMPAD1
           
static short VK_NUMPAD2
           
static short VK_NUMPAD3
           
static short VK_NUMPAD4
           
static short VK_NUMPAD5
           
static short VK_NUMPAD6
           
static short VK_NUMPAD7
           
static short VK_NUMPAD8
           
static short VK_NUMPAD9
           
static short VK_O
           
static short VK_OPEN_BRACKET
          Constant for the open bracket key, "["
static short VK_P
           
static short VK_PAGE_DOWN
           
static short VK_PAGE_UP
           
static short VK_PASTE
           
static short VK_PAUSE
           
static short VK_PERIOD
          Constant for the period key, "."
static short VK_PLUS
          Constant for the "+" key.
static short VK_PREVIOUS_CANDIDATE
          Constant for the Previous Candidate function key.
static short VK_PRINTSCREEN
           
static short VK_PROPS
           
static short VK_Q
           
static short VK_QUOTE
           
static short VK_QUOTEDBL
          For European keyboards
static short VK_R
           
static short VK_RIGHT
          Constant for the non-numpad right arrow key.
static short VK_RIGHT_PARENTHESIS
          Constant for the ")" key.
static short VK_ROMAN_CHARACTERS
          Constant for the Roman Characters function key.
static short VK_S
           
static short VK_SCROLL_LOCK
           
static short VK_SEMICOLON
          Constant for the semicolon key, ";"
static short VK_SEPARATOR
          Constant for the Numpad Separator key.
static short VK_SHIFT
           
static short VK_SLASH
          Constant for the forward slash key, "/"
static short VK_SPACE
           
static short VK_STOP
           
static short VK_SUBTRACT
           
static short VK_T
           
static short VK_TAB
           
static short VK_U
           
static short VK_UNDEFINED
          This value is used to indicate that the keyCode is unknown.
static short VK_UNDERSCORE
          Constant for the "_" key.
static short VK_UNDO
           
static short VK_UP
          Constant for the non-numpad up arrow key.
static short VK_V
           
static short VK_W
           
static short VK_WINDOWS
          Constant for the Microsoft Windows "Windows" key.
static short VK_X
           
static short VK_Y
           
static short VK_Z
           
 
Fields inherited from class com.jogamp.newt.event.InputEvent
ALT_GRAPH_MASK, ALT_MASK, AUTOREPEAT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, BUTTON4_MASK, BUTTON5_MASK, BUTTON6_MASK, BUTTON7_MASK, BUTTON8_MASK, BUTTON9_MASK, BUTTONLAST_MASK, CONFINED_MASK, CTRL_MASK, INVISIBLE_MASK, META_MASK, SHIFT_MASK
 
Fields inherited from class com.jogamp.newt.event.NEWTEvent
consumedTag
 
Constructor Summary
KeyEvent(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, char keyChar)
           
 
Method Summary
static String getEventTypeString(short type)
           
 char getKeyChar()
          Returns the UTF-16 character reflecting the key symbol.
 short getKeyCode()
          Returns the virtual key code using a fixed mapping to the US keyboard layout.
 short getKeySymbol()
          Returns the virtual key symbol reflecting the current keyboard layout.
 boolean isActionKey()
          Returns true if key symbol represents a non-printable and non-modifier action key, otherwise false.
static boolean isActionKey(short vKey)
          Returns true if the given virtualKey represents a non-printable and non-modifier action key, otherwise false.
 boolean isModifierKey()
          Returns true if key symbol represents a modifier key, otherwise false.
static boolean isModifierKey(short vKey)
          Returns true if the given virtualKey represents a modifier key, otherwise false.
 boolean isPrintableKey()
          Returns true if key symbol represents a printable character, i.e.
static boolean isPrintableKey(short vKey)
          Returns true if given virtualKey represents a printable character, i.e.
 String toString()
           
 StringBuilder toString(StringBuilder sb)
           
 
Methods inherited from class com.jogamp.newt.event.InputEvent
getButtonMask, getButtonsDown, getModifiers, getModifiersString, isAltDown, isAltGraphDown, isAutoRepeat, isButtonDown, isConfined, isControlDown, isInvisible, isMetaDown, isShiftDown
 
Methods inherited from class com.jogamp.newt.event.NEWTEvent
getAttachment, getEventType, getWhen, setAttachment, toHexString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT_KEY_PRESSED

public static final short EVENT_KEY_PRESSED
A key has been pressed, excluding auto-repeat modifier keys.

See Also:
Constant Field Values

EVENT_KEY_RELEASED

public static final short EVENT_KEY_RELEASED
A key has been released, excluding auto-repeat modifier keys.

See Also:
Constant Field Values

EVENT_KEY_TYPED

public static final short EVENT_KEY_TYPED
Deprecated. Redundant, will be removed soon. Use EVENT_KEY_RELEASED and exclude non printable keys and auto-repeat.
A printable key has been typed (pressed and released), excluding auto-repeat.

See Also:
Constant Field Values

VK_CANCEL

public static final short VK_CANCEL
See Also:
Constant Field Values

VK_BACK_SPACE

public static final short VK_BACK_SPACE
See Also:
Constant Field Values

VK_TAB

public static final short VK_TAB
See Also:
Constant Field Values

VK_ENTER

public static final short VK_ENTER
See Also:
Constant Field Values

VK_CLEAR

public static final short VK_CLEAR
See Also:
Constant Field Values

VK_SHIFT

public static final short VK_SHIFT
See Also:
Constant Field Values

VK_CONTROL

public static final short VK_CONTROL
See Also:
Constant Field Values

VK_ALT

public static final short VK_ALT
See Also:
Constant Field Values

VK_PAUSE

public static final short VK_PAUSE
See Also:
Constant Field Values

VK_CAPS_LOCK

public static final short VK_CAPS_LOCK
See Also:
Constant Field Values

VK_ESCAPE

public static final short VK_ESCAPE
See Also:
Constant Field Values

VK_SPACE

public static final short VK_SPACE
See Also:
Constant Field Values

VK_PAGE_UP

public static final short VK_PAGE_UP
See Also:
Constant Field Values

VK_PAGE_DOWN

public static final short VK_PAGE_DOWN
See Also:
Constant Field Values

VK_END

public static final short VK_END
See Also:
Constant Field Values

VK_HOME

public static final short VK_HOME
See Also:
Constant Field Values

VK_LEFT

public static final short VK_LEFT
Constant for the non-numpad left arrow key.

See Also:
VK_KP_LEFT, Constant Field Values

VK_UP

public static final short VK_UP
Constant for the non-numpad up arrow key.

See Also:
VK_KP_UP, Constant Field Values

VK_RIGHT

public static final short VK_RIGHT
Constant for the non-numpad right arrow key.

See Also:
VK_KP_RIGHT, Constant Field Values

VK_DOWN

public static final short VK_DOWN
Constant for the non-numpad down arrow key.

See Also:
VK_KP_DOWN, Constant Field Values

VK_COMMA

public static final short VK_COMMA
Constant for the comma key, ","

See Also:
Constant Field Values

VK_MINUS

public static final short VK_MINUS
Constant for the minus key, "-"

Since:
1.2
See Also:
Constant Field Values

VK_PERIOD

public static final short VK_PERIOD
Constant for the period key, "."

See Also:
Constant Field Values

VK_SLASH

public static final short VK_SLASH
Constant for the forward slash key, "/"

See Also:
Constant Field Values

VK_0

public static final short VK_0
VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)

See Also:
Constant Field Values

VK_1

public static final short VK_1
See Also:
Constant Field Values

VK_2

public static final short VK_2
See Also:
Constant Field Values

VK_3

public static final short VK_3
See Also:
Constant Field Values

VK_4

public static final short VK_4
See Also:
Constant Field Values

VK_5

public static final short VK_5
See Also:
Constant Field Values

VK_6

public static final short VK_6
See Also:
Constant Field Values

VK_7

public static final short VK_7
See Also:
Constant Field Values

VK_8

public static final short VK_8
See Also:
Constant Field Values

VK_9

public static final short VK_9
See Also:
Constant Field Values

VK_SEMICOLON

public static final short VK_SEMICOLON
Constant for the semicolon key, ";"

See Also:
Constant Field Values

VK_EQUALS

public static final short VK_EQUALS
Constant for the equals key, "="

See Also:
Constant Field Values

VK_A

public static final short VK_A
VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)

See Also:
Constant Field Values

VK_B

public static final short VK_B
See Also:
Constant Field Values

VK_C

public static final short VK_C
See Also:
Constant Field Values

VK_D

public static final short VK_D
See Also:
Constant Field Values

VK_E

public static final short VK_E
See Also:
Constant Field Values

VK_F

public static final short VK_F
See Also:
Constant Field Values

VK_G

public static final short VK_G
See Also:
Constant Field Values

VK_H

public static final short VK_H
See Also:
Constant Field Values

VK_I

public static final short VK_I
See Also:
Constant Field Values

VK_J

public static final short VK_J
See Also:
Constant Field Values

VK_K

public static final short VK_K
See Also:
Constant Field Values

VK_L

public static final short VK_L
See Also:
Constant Field Values

VK_M

public static final short VK_M
See Also:
Constant Field Values

VK_N

public static final short VK_N
See Also:
Constant Field Values

VK_O

public static final short VK_O
See Also:
Constant Field Values

VK_P

public static final short VK_P
See Also:
Constant Field Values

VK_Q

public static final short VK_Q
See Also:
Constant Field Values

VK_R

public static final short VK_R
See Also:
Constant Field Values

VK_S

public static final short VK_S
See Also:
Constant Field Values

VK_T

public static final short VK_T
See Also:
Constant Field Values

VK_U

public static final short VK_U
See Also:
Constant Field Values

VK_V

public static final short VK_V
See Also:
Constant Field Values

VK_W

public static final short VK_W
See Also:
Constant Field Values

VK_X

public static final short VK_X
See Also:
Constant Field Values

VK_Y

public static final short VK_Y
See Also:
Constant Field Values

VK_Z

public static final short VK_Z
See Also:
Constant Field Values

VK_OPEN_BRACKET

public static final short VK_OPEN_BRACKET
Constant for the open bracket key, "["

See Also:
Constant Field Values

VK_BACK_SLASH

public static final short VK_BACK_SLASH
Constant for the back slash key, "\"

See Also:
Constant Field Values

VK_CLOSE_BRACKET

public static final short VK_CLOSE_BRACKET
Constant for the close bracket key, "]"

See Also:
Constant Field Values

VK_NUMPAD0

public static final short VK_NUMPAD0
See Also:
Constant Field Values

VK_NUMPAD1

public static final short VK_NUMPAD1
See Also:
Constant Field Values

VK_NUMPAD2

public static final short VK_NUMPAD2
See Also:
Constant Field Values

VK_NUMPAD3

public static final short VK_NUMPAD3
See Also:
Constant Field Values

VK_NUMPAD4

public static final short VK_NUMPAD4
See Also:
Constant Field Values

VK_NUMPAD5

public static final short VK_NUMPAD5
See Also:
Constant Field Values

VK_NUMPAD6

public static final short VK_NUMPAD6
See Also:
Constant Field Values

VK_NUMPAD7

public static final short VK_NUMPAD7
See Also:
Constant Field Values

VK_NUMPAD8

public static final short VK_NUMPAD8
See Also:
Constant Field Values

VK_NUMPAD9

public static final short VK_NUMPAD9
See Also:
Constant Field Values

VK_MULTIPLY

public static final short VK_MULTIPLY
See Also:
Constant Field Values

VK_ADD

public static final short VK_ADD
See Also:
Constant Field Values

VK_SEPARATOR

public static final short VK_SEPARATOR
Constant for the Numpad Separator key.

See Also:
Constant Field Values

VK_SUBTRACT

public static final short VK_SUBTRACT
See Also:
Constant Field Values

VK_DECIMAL

public static final short VK_DECIMAL
See Also:
Constant Field Values

VK_DIVIDE

public static final short VK_DIVIDE
See Also:
Constant Field Values

VK_DELETE

public static final short VK_DELETE
See Also:
Constant Field Values

VK_NUM_LOCK

public static final short VK_NUM_LOCK
See Also:
Constant Field Values

VK_SCROLL_LOCK

public static final short VK_SCROLL_LOCK
See Also:
Constant Field Values

VK_F1

public static final short VK_F1
Constant for the F1 function key.

See Also:
Constant Field Values

VK_F2

public static final short VK_F2
Constant for the F2 function key.

See Also:
Constant Field Values

VK_F3

public static final short VK_F3
Constant for the F3 function key.

See Also:
Constant Field Values

VK_F4

public static final short VK_F4
Constant for the F4 function key.

See Also:
Constant Field Values

VK_F5

public static final short VK_F5
Constant for the F5 function key.

See Also:
Constant Field Values

VK_F6

public static final short VK_F6
Constant for the F6 function key.

See Also:
Constant Field Values

VK_F7

public static final short VK_F7
Constant for the F7 function key.

See Also:
Constant Field Values

VK_F8

public static final short VK_F8
Constant for the F8 function key.

See Also:
Constant Field Values

VK_F9

public static final short VK_F9
Constant for the F9 function key.

See Also:
Constant Field Values

VK_F10

public static final short VK_F10
Constant for the F10 function key.

See Also:
Constant Field Values

VK_F11

public static final short VK_F11
Constant for the F11 function key.

See Also:
Constant Field Values

VK_F12

public static final short VK_F12
Constant for the F12 function key.

See Also:
Constant Field Values

VK_F13

public static final short VK_F13
Constant for the F13 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F14

public static final short VK_F14
Constant for the F14 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F15

public static final short VK_F15
Constant for the F15 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F16

public static final short VK_F16
Constant for the F16 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F17

public static final short VK_F17
Constant for the F17 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F18

public static final short VK_F18
Constant for the F18 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F19

public static final short VK_F19
Constant for the F19 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F20

public static final short VK_F20
Constant for the F20 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F21

public static final short VK_F21
Constant for the F21 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F22

public static final short VK_F22
Constant for the F22 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F23

public static final short VK_F23
Constant for the F23 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_F24

public static final short VK_F24
Constant for the F24 function key.

F13 - F24 are used on IBM 3270 keyboard; use random range for constants.

See Also:
Constant Field Values

VK_PRINTSCREEN

public static final short VK_PRINTSCREEN
See Also:
Constant Field Values

VK_INSERT

public static final short VK_INSERT
See Also:
Constant Field Values

VK_HELP

public static final short VK_HELP
See Also:
Constant Field Values

VK_META

public static final short VK_META
See Also:
Constant Field Values

VK_BACK_QUOTE

public static final short VK_BACK_QUOTE
See Also:
Constant Field Values

VK_QUOTE

public static final short VK_QUOTE
See Also:
Constant Field Values

VK_KP_UP

public static final short VK_KP_UP
Constant for the numeric keypad up arrow key.

See Also:
VK_UP, Constant Field Values

VK_KP_DOWN

public static final short VK_KP_DOWN
Constant for the numeric keypad down arrow key.

See Also:
VK_DOWN, Constant Field Values

VK_KP_LEFT

public static final short VK_KP_LEFT
Constant for the numeric keypad left arrow key.

See Also:
VK_LEFT, Constant Field Values

VK_KP_RIGHT

public static final short VK_KP_RIGHT
Constant for the numeric keypad right arrow key.

See Also:
VK_RIGHT, Constant Field Values

VK_DEAD_GRAVE

public static final short VK_DEAD_GRAVE
For European keyboards

See Also:
Constant Field Values

VK_DEAD_ACUTE

public static final short VK_DEAD_ACUTE
For European keyboards

See Also:
Constant Field Values

VK_DEAD_CIRCUMFLEX

public static final short VK_DEAD_CIRCUMFLEX
For European keyboards

See Also:
Constant Field Values

VK_DEAD_TILDE

public static final short VK_DEAD_TILDE
For European keyboards

See Also:
Constant Field Values

VK_DEAD_MACRON

public static final short VK_DEAD_MACRON
For European keyboards

See Also:
Constant Field Values

VK_DEAD_BREVE

public static final short VK_DEAD_BREVE
For European keyboards

See Also:
Constant Field Values

VK_DEAD_ABOVEDOT

public static final short VK_DEAD_ABOVEDOT
For European keyboards

See Also:
Constant Field Values

VK_DEAD_DIAERESIS

public static final short VK_DEAD_DIAERESIS
For European keyboards

See Also:
Constant Field Values

VK_DEAD_ABOVERING

public static final short VK_DEAD_ABOVERING
For European keyboards

See Also:
Constant Field Values

VK_DEAD_DOUBLEACUTE

public static final short VK_DEAD_DOUBLEACUTE
For European keyboards

See Also:
Constant Field Values

VK_DEAD_CARON

public static final short VK_DEAD_CARON
For European keyboards

See Also:
Constant Field Values

VK_DEAD_CEDILLA

public static final short VK_DEAD_CEDILLA
For European keyboards

See Also:
Constant Field Values

VK_DEAD_OGONEK

public static final short VK_DEAD_OGONEK
For European keyboards

See Also:
Constant Field Values

VK_DEAD_IOTA

public static final short VK_DEAD_IOTA
For European keyboards

See Also:
Constant Field Values

VK_DEAD_VOICED_SOUND

public static final short VK_DEAD_VOICED_SOUND
For European keyboards

See Also:
Constant Field Values

VK_DEAD_SEMIVOICED_SOUND

public static final short VK_DEAD_SEMIVOICED_SOUND
For European keyboards

See Also:
Constant Field Values

VK_AMPERSAND

public static final short VK_AMPERSAND
For European keyboards

See Also:
Constant Field Values

VK_ASTERISK

public static final short VK_ASTERISK
For European keyboards

See Also:
Constant Field Values

VK_QUOTEDBL

public static final short VK_QUOTEDBL
For European keyboards

See Also:
Constant Field Values

VK_LESS

public static final short VK_LESS
For European keyboards

See Also:
Constant Field Values

VK_GREATER

public static final short VK_GREATER
For European keyboards

See Also:
Constant Field Values

VK_BRACELEFT

public static final short VK_BRACELEFT
For European keyboards

See Also:
Constant Field Values

VK_BRACERIGHT

public static final short VK_BRACERIGHT
For European keyboards

See Also:
Constant Field Values

VK_AT

public static final short VK_AT
Constant for the "@" key.

See Also:
Constant Field Values

VK_COLON

public static final short VK_COLON
Constant for the ":" key.

See Also:
Constant Field Values

VK_CIRCUMFLEX

public static final short VK_CIRCUMFLEX
Constant for the "^" key.

See Also:
Constant Field Values

VK_DOLLAR

public static final short VK_DOLLAR
Constant for the "$" key.

See Also:
Constant Field Values

VK_EURO_SIGN

public static final short VK_EURO_SIGN
Constant for the Euro currency sign key.

See Also:
Constant Field Values

VK_EXCLAMATION_MARK

public static final short VK_EXCLAMATION_MARK
Constant for the "!" key.

See Also:
Constant Field Values

VK_INVERTED_EXCLAMATION_MARK

public static final short VK_INVERTED_EXCLAMATION_MARK
Constant for the inverted exclamation mark key.

See Also:
Constant Field Values

VK_LEFT_PARENTHESIS

public static final short VK_LEFT_PARENTHESIS
Constant for the "(" key.

See Also:
Constant Field Values

VK_NUMBER_SIGN

public static final short VK_NUMBER_SIGN
Constant for the "#" key.

See Also:
Constant Field Values

VK_PLUS

public static final short VK_PLUS
Constant for the "+" key.

See Also:
Constant Field Values

VK_RIGHT_PARENTHESIS

public static final short VK_RIGHT_PARENTHESIS
Constant for the ")" key.

See Also:
Constant Field Values

VK_UNDERSCORE

public static final short VK_UNDERSCORE
Constant for the "_" key.

See Also:
Constant Field Values

VK_WINDOWS

public static final short VK_WINDOWS
Constant for the Microsoft Windows "Windows" key. It is used for both the left and right version of the key.

See Also:
Constant Field Values

VK_CONTEXT_MENU

public static final short VK_CONTEXT_MENU
Constant for the Microsoft Windows Context Menu key.

See Also:
Constant Field Values

VK_FINAL

public static final short VK_FINAL
See Also:
Constant Field Values

VK_CONVERT

public static final short VK_CONVERT
Constant for the Convert function key.

See Also:
Constant Field Values

VK_NONCONVERT

public static final short VK_NONCONVERT
Constant for the Don't Convert function key.

See Also:
Constant Field Values

VK_ACCEPT

public static final short VK_ACCEPT
Constant for the Accept or Commit function key.

See Also:
Constant Field Values

VK_MODECHANGE

public static final short VK_MODECHANGE
See Also:
Constant Field Values

VK_KANA

public static final short VK_KANA
See Also:
Constant Field Values

VK_KANJI

public static final short VK_KANJI
See Also:
Constant Field Values

VK_ALPHANUMERIC

public static final short VK_ALPHANUMERIC
Constant for the Alphanumeric function key.

See Also:
Constant Field Values

VK_KATAKANA

public static final short VK_KATAKANA
Constant for the Katakana function key.

See Also:
Constant Field Values

VK_HIRAGANA

public static final short VK_HIRAGANA
Constant for the Hiragana function key.

See Also:
Constant Field Values

VK_FULL_WIDTH

public static final short VK_FULL_WIDTH
Constant for the Full-Width Characters function key.

See Also:
Constant Field Values

VK_HALF_WIDTH

public static final short VK_HALF_WIDTH
Constant for the Half-Width Characters function key.

See Also:
Constant Field Values

VK_ROMAN_CHARACTERS

public static final short VK_ROMAN_CHARACTERS
Constant for the Roman Characters function key.

See Also:
Constant Field Values

VK_ALL_CANDIDATES

public static final short VK_ALL_CANDIDATES
Constant for the All Candidates function key.

See Also:
Constant Field Values

VK_PREVIOUS_CANDIDATE

public static final short VK_PREVIOUS_CANDIDATE
Constant for the Previous Candidate function key.

See Also:
Constant Field Values

VK_CODE_INPUT

public static final short VK_CODE_INPUT
Constant for the Code Input function key.

See Also:
Constant Field Values

VK_JAPANESE_KATAKANA

public static final short VK_JAPANESE_KATAKANA
Constant for the Japanese-Katakana function key. This key switches to a Japanese input method and selects its Katakana input mode.

See Also:
Constant Field Values

VK_JAPANESE_HIRAGANA

public static final short VK_JAPANESE_HIRAGANA
Constant for the Japanese-Hiragana function key. This key switches to a Japanese input method and selects its Hiragana input mode.

See Also:
Constant Field Values

VK_JAPANESE_ROMAN

public static final short VK_JAPANESE_ROMAN
Constant for the Japanese-Roman function key. This key switches to a Japanese input method and selects its Roman-Direct input mode.

See Also:
Constant Field Values

VK_KANA_LOCK

public static final short VK_KANA_LOCK
Constant for the locking Kana function key. This key locks the keyboard into a Kana layout.

See Also:
Constant Field Values

VK_INPUT_METHOD_ON_OFF

public static final short VK_INPUT_METHOD_ON_OFF
Constant for the input method on/off key.

See Also:
Constant Field Values

VK_CUT

public static final short VK_CUT
See Also:
Constant Field Values

VK_COPY

public static final short VK_COPY
See Also:
Constant Field Values

VK_PASTE

public static final short VK_PASTE
See Also:
Constant Field Values

VK_UNDO

public static final short VK_UNDO
See Also:
Constant Field Values

VK_AGAIN

public static final short VK_AGAIN
See Also:
Constant Field Values

VK_FIND

public static final short VK_FIND
See Also:
Constant Field Values

VK_PROPS

public static final short VK_PROPS
See Also:
Constant Field Values

VK_STOP

public static final short VK_STOP
See Also:
Constant Field Values

VK_COMPOSE

public static final short VK_COMPOSE
Constant for the Compose function key.

See Also:
Constant Field Values

VK_ALT_GRAPH

public static final short VK_ALT_GRAPH
Constant for the AltGraph function key.

See Also:
Constant Field Values

VK_BEGIN

public static final short VK_BEGIN
Constant for the Begin key.

See Also:
Constant Field Values

VK_KEYBOARD_INVISIBLE

public static final short VK_KEYBOARD_INVISIBLE
Constant for Keyboard became invisible, e.g. Android's soft keyboard Back button hit while keyboard is visible.

See Also:
Constant Field Values

VK_UNDEFINED

public static final short VK_UNDEFINED
This value is used to indicate that the keyCode is unknown. KEY_TYPED events do not have a keyCode value; this value is used instead.

See Also:
Constant Field Values
Constructor Detail

KeyEvent

public KeyEvent(short eventType,
                Object source,
                long when,
                int modifiers,
                short keyCode,
                short keySym,
                char keyChar)
Method Detail

getKeyChar

public final char getKeyChar()
Returns the UTF-16 character reflecting the key symbol.

See Also:
getKeySymbol(), getKeyCode()

getKeySymbol

public final short getKeySymbol()
Returns the virtual key symbol reflecting the current keyboard layout.

See Also:
getKeyChar(), getKeyCode()

getKeyCode

public final short getKeyCode()
Returns the virtual key code using a fixed mapping to the US keyboard layout.

In contrast to key symbol, key code uses a fixed US keyboard layout and therefore is keyboard layout independent.

E.g. virtual key code VK_Y denotes the same physical key regardless whether keyboard layout QWERTY or QWERTZ is active. The key symbol of the former is VK_Y, where the latter produces VK_Y.

Disclaimer: In case key code is not implemented on your platform (OSX, ..) the key symbol is returned.

See Also:
getKeyChar(), getKeySymbol()

toString

public final String toString()
Overrides:
toString in class InputEvent

toString

public final StringBuilder toString(StringBuilder sb)
Overrides:
toString in class InputEvent

getEventTypeString

public static String getEventTypeString(short type)

isModifierKey

public static boolean isModifierKey(short vKey)
Returns true if the given virtualKey represents a modifier key, otherwise false.

A modifier key is one of VK_SHIFT, VK_CONTROL, VK_ALT, VK_ALT_GRAPH, VK_META.


isModifierKey

public final boolean isModifierKey()
Returns true if key symbol represents a modifier key, otherwise false.

See isModifierKey(short) for details.

Note: Implementation uses a cached value.


isActionKey

public static boolean isActionKey(short vKey)
Returns true if the given virtualKey represents a non-printable and non-modifier action key, otherwise false.

An action key is one of VK_HOME, VK_END, VK_PAGE_UP, VK_PAGE_DOWN, VK_UP, VK_PAGE_DOWN, VK_LEFT, VK_RIGHT, VK_F1-VK_F24, VK_PRINTSCREEN, VK_CAPS_LOCK, VK_PAUSE, VK_INSERT, VK_HELP, VK_WINDOWS, etc ...


isActionKey

public final boolean isActionKey()
Returns true if key symbol represents a non-printable and non-modifier action key, otherwise false.

See isActionKey(short) for details.


isPrintableKey

public static boolean isPrintableKey(short vKey)
Returns true if given virtualKey represents a printable character, i.e. neither a modifier key nor an action key. Otherwise returns false.


isPrintableKey

public final boolean isPrintableKey()
Returns true if key symbol represents a printable character, i.e. neither a modifier key nor an action key. Otherwise returns false.



Copyright 2010 JogAmp Community.