public final class KeyboardShortcut extends Shortcut
KeyboardEvent
shortcuts.
Keyboard shortcuts can be of one out of two forms: 1. Characters (e.g., 'a'); 2. Virtual keys (e.g., right arrow key); or, 2. Key combinations (e.g., CTRL key + virtual key representing 'a').
Constructor and Description |
---|
KeyboardShortcut(char k)
Defines a keyboard shortcut from the given character.
|
KeyboardShortcut(int vk)
Defines a keyboard shortcut from the given virtual key.
|
KeyboardShortcut(int m,
int vk)
Defines a keyboard shortcut from the given modifier mask and virtual key combination.
|
Modifier and Type | Method and Description |
---|---|
String |
description()
Shortcut description.
|
boolean |
equals(Object obj) |
Class<? extends KeyboardEvent> |
eventClass()
Returns the event class this shortcut is to be attached to.
|
char |
getKey()
Returns the keyboard-shortcut key.
|
int |
hashCode() |
static boolean |
hasID(int id)
Same as
return Shortcut.hasID(KeyboardShortcut.class, id) . |
static int |
registerID(int id,
String description)
Same as
return Shortcut.registerID(KeyboardShortcut.class, id, description) . |
hasID, id, modifiers, registerID, registerID, registerID
public KeyboardShortcut(char k)
k
- the character that defines the keyboard shortcut.public KeyboardShortcut(int m, int vk)
m
- the maskvk
- the virtual key that defines the keyboard shortcut.public KeyboardShortcut(int vk)
vk
- the virtual key that defines the keyboard shortcut.public Class<? extends KeyboardEvent> eventClass()
Shortcut
Shortcut.defaultEventClass()
public static int registerID(int id, String description)
return Shortcut.registerID(KeyboardShortcut.class, id, description)
.public static boolean hasID(int id)
return Shortcut.hasID(KeyboardShortcut.class, id)
.public String description()
Shortcut
description
in class Shortcut
public char getKey()
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia