keyboardShortcut(keys)
Class: Menu.
Description:
Sets keyboard shortcut (accelerators) to menu item type of components: MenuItem, CheckBoxMenuItem, RadioButtonMenuItem. See examples below. Allows to activate the menu item action using specified keyboard key combination on keyboard. This shortcut is usually display in the right side of the mnu item's text.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
string |
Key combination as a string. See example how to construct it. |
Returns:
String Description of keyboard shortcut
Examples:
Modifiers: CTRL|CONTROL|SHIFT|ALT|ALTGRAPH|META
Keys: A-Z|0-9|NUMPAD[0-9]|SPACE|INSERT|ESCAPE|F[1-24]|TAB|ADD|SUBTRACT|DELETE|BACK_SPACE|BACK_SLASH|
BRACELEFT|BRACERIGHT|OPEN_BRACKET|CLOSE_BRACKET|SEMICOLON|COMMA|CAPS_LOCK|BACK_QUOTE|MINUS|PERIOD|
UP|DOWN|RIGHT|LEFT|MULTIPLY|DIVIDE|NUM_LOCK|HOME|END|PAGE_UP|PAGE_DOWN|PAUSE|SCROLL_LOCK|WINDOWS|
CONTEXT_MENU|DECIMAL|ENTER
Example key combinations: CTRL+Q, ALT+F1, CTRL+SHIFT+5, CTRL+N4, META+SHIFT+6, DELETE+SHIFT, SHIFT+UP, CTRL+OPEN_BRACKET, ATL+DOWN
menuItem1.keyboardShortcut("CTRL+Q");
menuItemUP.keyboardShortcut("SHIFT+NUMPAD[8]");
