Enum Class Keys

java.lang.Object
java.lang.Enum<Keys>
org.openqa.selenium.Keys
All Implemented Interfaces:
Serializable, CharSequence, Comparable<Keys>, Constable

public enum Keys extends Enum<Keys> implements CharSequence
Representations of pressable keys that aren't text. These are stored in the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF.
See Also:
  • Enum Constant Details

    • NULL

      public static final Keys NULL
    • CANCEL

      public static final Keys CANCEL
    • HELP

      public static final Keys HELP
    • BACK_SPACE

      public static final Keys BACK_SPACE
    • TAB

      public static final Keys TAB
    • CLEAR

      public static final Keys CLEAR
    • RETURN

      public static final Keys RETURN
    • ENTER

      public static final Keys ENTER
    • SHIFT

      public static final Keys SHIFT
    • LEFT_SHIFT

      public static final Keys LEFT_SHIFT
    • CONTROL

      public static final Keys CONTROL
    • LEFT_CONTROL

      public static final Keys LEFT_CONTROL
    • ALT

      public static final Keys ALT
    • LEFT_ALT

      public static final Keys LEFT_ALT
    • PAUSE

      public static final Keys PAUSE
    • ESCAPE

      public static final Keys ESCAPE
    • SPACE

      public static final Keys SPACE
    • PAGE_UP

      public static final Keys PAGE_UP
    • PAGE_DOWN

      public static final Keys PAGE_DOWN
    • END

      public static final Keys END
    • HOME

      public static final Keys HOME
    • LEFT

      public static final Keys LEFT
    • ARROW_LEFT

      public static final Keys ARROW_LEFT
    • UP

      public static final Keys UP
    • ARROW_UP

      public static final Keys ARROW_UP
    • ARROW_RIGHT

      public static final Keys ARROW_RIGHT
    • DOWN

      public static final Keys DOWN
    • ARROW_DOWN

      public static final Keys ARROW_DOWN
    • INSERT

      public static final Keys INSERT
    • DELETE

      public static final Keys DELETE
    • SEMICOLON

      public static final Keys SEMICOLON
    • EQUALS

      public static final Keys EQUALS
    • NUMPAD0

      public static final Keys NUMPAD0
    • NUMPAD1

      public static final Keys NUMPAD1
    • NUMPAD2

      public static final Keys NUMPAD2
    • NUMPAD3

      public static final Keys NUMPAD3
    • NUMPAD4

      public static final Keys NUMPAD4
    • NUMPAD5

      public static final Keys NUMPAD5
    • NUMPAD6

      public static final Keys NUMPAD6
    • NUMPAD7

      public static final Keys NUMPAD7
    • NUMPAD8

      public static final Keys NUMPAD8
    • NUMPAD9

      public static final Keys NUMPAD9
    • MULTIPLY

      public static final Keys MULTIPLY
    • ADD

      public static final Keys ADD
    • SEPARATOR

      public static final Keys SEPARATOR
    • SUBTRACT

      public static final Keys SUBTRACT
    • DECIMAL

      public static final Keys DECIMAL
    • DIVIDE

      public static final Keys DIVIDE
    • F1

      public static final Keys F1
    • F2

      public static final Keys F2
    • F3

      public static final Keys F3
    • F4

      public static final Keys F4
    • F5

      public static final Keys F5
    • F6

      public static final Keys F6
    • F7

      public static final Keys F7
    • F8

      public static final Keys F8
    • F9

      public static final Keys F9
    • F10

      public static final Keys F10
    • F11

      public static final Keys F11
    • F12

      public static final Keys F12
    • META

      public static final Keys META
    • COMMAND

      public static final Keys COMMAND
    • ZENKAKU_HANKAKU

      public static final Keys ZENKAKU_HANKAKU
  • Method Details

    • values

      public static Keys[] 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 Keys 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
    • getCodePoint

      public int getCodePoint()
    • charAt

      public char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • subSequence

      public CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • toString

      public String toString()
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Enum<Keys>
    • chord

      public static String chord(CharSequence... value)
      Simulate pressing many keys at once in a "chord". Takes a sequence of Keys.XXXX or strings; appends each of the values to a string, and adds the chord termination key (Keys.NULL) and returns the resultant string.

      Note: When the low-level webdriver key handlers see Keys.NULL, active modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event.

      Parameters:
      value - characters to send
      Returns:
      String representation of the char sequence
    • chord

      public static String chord(Iterable<CharSequence> value)
      Parameters:
      value - characters to send
      Returns:
      String representation of the char sequence
      See Also:
    • getKeyFromUnicode

      public static Keys getKeyFromUnicode(char key)
      Get the special key representation, Keys, of the supplied character if there is one. If there is no special key tied to this character, null will be returned.
      Parameters:
      key - unicode character code
      Returns:
      special key linked to the character code, or null if character is not a special key