Methods
-
clear all user-registered keys
-
clears all menu keys
-
Make the KeyCode pretty for printing on the menu
Name Type Description keyCodeKeyCode Returns:
Type Description string -
register a key as a global accelerator
Name Type Description keyCodeAccelerator~KeyCodes (e.g., Ctrl+shift+E) callbackfunction -
special key registration for alt
Name Type Description pressedfunction releasedfunction -
Register a shortcut key for use by an open menu
Name Type Description letterAccelerator~KeyCodes menuItemMenuItem applicationMenuboolean -
Register special shortcut keys for menu
Name Type Description menuItemMenuItem -
Removes menu shortcuts
Type Definitions
-
Keycodes definition. In the form of modifier[+modifier...]+key
For example: ctrl+shift+e
KeyCodes are case insensitive (i.e., shift+a is the same as Shift+A). And spaces are removed
You can assign more than one key to the same shortcut by using a | between the keys (e.g., 'shift+a | ctrl+a')
Modifiers: ctrl, alt, shift, meta, (ctrl aliases: command, control, commandorcontrol)
Keys: escape, 0-9, minus, equal, backspace, tab, a-z, backetleft, bracketright, semicolon, quote, backquote, backslash, comma, period, slash, numpadmultiply, space, capslock, f1-f24, pause, scrolllock, printscreen, home, arrowup, arrowleft, arrowright, arrowdown, pageup, pagedown, end, insert, delete, enter, shiftleft, shiftright, ctrlleft, ctrlright, altleft, altright, shiftleft, shiftright, numlock, numpad...
For OS-specific codes and a more detailed explanation see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code. Also note that 'Digit' and 'Key' are removed from the code to make it easier to type.