KeyCodeCombination or key
character - KeyCharacterCombination. A modifier key is shift,
control, alt, meta or shortcut and can be
defined as DOWN, UP or ANY.
The shortcut modifier is used to represent the modifier key which is
used commonly in keyboard shortcuts on the host platform. This is for
example control on Windows and meta (command key) on Mac.
By using shortcut key modifier developers can create platform
independent shortcuts. So the "Shortcut+C" key combination is handled
internally as "Ctrl+C" on Windows and "Meta+C" on Mac.
| Modifier and Type | Class and Description |
|---|---|
| public static class | KeyCombination.
This class represents a pair of modifier key and its value. |
| public static enum | KeyCombination.
|
| Modifier and Type | Field and Description |
|---|---|
| private final KeyCombination. | alt
The state of the |
| public static final KeyCombination. | ALT_ANY
Modifier which specifies that the |
| public static final KeyCombination. | ALT_DOWN
Modifier which specifies that the |
| private final KeyCombination. | control
The state of the |
| public static final KeyCombination. | CONTROL_ANY
Modifier which specifies that the |
| public static final KeyCombination. | CONTROL_DOWN
Modifier which specifies that the |
| private final KeyCombination. | meta
The state of the |
| public static final KeyCombination. | META_ANY
Modifier which specifies that the |
| public static final KeyCombination. | META_DOWN
Modifier which specifies that the |
| public static final KeyCombination | NO_MATCH
A KeyCombination that will match with no events. |
| private static final KeyCombination. | |
| private final KeyCombination. | shift
The state of the |
| public static final KeyCombination. | SHIFT_ANY
Modifier which specifies that the |
| public static final KeyCombination. | SHIFT_DOWN
Modifier which specifies that the |
| private final KeyCombination. | shortcut
The state of the |
| public static final KeyCombination. | SHORTCUT_ANY
Modifier which specifies that the |
| public static final KeyCombination. | SHORTCUT_DOWN
Modifier which specifies that the |
| Access | Constructor and Description |
|---|---|
| protected | KeyCombination(final KeyCombination.
the value of the shift,shift modifier keythe value of the control,control modifier keythe value of the alt,alt modifier keythe value of the meta,meta modifier keythe value of the shortcutshortcut modifier keyConstructs a |
| protected | KeyCombination(final KeyCombination.
the list of modifier keys and their corresponding values modifiersConstructs a |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addModifierIntoString(final StringBuilder sb, final KeyCode modifierKey, final KeyCombination.
|
| private void | |
| public boolean | Returns: true if the objects are equal, false otherwisethe object to compare to obj)Overrides java. Tests whether this |
| public final KeyCombination. | Returns: The state of thealt key in this key combination.The state of the |
| public final KeyCombination. | Returns: The state of thecontrol key in this key combinationThe state of the |
| public String | Returns: A string representation of thisKeyCombination, suitable
for display in a user interface.Returns a string representation of this |
| public final KeyCombination. | Returns: The state of themeta key in this key combinationThe state of the |
| pack-priv static KeyCombination. | |
| private static KeyCombination. | |
| public String | Returns: the string representation of thisKeyCombinationReturns a string representation of this |
| public final KeyCombination. | Returns: The state of theshift key in this key combinationThe state of the |
| public final KeyCombination. | Returns: The state of theshortcut key in this key combinationThe state of the |
| public int | Returns: the hash code valueOverrides java. Returns a hash code value for this |
| public static KeyCombination | Returns: the constructedKeyCombinationthe string which represents the requested key combination name)Constructs a new |
| public boolean | |
| private static String | |
| private static KeyCombination. | resolveModifierValue(final KeyCombination.
|
| private static String[] | |
| private static boolean | test(final KeyCode testedModifierKey, final KeyCombination.
|
| private static boolean | |
| public String | Returns: the string representation of thisKeyCombinationOverrides java. Returns a string representation of this object. |
| public static KeyCombination |
| alt | back to summary |
|---|---|
| private final KeyCombination. The state of the | |
| ALT_ANY | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| ALT_DOWN | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| control | back to summary |
|---|---|
| private final KeyCombination. The state of the | |
| CONTROL_ANY | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| CONTROL_DOWN | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| meta | back to summary |
|---|---|
| private final KeyCombination. The state of the | |
| META_ANY | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| META_DOWN | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| NO_MATCH | back to summary |
|---|---|
| public static final KeyCombination NO_MATCH A KeyCombination that will match with no events. | |
| POSSIBLE_MODIFIERS | back to summary |
|---|---|
| private static final KeyCombination. | |
| shift | back to summary |
|---|---|
| private final KeyCombination. The state of the | |
| SHIFT_ANY | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| SHIFT_DOWN | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| shortcut | back to summary |
|---|---|
| private final KeyCombination. The state of the | |
| SHORTCUT_ANY | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| SHORTCUT_DOWN | back to summary |
|---|---|
| public static final KeyCombination. Modifier which specifies that the | |
| KeyCombination | back to summary |
|---|---|
| protected KeyCombination(final KeyCombination. Constructs a
| |
| KeyCombination | back to summary |
|---|---|
| protected KeyCombination(final KeyCombination. Constructs a
All possible modifiers which change the default modifier value are
defined as constants in the
| |
| addModifierIntoString | back to summary |
|---|---|
| private static void addModifierIntoString(final StringBuilder sb, final KeyCode modifierKey, final KeyCombination. | |
| addModifiersIntoString | back to summary |
|---|---|
| private void addModifiersIntoString(final StringBuilder sb) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Tests whether this | |
| getAlt | back to summary |
|---|---|
| public final KeyCombination. The state of the
| |
| getControl | back to summary |
|---|---|
| public final KeyCombination. The state of the
| |
| getDisplayText | back to summary |
|---|---|
| public String getDisplayText() Returns a string representation of this
| |
| getMeta | back to summary |
|---|---|
| public final KeyCombination. The state of the
| |
| getModifier | back to summary |
|---|---|
| pack-priv static KeyCombination. | |
| getModifierValue | back to summary |
|---|---|
| private static KeyCombination. | |
| getName | back to summary |
|---|---|
| public String getName() Returns a string representation of this The string representation consists of sections separated by plus characters. Each section specifies either a modifier key or the main key.
A modifier key section contains the
The format of the main key section of the key combination string depends
on the
Examples of "Ctrl+Alt+Q" "Ignore Shift+Ctrl+A" "Alt+'w'"
| |
| getShift | back to summary |
|---|---|
| public final KeyCombination. The state of the
| |
| getShortcut | back to summary |
|---|---|
| public final KeyCombination. The state of the
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for this
| |
| keyCombination | back to summary |
|---|---|
| public static KeyCombination keyCombination(String name) Constructs a new
| |
| match | back to summary |
|---|---|
| public boolean match(final KeyEvent event) Tests whether this key combination matches the combination in the given
The implementation of this method in the
| |
| normalizeToken | back to summary |
|---|---|
| private static String normalizeToken(final String token) | |
| resolveModifierValue | back to summary |
|---|---|
| private static KeyCombination. | |
| splitName | back to summary |
|---|---|
| private static String[] splitName(String name) | |
| test | back to summary |
|---|---|
| private static boolean test(final KeyCode testedModifierKey, final KeyCombination. | |
| test | back to summary |
|---|---|
| private static boolean test(final KeyCombination. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this object. Implementation returns
the result of the | |
| valueOf | back to summary |
|---|---|
| public static KeyCombination valueOf(String value) Constructs a new
If the main key section string is quoted in single quotes the method
creates a new
| |
| Modifier and Type | Field and Description |
|---|---|
| private final KeyCode | |
| private final KeyCombination. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public KeyCode | |
| public KeyCombination. | |
| public String | Returns: a string representation of the modifierOverrides java. Returns a string representation of the modifier. |
| key | back to summary |
|---|---|
| private final KeyCode key | |
| value | back to summary |
|---|---|
| private final KeyCombination. | |
| Modifier | back to summary |
|---|---|
| private Modifier(final KeyCode key, final KeyCombination. | |
| getKey | back to summary |
|---|---|
| public KeyCode getKey() Gets the modifier key of this
| |
| getValue | back to summary |
|---|---|
| public KeyCombination. Gets the modifier value of this
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the modifier. | |
ModifierValue specifies state of modifier keys.
| Modifier and Type | Field and Description |
|---|---|
| public static final KeyCombination. | ANY
Constant which indicates that the modifier key can be either up or down. |
| public static final KeyCombination. | DOWN
Constant which indicates that the modifier key must be down. |
| public static final KeyCombination. | UP
Constant which indicates that the modifier key must be up. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static KeyCombination. | |
| public static KeyCombination. |
| ANY | back to summary |
|---|---|
| public static final KeyCombination. Constant which indicates that the modifier key can be either up or down. | |
| DOWN | back to summary |
|---|---|
| public static final KeyCombination. Constant which indicates that the modifier key must be down. | |
| UP | back to summary |
|---|---|
| public static final KeyCombination. Constant which indicates that the modifier key must be up. | |
| ModifierValue | back to summary |
|---|---|
| private ModifierValue() | |
| valueOf | back to summary |
|---|---|
| public static KeyCombination. | |
| values | back to summary |
|---|---|
| public static KeyCombination. | |