Enum KeyboardModifierKey
- java.lang.Object
-
- java.lang.Enum<KeyboardModifierKey>
-
- org.pepstock.charba.client.dom.enums.KeyboardModifierKey
-
- All Implemented Interfaces:
Serializable,Comparable<KeyboardModifierKey>,Key,IsKeyboardKey
public enum KeyboardModifierKey extends Enum<KeyboardModifierKey> implements IsKeyboardKey
Enumerates the modifiers which are special keys which are used to generate special characters or cause special actions when used in combination with other keys.- Author:
- Andrea "Stock" Stocchero
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALTThe Alt (Alternative) key.ALT_GRAPHThe AltGr or AltGraph (Alternate Graphics) key.CAPS_LOCKThe Caps Lock key.CONTROLThe Control, Ctrl, or Ctl key.METAThe Meta key.NUM_LOCKThe NumLock (Number Lock) key.OSThe Windows key, sometimes is reported instead of asMETA.SCROLL_LOCKThe Scroll Lock key.SHIFTThe Shift key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanarePressed(NativeBaseEvent event, KeyboardModifierKey... keys)Returnstrueif all modifier keys are pressed when the event was emitted.static booleanarePressed(HasNativeEvent event, KeyboardModifierKey... keys)Returnstrueif all modifier keys are pressed when the event was emitted.booleanisPressed(NativeBaseEvent event)Returnstrueif the modifier key is pressed when the event was emitted.booleanisPressed(HasNativeEvent event)Returnstrueif the modifier key is pressed when the event was emitted.Stringvalue()Returns the name value of propertystatic KeyboardModifierKeyvalueOf(String name)Returns the enum constant of this type with the specified name.static KeyboardModifierKey[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.pepstock.charba.client.dom.enums.IsKeyboardKey
is, is, is
-
-
-
-
Enum Constant Detail
-
ALT
public static final KeyboardModifierKey ALT
The Alt (Alternative) key.
-
ALT_GRAPH
public static final KeyboardModifierKey ALT_GRAPH
The AltGr or AltGraph (Alternate Graphics) key. Enables the ISO Level 3 shift modifier (where Shift is the level 2 modifier).
-
CAPS_LOCK
public static final KeyboardModifierKey CAPS_LOCK
The Caps Lock key. Toggles the capital character lock on and off for subsequent input.
-
CONTROL
public static final KeyboardModifierKey CONTROL
The Control, Ctrl, or Ctl key. Allows typing control characters.
-
META
public static final KeyboardModifierKey META
The Meta key. Allows issuing special command inputs.
-
NUM_LOCK
public static final KeyboardModifierKey NUM_LOCK
The NumLock (Number Lock) key. Toggles the numeric keypad between number entry some other mode (often directional arrows).
-
OS
public static final KeyboardModifierKey OS
The Windows key, sometimes is reported instead of asMETA.
-
SCROLL_LOCK
public static final KeyboardModifierKey SCROLL_LOCK
The Scroll Lock key. Toggles between scrolling and cursor movement modes.
-
SHIFT
public static final KeyboardModifierKey SHIFT
The Shift key. Modifies keystrokes to allow typing upper (or other) case letters, and to support typing punctuation and other special characters.
-
-
Method Detail
-
values
public static KeyboardModifierKey[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KeyboardModifierKey c : KeyboardModifierKey.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KeyboardModifierKey valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
value
public String value()
Description copied from interface:KeyReturns the name value of property
-
isPressed
public boolean isPressed(HasNativeEvent event)
Returnstrueif the modifier key is pressed when the event was emitted.- Parameters:
event- instance of event container to be checked- Returns:
trueif the modifier key is pressed when the event was emitted
-
isPressed
public boolean isPressed(NativeBaseEvent event)
Returnstrueif the modifier key is pressed when the event was emitted.- Parameters:
event- instance of native event to be checked- Returns:
trueif the modifier key is pressed when the event was emitted
-
arePressed
public static boolean arePressed(HasNativeEvent event, KeyboardModifierKey... keys)
Returnstrueif all modifier keys are pressed when the event was emitted.- Parameters:
event- instance of event container to be checkedkeys- array of keys to be checked against the event- Returns:
trueif the modifier key is pressed when the event was emitted
-
arePressed
public static boolean arePressed(NativeBaseEvent event, KeyboardModifierKey... keys)
Returnstrueif all modifier keys are pressed when the event was emitted.- Parameters:
event- instance of native event to be checkedkeys- array of keys to be checked against the event- Returns:
trueif the modifier key is pressed when the event was emitted
-
-