Package icyllis.modernui.view

# Class KeyEvent

java.lang.Object
icyllis.modernui.view.InputEvent
icyllis.modernui.view.KeyEvent

public class KeyEvent extends InputEvent
Object that reports key events (keyboard etc.). Modified for desktop application.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `KeyEvent.DispatcherState`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ACTION_DOWN`
  `getAction()` value: the key has been pressed down.
  `static final int`
  `ACTION_UP`
  `getAction()` value: the key has been released.
  `static final int`
  `FLAG_CANCELED`
  When associated with up key events, this indicates that the key press has been canceled.
  `static final int`
  `FLAG_CANCELED_LONG_PRESS`
  Set when a key event has `FLAG_CANCELED` set because a long press action was executed while it was down.
  `static final int`
  `FLAG_EDITOR_ACTION`
  This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done".
  `static final int`
  `FLAG_FALLBACK`
  Set when a key event has been synthesized to implement default behavior for an event that the application did not handle.
  `static final int`
  `FLAG_FROM_SYSTEM`
  This mask is set if an event was known to come from a trusted part of the system.
  `static final int`
  `FLAG_KEEP_TOUCH_MODE`
  This mask is set if we don't want the key event to cause us to leave touch mode.
  `static final int`
  `FLAG_LONG_PRESS`
  This flag is set for the first key repeat that occurs after the long press timeout.
  `static final int`
  `FLAG_PREDISPATCH`
  Signifies that the key is being predispatched.
  `static final int`
  `FLAG_SOFT_KEYBOARD`
  This mask is set if the key event was generated by a software keyboard.
  `static final int`
  `FLAG_START_TRACKING`
  Private control to determine when an app is tracking a key sequence.
  `static final int`
  `FLAG_TRACKING`
  Set for `ACTION_UP` when this event's key code is still being tracked from its initial down.
  `static final int`
  `FLAG_VIRTUAL_HARD_KEY`
  This key event was generated by a virtual (on-screen) hard key area.
  `static final int`
  `KEY_0`
  `static final int`
  `KEY_1`
  `static final int`
  `KEY_2`
  `static final int`
  `KEY_3`
  `static final int`
  `KEY_4`
  `static final int`
  `KEY_5`
  `static final int`
  `KEY_6`
  `static final int`
  `KEY_7`
  `static final int`
  `KEY_8`
  `static final int`
  `KEY_9`
  `static final int`
  `KEY_A`
  `static final int`
  `KEY_APOSTROPHE`
  `static final int`
  `KEY_B`
  `static final int`
  `KEY_BACKSLASH`
  `static final int`
  `KEY_BACKSPACE`
  `static final int`
  `KEY_C`
  `static final int`
  `KEY_CAPS_LOCK`
  `static final int`
  `KEY_COMMA`
  `static final int`
  `KEY_D`
  `static final int`
  `KEY_DELETE`
  `static final int`
  `KEY_DOWN`
  `static final int`
  `KEY_E`
  `static final int`
  `KEY_END`
  `static final int`
  `KEY_ENTER`
  `static final int`
  `KEY_EQUAL`
  `static final int`
  `KEY_ESCAPE`
  `static final int`
  `KEY_F`
  `static final int`
  `KEY_F1`
  `static final int`
  `KEY_F10`
  `static final int`
  `KEY_F11`
  `static final int`
  `KEY_F12`
  `static final int`
  `KEY_F13`
  `static final int`
  `KEY_F14`
  `static final int`
  `KEY_F15`
  `static final int`
  `KEY_F16`
  `static final int`
  `KEY_F17`
  `static final int`
  `KEY_F18`
  `static final int`
  `KEY_F19`
  `static final int`
  `KEY_F2`
  `static final int`
  `KEY_F20`
  `static final int`
  `KEY_F21`
  `static final int`
  `KEY_F22`
  `static final int`
  `KEY_F23`
  `static final int`
  `KEY_F24`
  `static final int`
  `KEY_F25`
  `static final int`
  `KEY_F3`
  `static final int`
  `KEY_F4`
  `static final int`
  `KEY_F5`
  `static final int`
  `KEY_F6`
  `static final int`
  `KEY_F7`
  `static final int`
  `KEY_F8`
  `static final int`
  `KEY_F9`
  `static final int`
  `KEY_G`
  `static final int`
  `KEY_GRAVE_ACCENT`
  `static final int`
  `KEY_H`
  `static final int`
  `KEY_HOME`
  `static final int`
  `KEY_I`
  `static final int`
  `KEY_INSERT`
  `static final int`
  `KEY_J`
  `static final int`
  `KEY_K`
  `static final int`
  `KEY_KP_0`
  `static final int`
  `KEY_KP_1`
  `static final int`
  `KEY_KP_2`
  `static final int`
  `KEY_KP_3`
  `static final int`
  `KEY_KP_4`
  `static final int`
  `KEY_KP_5`
  `static final int`
  `KEY_KP_6`
  `static final int`
  `KEY_KP_7`
  `static final int`
  `KEY_KP_8`
  `static final int`
  `KEY_KP_9`
  `static final int`
  `KEY_KP_ADD`
  `static final int`
  `KEY_KP_DECIMAL`
  `static final int`
  `KEY_KP_DIVIDE`
  `static final int`
  `KEY_KP_ENTER`
  `static final int`
  `KEY_KP_EQUAL`
  `static final int`
  `KEY_KP_MULTIPLY`
  `static final int`
  `KEY_KP_SUBTRACT`
  `static final int`
  `KEY_L`
  `static final int`
  `KEY_LEFT`
  `static final int`
  `KEY_LEFT_ALT`
  `static final int`
  `KEY_LEFT_BRACKET`
  `static final int`
  `KEY_LEFT_CONTROL`
  `static final int`
  `KEY_LEFT_SHIFT`
  `static final int`
  `KEY_LEFT_SUPER`
  `static final int`
  `KEY_M`
  `static final int`
  `KEY_MENU`
  `static final int`
  `KEY_MINUS`
  `static final int`
  `KEY_N`
  `static final int`
  `KEY_NUM_LOCK`
  `static final int`
  `KEY_O`
  `static final int`
  `KEY_P`
  `static final int`
  `KEY_PAGE_DOWN`
  `static final int`
  `KEY_PAGE_UP`
  `static final int`
  `KEY_PAUSE`
  `static final int`
  `KEY_PERIOD`
  `static final int`
  `KEY_PRINT_SCREEN`
  `static final int`
  `KEY_Q`
  `static final int`
  `KEY_R`
  `static final int`
  `KEY_RIGHT`
  `static final int`
  `KEY_RIGHT_ALT`
  `static final int`
  `KEY_RIGHT_BRACKET`
  `static final int`
  `KEY_RIGHT_CONTROL`
  `static final int`
  `KEY_RIGHT_SHIFT`
  `static final int`
  `KEY_RIGHT_SUPER`
  `static final int`
  `KEY_S`
  `static final int`
  `KEY_SCROLL_LOCK`
  `static final int`
  `KEY_SEMICOLON`
  `static final int`
  `KEY_SLASH`
  `static final int`
  `KEY_SPACE`
  `static final int`
  `KEY_T`
  `static final int`
  `KEY_TAB`
  `static final int`
  `KEY_U`
  `static final int`
  `KEY_UNKNOWN`
  `static final int`
  `KEY_UP`
  `static final int`
  `KEY_V`
  `static final int`
  `KEY_W`
  `static final int`
  `KEY_WORLD_1`
  `static final int`
  `KEY_WORLD_2`
  `static final int`
  `KEY_X`
  `static final int`
  `KEY_Y`
  `static final int`
  `KEY_Z`
  `static final int`
  `META_ALT_ON`
  `static final int`
  `META_CTRL_ON`
  `static final int`
  `META_SHIFT_ON`
  `static final int`
  `META_SUPER_ON`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `cancel()`
  Marks the input event as being canceled.
  `InputEvent`
  `copy()`
  Copies the event.
  `final int`
  `getAction()`
  Retrieve the action of this key event.
  `long`
  `getEventTime()`
  Get the time in milliseconds that this event object is created in the GLFW time base
  `long`
  `getEventTimeNano()`
  Get the precise time in nanoseconds that this event object is created in the GLFW time base
  `final int`
  `getKeyCode()`
  Retrieve the key code of the key event.
  `final char`
  `getMappedChar()`
  Returns the alphabetic character represented by the key.
  `final int`
  `getModifiers()`
  Returns the state of the modifier keys.
  `final int`
  `getRepeatCount()`
  Retrieve the repeat count of the event.
  `final int`
  `getScanCode()`
  Retrieve the hardware key id of this key event.
  `final boolean`
  `hasModifiers(int modifiers)`
  Returns true if only the specified modifiers keys are pressed.
  `final boolean`
  `hasNoModifiers()`
  Returns true if no modifier keys are pressed.
  `final boolean`
  `isAltPressed()`
  Returns the pressed state of the ALT key.
  `final boolean`
  `isCanceled()`
  For `ACTION_UP` events, indicates that the event has been canceled as per `FLAG_CANCELED`.
  `final boolean`
  `isCapsLockOn()`
  Returns the locked state of the CAPS LOCK key.
  `final boolean`
  `isCtrlPressed()`
  Returns the pressed state of the CTRL key.
  `final boolean`
  `isLongPress()`
  For `ACTION_DOWN` events, indicates that the event has been canceled as per `FLAG_LONG_PRESS`.
  `static boolean`
  `isModifierKey(int keyCode)`
  Returns true if this key code is a modifier key.
  `final boolean`
  `isNumLockOn()`
  Returns the locked state of the NUM LOCK key.
  `final boolean`
  `isShiftPressed()`
  Returns the pressed state of the SHIFT key.
  `final boolean`
  `isSuperPressed()`
  Returns the pressed state of the SUPER key (a.k.a.
  `final boolean`
  `isTracking()`
  For `ACTION_UP` events, indicates that the event is still being tracked from its initial down event as per `FLAG_TRACKING`.
  `static KeyEvent`
  `obtain(long eventTime, int action, int code, int repeat, int modifiers, int scancode, int flags)`
  `void`
  `recycle()`
  Recycles the event.
  `final void`
  `startTracking()`
  Call this during
  invalid reference

      Callback#onKeyDown

  to have the system track the key through its final up (possibly including a long press).

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### KEY_UNKNOWN

    public static final int KEY_UNKNOWN
    See Also:
      - Constant Field Values

  - ### KEY_SPACE

    public static final int KEY_SPACE
    See Also:
      - Constant Field Values

  - ### KEY_APOSTROPHE

    public static final int KEY_APOSTROPHE
    See Also:
      - Constant Field Values

  - ### KEY_COMMA

    public static final int KEY_COMMA
    See Also:
      - Constant Field Values

  - ### KEY_MINUS

    public static final int KEY_MINUS
    See Also:
      - Constant Field Values

  - ### KEY_PERIOD

    public static final int KEY_PERIOD
    See Also:
      - Constant Field Values

  - ### KEY_SLASH

    public static final int KEY_SLASH
    See Also:
      - Constant Field Values

  - ### KEY_0

    public static final int KEY_0
    See Also:
      - Constant Field Values

  - ### KEY_1

    public static final int KEY_1
    See Also:
      - Constant Field Values

  - ### KEY_2

    public static final int KEY_2
    See Also:
      - Constant Field Values

  - ### KEY_3

    public static final int KEY_3
    See Also:
      - Constant Field Values

  - ### KEY_4

    public static final int KEY_4
    See Also:
      - Constant Field Values

  - ### KEY_5

    public static final int KEY_5
    See Also:
      - Constant Field Values

  - ### KEY_6

    public static final int KEY_6
    See Also:
      - Constant Field Values

  - ### KEY_7

    public static final int KEY_7
    See Also:
      - Constant Field Values

  - ### KEY_8

    public static final int KEY_8
    See Also:
      - Constant Field Values

  - ### KEY_9

    public static final int KEY_9
    See Also:
      - Constant Field Values

  - ### KEY_SEMICOLON

    public static final int KEY_SEMICOLON
    See Also:
      - Constant Field Values

  - ### KEY_EQUAL

    public static final int KEY_EQUAL
    See Also:
      - Constant Field Values

  - ### KEY_A

    public static final int KEY_A
    See Also:
      - Constant Field Values

  - ### KEY_B

    public static final int KEY_B
    See Also:
      - Constant Field Values

  - ### KEY_C

    public static final int KEY_C
    See Also:
      - Constant Field Values

  - ### KEY_D

    public static final int KEY_D
    See Also:
      - Constant Field Values

  - ### KEY_E

    public static final int KEY_E
    See Also:
      - Constant Field Values

  - ### KEY_F

    public static final int KEY_F
    See Also:
      - Constant Field Values

  - ### KEY_G

    public static final int KEY_G
    See Also:
      - Constant Field Values

  - ### KEY_H

    public static final int KEY_H
    See Also:
      - Constant Field Values

  - ### KEY_I

    public static final int KEY_I
    See Also:
      - Constant Field Values

  - ### KEY_J

    public static final int KEY_J
    See Also:
      - Constant Field Values

  - ### KEY_K

    public static final int KEY_K
    See Also:
      - Constant Field Values

  - ### KEY_L

    public static final int KEY_L
    See Also:
      - Constant Field Values

  - ### KEY_M

    public static final int KEY_M
    See Also:
      - Constant Field Values

  - ### KEY_N

    public static final int KEY_N
    See Also:
      - Constant Field Values

  - ### KEY_O

    public static final int KEY_O
    See Also:
      - Constant Field Values

  - ### KEY_P

    public static final int KEY_P
    See Also:
      - Constant Field Values

  - ### KEY_Q

    public static final int KEY_Q
    See Also:
      - Constant Field Values

  - ### KEY_R

    public static final int KEY_R
    See Also:
      - Constant Field Values

  - ### KEY_S

    public static final int KEY_S
    See Also:
      - Constant Field Values

  - ### KEY_T

    public static final int KEY_T
    See Also:
      - Constant Field Values

  - ### KEY_U

    public static final int KEY_U
    See Also:
      - Constant Field Values

  - ### KEY_V

    public static final int KEY_V
    See Also:
      - Constant Field Values

  - ### KEY_W

    public static final int KEY_W
    See Also:
      - Constant Field Values

  - ### KEY_X

    public static final int KEY_X
    See Also:
      - Constant Field Values

  - ### KEY_Y

    public static final int KEY_Y
    See Also:
      - Constant Field Values

  - ### KEY_Z

    public static final int KEY_Z
    See Also:
      - Constant Field Values

  - ### KEY_LEFT_BRACKET

    public static final int KEY_LEFT_BRACKET
    See Also:
      - Constant Field Values

  - ### KEY_BACKSLASH

    public static final int KEY_BACKSLASH
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT_BRACKET

    public static final int KEY_RIGHT_BRACKET
    See Also:
      - Constant Field Values

  - ### KEY_GRAVE_ACCENT

    public static final int KEY_GRAVE_ACCENT
    See Also:
      - Constant Field Values

  - ### KEY_WORLD_1

    public static final int KEY_WORLD_1
    See Also:
      - Constant Field Values

  - ### KEY_WORLD_2

    public static final int KEY_WORLD_2
    See Also:
      - Constant Field Values

  - ### KEY_ESCAPE

    public static final int KEY_ESCAPE
    See Also:
      - Constant Field Values

  - ### KEY_ENTER

    public static final int KEY_ENTER
    See Also:
      - Constant Field Values

  - ### KEY_TAB

    public static final int KEY_TAB
    See Also:
      - Constant Field Values

  - ### KEY_BACKSPACE

    public static final int KEY_BACKSPACE
    See Also:
      - Constant Field Values

  - ### KEY_INSERT

    public static final int KEY_INSERT
    See Also:
      - Constant Field Values

  - ### KEY_DELETE

    public static final int KEY_DELETE
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT

    public static final int KEY_RIGHT
    See Also:
      - Constant Field Values

  - ### KEY_LEFT

    public static final int KEY_LEFT
    See Also:
      - Constant Field Values

  - ### KEY_DOWN

    public static final int KEY_DOWN
    See Also:
      - Constant Field Values

  - ### KEY_UP

    public static final int KEY_UP
    See Also:
      - Constant Field Values

  - ### KEY_PAGE_UP

    public static final int KEY_PAGE_UP
    See Also:
      - Constant Field Values

  - ### KEY_PAGE_DOWN

    public static final int KEY_PAGE_DOWN
    See Also:
      - Constant Field Values

  - ### KEY_HOME

    public static final int KEY_HOME
    See Also:
      - Constant Field Values

  - ### KEY_END

    public static final int KEY_END
    See Also:
      - Constant Field Values

  - ### KEY_CAPS_LOCK

    public static final int KEY_CAPS_LOCK
    See Also:
      - Constant Field Values

  - ### KEY_SCROLL_LOCK

    public static final int KEY_SCROLL_LOCK
    See Also:
      - Constant Field Values

  - ### KEY_NUM_LOCK

    public static final int KEY_NUM_LOCK
    See Also:
      - Constant Field Values

  - ### KEY_PRINT_SCREEN

    public static final int KEY_PRINT_SCREEN
    See Also:
      - Constant Field Values

  - ### KEY_PAUSE

    public static final int KEY_PAUSE
    See Also:
      - Constant Field Values

  - ### KEY_F1

    public static final int KEY_F1
    See Also:
      - Constant Field Values

  - ### KEY_F2

    public static final int KEY_F2
    See Also:
      - Constant Field Values

  - ### KEY_F3

    public static final int KEY_F3
    See Also:
      - Constant Field Values

  - ### KEY_F4

    public static final int KEY_F4
    See Also:
      - Constant Field Values

  - ### KEY_F5

    public static final int KEY_F5
    See Also:
      - Constant Field Values

  - ### KEY_F6

    public static final int KEY_F6
    See Also:
      - Constant Field Values

  - ### KEY_F7

    public static final int KEY_F7
    See Also:
      - Constant Field Values

  - ### KEY_F8

    public static final int KEY_F8
    See Also:
      - Constant Field Values

  - ### KEY_F9

    public static final int KEY_F9
    See Also:
      - Constant Field Values

  - ### KEY_F10

    public static final int KEY_F10
    See Also:
      - Constant Field Values

  - ### KEY_F11

    public static final int KEY_F11
    See Also:
      - Constant Field Values

  - ### KEY_F12

    public static final int KEY_F12
    See Also:
      - Constant Field Values

  - ### KEY_F13

    public static final int KEY_F13
    See Also:
      - Constant Field Values

  - ### KEY_F14

    public static final int KEY_F14
    See Also:
      - Constant Field Values

  - ### KEY_F15

    public static final int KEY_F15
    See Also:
      - Constant Field Values

  - ### KEY_F16

    public static final int KEY_F16
    See Also:
      - Constant Field Values

  - ### KEY_F17

    public static final int KEY_F17
    See Also:
      - Constant Field Values

  - ### KEY_F18

    public static final int KEY_F18
    See Also:
      - Constant Field Values

  - ### KEY_F19

    public static final int KEY_F19
    See Also:
      - Constant Field Values

  - ### KEY_F20

    public static final int KEY_F20
    See Also:
      - Constant Field Values

  - ### KEY_F21

    public static final int KEY_F21
    See Also:
      - Constant Field Values

  - ### KEY_F22

    public static final int KEY_F22
    See Also:
      - Constant Field Values

  - ### KEY_F23

    public static final int KEY_F23
    See Also:
      - Constant Field Values

  - ### KEY_F24

    public static final int KEY_F24
    See Also:
      - Constant Field Values

  - ### KEY_F25

    public static final int KEY_F25
    See Also:
      - Constant Field Values

  - ### KEY_KP_0

    public static final int KEY_KP_0
    See Also:
      - Constant Field Values

  - ### KEY_KP_1

    public static final int KEY_KP_1
    See Also:
      - Constant Field Values

  - ### KEY_KP_2

    public static final int KEY_KP_2
    See Also:
      - Constant Field Values

  - ### KEY_KP_3

    public static final int KEY_KP_3
    See Also:
      - Constant Field Values

  - ### KEY_KP_4

    public static final int KEY_KP_4
    See Also:
      - Constant Field Values

  - ### KEY_KP_5

    public static final int KEY_KP_5
    See Also:
      - Constant Field Values

  - ### KEY_KP_6

    public static final int KEY_KP_6
    See Also:
      - Constant Field Values

  - ### KEY_KP_7

    public static final int KEY_KP_7
    See Also:
      - Constant Field Values

  - ### KEY_KP_8

    public static final int KEY_KP_8
    See Also:
      - Constant Field Values

  - ### KEY_KP_9

    public static final int KEY_KP_9
    See Also:
      - Constant Field Values

  - ### KEY_KP_DECIMAL

    public static final int KEY_KP_DECIMAL
    See Also:
      - Constant Field Values

  - ### KEY_KP_DIVIDE

    public static final int KEY_KP_DIVIDE
    See Also:
      - Constant Field Values

  - ### KEY_KP_MULTIPLY

    public static final int KEY_KP_MULTIPLY
    See Also:
      - Constant Field Values

  - ### KEY_KP_SUBTRACT

    public static final int KEY_KP_SUBTRACT
    See Also:
      - Constant Field Values

  - ### KEY_KP_ADD

    public static final int KEY_KP_ADD
    See Also:
      - Constant Field Values

  - ### KEY_KP_ENTER

    public static final int KEY_KP_ENTER
    See Also:
      - Constant Field Values

  - ### KEY_KP_EQUAL

    public static final int KEY_KP_EQUAL
    See Also:
      - Constant Field Values

  - ### KEY_LEFT_SHIFT

    public static final int KEY_LEFT_SHIFT
    See Also:
      - Constant Field Values

  - ### KEY_LEFT_CONTROL

    public static final int KEY_LEFT_CONTROL
    See Also:
      - Constant Field Values

  - ### KEY_LEFT_ALT

    public static final int KEY_LEFT_ALT
    See Also:
      - Constant Field Values

  - ### KEY_LEFT_SUPER

    public static final int KEY_LEFT_SUPER
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT_SHIFT

    public static final int KEY_RIGHT_SHIFT
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT_CONTROL

    public static final int KEY_RIGHT_CONTROL
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT_ALT

    public static final int KEY_RIGHT_ALT
    See Also:
      - Constant Field Values

  - ### KEY_RIGHT_SUPER

    public static final int KEY_RIGHT_SUPER
    See Also:
      - Constant Field Values

  - ### KEY_MENU

    public static final int KEY_MENU
    See Also:
      - Constant Field Values

  - ### META_SHIFT_ON

    public static final int META_SHIFT_ON
    See Also:
      - Constant Field Values

  - ### META_CTRL_ON

    public static final int META_CTRL_ON

  - ### META_ALT_ON

    public static final int META_ALT_ON
    See Also:
      - Constant Field Values

  - ### META_SUPER_ON

    public static final int META_SUPER_ON
    See Also:
      - Constant Field Values

  - ### FLAG_SOFT_KEYBOARD

    public static final int FLAG_SOFT_KEYBOARD
    This mask is set if the key event was generated by a software keyboard.
    See Also:
      - Constant Field Values

  - ### FLAG_KEEP_TOUCH_MODE

    public static final int FLAG_KEEP_TOUCH_MODE
    This mask is set if we don't want the key event to cause us to leave touch mode.
    See Also:
      - Constant Field Values

  - ### FLAG_FROM_SYSTEM

    public static final int FLAG_FROM_SYSTEM
    This mask is set if an event was known to come from a trusted part of the system. That is, the event is known to come from the user, and could not have been spoofed by a third party component.
    See Also:
      - Constant Field Values

  - ### FLAG_EDITOR_ACTION

    public static final int FLAG_EDITOR_ACTION
    This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done". This allows TextView to dispatch these as normal enter keys for old applications, but still do the appropriate action when receiving them.
    See Also:
      - Constant Field Values

  - ### FLAG_CANCELED

    public static final int FLAG_CANCELED
    When associated with up key events, this indicates that the key press has been canceled. Typically this is used with virtual touch screen keys, where the user can slide from the virtual key area on to the display: in that case, the application will receive a canceled up event and should not perform the action normally associated with the key. Note that for this to work, the application can not perform an action for a key until it receives an up or the long press timeout has expired.
    See Also:
      - Constant Field Values

  - ### FLAG_VIRTUAL_HARD_KEY

    public static final int FLAG_VIRTUAL_HARD_KEY
    This key event was generated by a virtual (on-screen) hard key area. Typically this is an area of the touchscreen, outside of the regular display, dedicated to "hardware" buttons.
    See Also:
      - Constant Field Values

  - ### FLAG_LONG_PRESS

    public static final int FLAG_LONG_PRESS
    This flag is set for the first key repeat that occurs after the long press timeout.
    See Also:
      - Constant Field Values

  - ### FLAG_CANCELED_LONG_PRESS

    public static final int FLAG_CANCELED_LONG_PRESS
    Set when a key event has `FLAG_CANCELED` set because a long press action was executed while it was down.
    See Also:
      - Constant Field Values

  - ### FLAG_TRACKING

    public static final int FLAG_TRACKING
    Set for `ACTION_UP` when this event's key code is still being tracked from its initial down. That is, somebody requested that tracking started on the key down and a long press has not caused the tracking to be canceled.
    See Also:
      - Constant Field Values

  - ### FLAG_FALLBACK

    public static final int FLAG_FALLBACK
    Set when a key event has been synthesized to implement default behavior for an event that the application did not handle. Fallback key events are generated by unhandled trackball motions (to emulate a directional keypad) and by certain unhandled key presses that are declared in the key map (such as special function numeric keypad keys when numlock is off).
    See Also:
      - Constant Field Values

  - ### FLAG_PREDISPATCH

    public static final int FLAG_PREDISPATCH
    Signifies that the key is being predispatched.
    See Also:
      - Constant Field Values

  - ### FLAG_START_TRACKING

    public static final int FLAG_START_TRACKING
    Private control to determine when an app is tracking a key sequence.
    See Also:
      - Constant Field Values

  - ### ACTION_DOWN

    public static final int ACTION_DOWN
    `getAction()` value: the key has been pressed down.
    See Also:
      - Constant Field Values

  - ### ACTION_UP

    public static final int ACTION_UP
    `getAction()` value: the key has been released.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### obtain

    @NonNull public static KeyEvent obtain(long eventTime, int action, int code, int repeat, int modifiers, int scancode, int flags)

  - ### getAction

    public final int getAction()
    Retrieve the action of this key event. May be either `ACTION_DOWN` or `ACTION_UP`.
    Returns:
      The event action: ACTION_DOWN or ACTION_UP.

  - ### getKeyCode

    public final int getKeyCode()
    Retrieve the key code of the key event.
    Returns:
      The key code of the event.

  - ### getScanCode

    public final int getScanCode()
    Retrieve the hardware key id of this key event. These values are not reliable and vary from device to device.

  - ### getRepeatCount

    public final int getRepeatCount()
    Retrieve the repeat count of the event. For key down events, this is the number of times the key has repeated with the first down starting at 0 and counting up from there. For key up events, this is always equal to zero. For multiple key events, this is the number of down/up pairs that have occurred.
    Returns:
      The number of times the key has repeated.

  - ### getModifiers

    public final int getModifiers()
    Returns the state of the modifier keys.
    Returns:
      An integer in which each bit set to 1 represents a pressed modifier key.

  - ### hasNoModifiers

    public final boolean hasNoModifiers()
    Returns true if no modifier keys are pressed.
    Returns:
      True if no modifier keys are pressed.

  - ### hasModifiers

    public final boolean hasModifiers(int modifiers)
    Returns true if only the specified modifiers keys are pressed. Returns false if a different combination of modifier keys are pressed.

    If the specified modifier mask includes non-directional modifiers, such as `GLFW.GLFW_MOD_SHIFT`, then this method ensures that the modifier is pressed on either side.

    Parameters:
      `modifiers` - The modifier keys to check. May be a combination of modifier keys. May be 0 to ensure that no modifier keys are pressed.
    Returns:
      true if only the specified modifier keys are pressed.

  - ### isShiftPressed

    public final boolean isShiftPressed()
    Returns the pressed state of the SHIFT key.
    Returns:
      true if the SHIFT key is pressed, false otherwise

  - ### isCtrlPressed

    public final boolean isCtrlPressed()
    Returns the pressed state of the CTRL key. If it's running on OSX, returns the pressed state of the SUPER key.
    Returns:
      true if the CTRL key is pressed, false otherwise

  - ### isAltPressed

    public final boolean isAltPressed()
    Returns the pressed state of the ALT key.
    Returns:
      true if the ALT key is pressed, false otherwise

  - ### isSuperPressed

    public final boolean isSuperPressed()
    Returns the pressed state of the SUPER key (a.k.a. META or WIN key).
    Returns:
      true if the SUPER key is pressed, false otherwise

  - ### isCapsLockOn

    public final boolean isCapsLockOn()
    Returns the locked state of the CAPS LOCK key.
    Returns:
      true if the CAPS LOCK key is on, false otherwise

  - ### isNumLockOn

    public final boolean isNumLockOn()
    Returns the locked state of the NUM LOCK key.
    Returns:
      true if the NUM LOCK key is on, false otherwise

  - ### getMappedChar

    public final char getMappedChar()
    Returns the alphabetic character represented by the key. You should check if this is a PRESS action.
    Returns:
      the alphabetic character represented by the key

  - ### recycle

    public void recycle()
    Recycles the event. This object should not be ever used after recycling.

    This method should only be called by system.

    Specified by:
      `recycle` in class `InputEvent`

  - ### copy

    @NonNull public InputEvent copy()
    Description copied from class: `InputEvent`
    Copies the event.
    Specified by:
      `copy` in class `InputEvent`
    Returns:
      A deep copy of the event.

  - ### getEventTime

    public long getEventTime()
    Description copied from class: `InputEvent`
    Get the time in milliseconds that this event object is created in the GLFW time base
    Specified by:
      `getEventTime` in class `InputEvent`
    Returns:
      the time this event occurred

  - ### getEventTimeNano

    public long getEventTimeNano()
    Description copied from class: `InputEvent`
    Get the precise time in nanoseconds that this event object is created in the GLFW time base
    Specified by:
      `getEventTimeNano` in class `InputEvent`
    Returns:
      the time this event occurred

  - ### isCanceled

    public final boolean isCanceled()
    For `ACTION_UP` events, indicates that the event has been canceled as per `FLAG_CANCELED`.

  - ### cancel

    public final void cancel()
    Description copied from class: `InputEvent`
    Marks the input event as being canceled.
    Specified by:
      `cancel` in class `InputEvent`

  - ### startTracking

    public final void startTracking()
    Call this during
    invalid reference

        Callback#onKeyDown

    to have the system track the key through its final up (possibly including a long press). Note that only one key can be tracked at a time -- if another key down event is received while a previous one is being tracked, tracking is stopped on the previous event.

  - ### isTracking

    public final boolean isTracking()
    For `ACTION_UP` events, indicates that the event is still being tracked from its initial down event as per `FLAG_TRACKING`.

  - ### isLongPress

    public final boolean isLongPress()
    For `ACTION_DOWN` events, indicates that the event has been canceled as per `FLAG_LONG_PRESS`.

  - ### isModifierKey

    public static boolean isModifierKey(int keyCode)
    Returns true if this key code is a modifier key.

    For the purposes of this function, `KEY_CAPS_LOCK`, `KEY_SCROLL_LOCK`, and `KEY_NUM_LOCK` are not considered modifier keys. Consequently, this function return false for those keys.

    Returns:
      True if the key code is one of modifier keys.