public enum ModifierKey extends Enum<ModifierKey> implements Key
Enum Constant and Description |
---|
ALT
Used in combination with the numeric keypad for entering Alt codes, which output special characters;
|
CTRL
Used for entering keyboard shortcuts.
|
META
Used for entering keyboard shortcuts.
|
SHIFT
Used for capitalizing letters and entering different types of symbols.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
arePressed(AbstractEvent event,
ModifierKey... keys)
Returns
true if all modifier keys are pressed when the event was emitted. |
static boolean |
arePressed(BaseNativeEvent event,
ModifierKey... keys)
Returns
true if all modifier keys are pressed when the event was emitted. |
static boolean |
arePressed(ChartEventContext event,
ModifierKey... keys)
Returns
true if all modifier keys are pressed when the event was emitted. |
Div |
getElement()
Returns the
Div element which describes the modifier key.It can be used in UI if needed. |
boolean |
isPressed(AbstractEvent event)
Returns
true if the modifier key is pressed when the event was emitted. |
boolean |
isPressed(BaseNativeEvent event)
Returns
true if the modifier key is pressed when the event was emitted. |
boolean |
isPressed(ChartEventContext event)
Returns
true if the modifier key is pressed when the event was emitted. |
String |
value()
Returns the name value of property
|
static ModifierKey |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ModifierKey[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
checkAndGetIfValid, checkIfValid, compare, create, equals, getKeyByValue, getKeyByValue, hasKeyByValue, isValid
public static final ModifierKey ALT
public static final ModifierKey CTRL
public static final ModifierKey META
public static final ModifierKey SHIFT
public static ModifierKey[] values()
for (ModifierKey c : ModifierKey.values()) System.out.println(c);
public static ModifierKey valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String value()
Key
public Div getElement()
Div
element which describes the modifier key.Div
element which describes the modifier keypublic boolean isPressed(AbstractEvent event)
true
if the modifier key is pressed when the event was emitted.event
- instance of CHARBA event to be checkedtrue
if the modifier key is pressed when the event was emittedpublic boolean isPressed(ChartEventContext event)
true
if the modifier key is pressed when the event was emitted.event
- instance of CHARBA event to be checkedtrue
if the modifier key is pressed when the event was emittedpublic boolean isPressed(BaseNativeEvent event)
true
if the modifier key is pressed when the event was emitted.event
- instance of native event to be checkedtrue
if the modifier key is pressed when the event was emittedpublic static boolean arePressed(AbstractEvent event, ModifierKey... keys)
true
if all modifier keys are pressed when the event was emitted.event
- instance of CHARBA event to be checkedkeys
- array of keys to be checked against the eventtrue
if the modifier key is pressed when the event was emittedpublic static boolean arePressed(ChartEventContext event, ModifierKey... keys)
true
if all modifier keys are pressed when the event was emitted.event
- instance of CHARBA event to be checkedkeys
- array of keys to be checked against the eventtrue
if the modifier key is pressed when the event was emittedpublic static boolean arePressed(BaseNativeEvent event, ModifierKey... keys)
true
if all modifier keys are pressed when the event was emitted.event
- instance of native event to be checkedkeys
- array of keys to be checked against the eventtrue
if the modifier key is pressed when the event was emitted