public class KeyboardShortcutsService extends Object implements KeyboardShortcutsApi
KeyboardShortcutsApi
implementation used when envelope API is availableKeyboardShortcutsApi.Action
Constructor and Description |
---|
KeyboardShortcutsService() |
Modifier and Type | Method and Description |
---|---|
void |
deregister(int id)
Deregister a Keyboard Shortcut.
|
int |
registerKeyDownThenUp(String combination,
String label,
KeyboardShortcutsApi.Action onKeyDown,
KeyboardShortcutsApi.Action onKeyUp,
KeyboardShortcutsApiOpts opts)
Register a Keyboard Shortcuts for a keypress event.
|
int |
registerKeyPress(String combination,
String label,
KeyboardShortcutsApi.Action onKeyDown,
KeyboardShortcutsApiOpts opts)
Register a Keyboard Shortcuts for a keypress event.
|
public int registerKeyPress(String combination, String label, KeyboardShortcutsApi.Action onKeyDown, KeyboardShortcutsApiOpts opts)
KeyboardShortcutsApi
registerKeyPress
in interface KeyboardShortcutsApi
combination
- The combination of keys that trigger 'onKeyDown' action. This is shown on the Keyboard Shortcuts panel.label
- The label for this Keyboard Shortcut. This is shown on the Keyboard Shortcuts panel. Use a `|` character to separate its section from its description. (e.g. "Moving | Arrow up")onKeyDown
- The action to be executed when 'combination' is pressed.opts
- Options of this registration.public int registerKeyDownThenUp(String combination, String label, KeyboardShortcutsApi.Action onKeyDown, KeyboardShortcutsApi.Action onKeyUp, KeyboardShortcutsApiOpts opts)
KeyboardShortcutsApi
registerKeyDownThenUp
in interface KeyboardShortcutsApi
combination
- The combination of keys that trigger 'onKeyDown' action when they're pressed and 'onKeyUp' when they're released. This is shown on the Keyboard Shortcuts panel.label
- The label for this Keyboard Shortcut. This is shown on the Keyboard Shortcuts panel. Use a `|` character to separate its section from its description. (e.g. "Moving | Arrow up")onKeyDown
- The action to be executed when 'combination' is pressed.onKeyUp
- The action to be executed when 'combination' is released.opts
- Options of this registration.public void deregister(int id)
KeyboardShortcutsApi
deregister
in interface KeyboardShortcutsApi
id
- The id obtained when registering a Keyboard Shortcut.Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.