Enum Class Key

java.lang.Object
java.lang.Enum<Key>
org.jboss.elemento.Key
All Implemented Interfaces:
Serializable, Comparable<Key>, Constable

public enum Key extends Enum<Key>
Selected key values according to https://www.w3.org/TR/DOM-Level-3-Events-key/.

body().on(keydown, e -> {
    if (Escape.match(e)) {
        // ...
    } else {
        // ...
    }
});
See Also:
  • Enum Constant Details

    • Accept

      public static final Key Accept
    • Again

      public static final Key Again
    • Alt

      public static final Key Alt
    • AltGraph

      public static final Key AltGraph
    • ArrowDown

      public static final Key ArrowDown
    • ArrowLeft

      public static final Key ArrowLeft
    • ArrowRight

      public static final Key ArrowRight
    • ArrowUp

      public static final Key ArrowUp
    • Attn

      public static final Key Attn
    • Backspace

      public static final Key Backspace
    • BrightnessDown

      public static final Key BrightnessDown
    • BrightnessUp

      public static final Key BrightnessUp
    • Cancel

      public static final Key Cancel
    • CapsLock

      public static final Key CapsLock
    • Clear

      public static final Key Clear
    • ContextMenu

      public static final Key ContextMenu
    • Control

      public static final Key Control
    • Copy

      public static final Key Copy
    • CrSel

      public static final Key CrSel
    • Cut

      public static final Key Cut
    • Delete

      public static final Key Delete
    • Eject

      public static final Key Eject
    • End

      public static final Key End
    • Enter

      public static final Key Enter
    • EraseEof

      public static final Key EraseEof
    • Escape

      public static final Key Escape
    • Execute

      public static final Key Execute
    • ExSel

      public static final Key ExSel
    • F1

      public static final Key F1
    • F10

      public static final Key F10
    • F11

      public static final Key F11
    • F13

      public static final Key F13
    • F14

      public static final Key F14
    • F15

      public static final Key F15
    • F16

      public static final Key F16
    • F17

      public static final Key F17
    • F18

      public static final Key F18
    • F19

      public static final Key F19
    • F2

      public static final Key F2
    • F20

      public static final Key F20
    • F3

      public static final Key F3
    • F4

      public static final Key F4
    • F5

      public static final Key F5
    • F6

      public static final Key F6
    • F7

      public static final Key F7
    • F8

      public static final Key F8
    • F9

      public static final Key F9
    • Find

      public static final Key Find
    • Finish

      public static final Key Finish
    • Fn

      public static final Key Fn
    • FnLock

      public static final Key FnLock
    • Help

      public static final Key Help
    • Hibernate

      public static final Key Hibernate
    • Home

      public static final Key Home
    • Insert

      public static final Key Insert
    • LogOff

      public static final Key LogOff
    • Meta

      public static final Key Meta
    • NumLock

      public static final Key NumLock
    • PageDown

      public static final Key PageDown
    • PageUp

      public static final Key PageUp
    • Paste

      public static final Key Paste
    • Pause

      public static final Key Pause
    • Play

      public static final Key Play
    • Power

      public static final Key Power
    • PowerOff

      public static final Key PowerOff
    • PrintScreen

      public static final Key PrintScreen
    • Props

      public static final Key Props
    • Redo

      public static final Key Redo
    • ScrollLock

      public static final Key ScrollLock
    • Select

      public static final Key Select
    • Shift

      public static final Key Shift
    • Soft1

      public static final Key Soft1
    • Soft2

      public static final Key Soft2
    • Soft3

      public static final Key Soft3
    • Soft4

      public static final Key Soft4
    • Spacebar

      public static final Key Spacebar
    • Standby

      public static final Key Standby
    • Symbol

      public static final Key Symbol
    • SymbolLock

      public static final Key SymbolLock
    • Tab

      public static final Key Tab
    • Undo

      public static final Key Undo
    • Unidentified

      public static final Key Unidentified
    • WakeUp

      public static final Key WakeUp
    • ZoomIn

      public static final Key ZoomIn
    • ZoomOut

      public static final Key ZoomOut
  • Method Details

    • values

      public static Key[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Key valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromEvent

      public static Key fromEvent(KeyboardEvent event)
      Returns the key for the specified event or Unidentified if no matching event could be found.
    • match

      public boolean match(Event event)
      Whether the event is a keyboard event and matches to the key of the event.
    • match

      public boolean match(KeyboardEvent event)
      Whether the event matches to the key of the event.