Package org.openqa.selenium
Enum Class Keys
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<Keys>
,Constable
Representations of pressable keys that aren't text. These are stored in the Unicode PUA (Private
Use Area) code points, 0xE000-0xF8FF.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) static String
chord
(CharSequence... value) Simulate pressing many keys at once in a "chord".static String
chord
(Iterable<CharSequence> value) int
static @Nullable Keys
getKeyFromUnicode
(char key) Get the special key representation,Keys
, of the supplied character if there is one.int
length()
subSequence
(int start, int end) toString()
static Keys
Returns the enum constant of this class with the specified name.static Keys[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Enum Constant Details
-
NULL
-
CANCEL
-
HELP
-
BACK_SPACE
-
TAB
-
CLEAR
-
RETURN
-
ENTER
-
SHIFT
-
LEFT_SHIFT
-
CONTROL
-
LEFT_CONTROL
-
ALT
-
LEFT_ALT
-
PAUSE
-
ESCAPE
-
SPACE
-
PAGE_UP
-
PAGE_DOWN
-
END
-
HOME
-
LEFT
-
ARROW_LEFT
-
UP
-
ARROW_UP
-
RIGHT
-
ARROW_RIGHT
-
DOWN
-
ARROW_DOWN
-
INSERT
-
DELETE
-
SEMICOLON
-
EQUALS
-
NUMPAD0
-
NUMPAD1
-
NUMPAD2
-
NUMPAD3
-
NUMPAD4
-
NUMPAD5
-
NUMPAD6
-
NUMPAD7
-
NUMPAD8
-
NUMPAD9
-
MULTIPLY
-
ADD
-
SEPARATOR
-
SUBTRACT
-
DECIMAL
-
DIVIDE
-
F1
-
F2
-
F3
-
F4
-
F5
-
F6
-
F7
-
F8
-
F9
-
F10
-
F11
-
F12
-
META
-
COMMAND
-
ZENKAKU_HANKAKU
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getCodePoint
public int getCodePoint() -
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classEnum<Keys>
-
chord
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
- Parameters:
value
- characters to send- Returns:
- String representation of the char sequence
- See Also:
-
getKeyFromUnicode
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
-