public class Shortcut extends Object implements ShortcutAction.KeyCode, ShortcutAction.ModifierKey
Action
.
It consists of a keyCode
and modifiers
, e.g.
ShortcutAction.KeyCode.S
and ShortcutAction.ModifierKey.CTRL
.
A, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, B, BACKSPACE, C, D, DELETE, E, END, ENTER, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, G, H, HOME, I, INSERT, J, K, L, M, N, NUM0, NUM1, NUM2, NUM3, NUM4, NUM5, NUM6, NUM7, NUM8, NUM9, O, P, PAGE_DOWN, PAGE_UP, Q, R, S, SPACEBAR, T, TAB, U, V, W, X, Y, Z
ALT, CTRL, META, SHIFT
Constructor and Description |
---|
Shortcut(int keyCode,
int... modifiers)
Creates a shortcut object with the given key code and optional modifiers.
|
Modifier and Type | Method and Description |
---|---|
int |
getKeyCode()
Get the
ShortcutAction.KeyCode that this shortcut reacts to (in combination with
the ShortcutAction.ModifierKey s). |
int[] |
getModifiers()
Get the
ShortcutAction.ModifierKey s required for the shortcut to react. |
public Shortcut(int keyCode, int... modifiers)
keyCode
- ShortcutAction.KeyCode
that the shortcut reacts tomodifiers
- optional ShortcutAction.ModifierKey
spublic int getKeyCode()
ShortcutAction.KeyCode
that this shortcut reacts to (in combination with
the ShortcutAction.ModifierKey
s).public int[] getModifiers()
ShortcutAction.ModifierKey
s required for the shortcut to react.