public class HotkeyManager extends EventQueue
Modifier and Type | Method and Description |
---|---|
void |
addHotkey(KeyStroke keyS,
Action keyA)
add a hotkey
|
void |
addHotkey(KeyStroke keyS,
Object mapKey,
Action keyA)
add a hotkey
|
protected void |
dispatchEvent(AWTEvent event)
listen for keyboard event
|
ActionMap |
getActionMap()
return list of available keyboard action maps
|
InputMap |
getInputMap()
return list of available keyboard input maps
|
static HotkeyManager |
getInstance()
get current instance of global hotkey manager
|
void |
removeHotkey(KeyStroke keyS)
remove a hotkey
|
createSecondaryLoop, getCurrentEvent, getMostRecentEventTime, getNextEvent, invokeAndWait, invokeLater, isDispatchThread, peekEvent, peekEvent, pop, postEvent, push
public static HotkeyManager getInstance()
public void addHotkey(KeyStroke keyS, Action keyA)
keyS
- which keystrokekeyA
- action to be performedpublic void addHotkey(KeyStroke keyS, Object mapKey, Action keyA)
keyS
- which keystrokemapKey
- map key to actionkeyA
- action to be performedpublic void removeHotkey(KeyStroke keyS)
keyS
- which keystroke to remove from list of hotkeyspublic InputMap getInputMap()
public ActionMap getActionMap()
protected void dispatchEvent(AWTEvent event)
dispatchEvent
in class EventQueue
event
- an event