blockly > ShortcutRegistry > register

ShortcutRegistry.register() method

Registers a keyboard shortcut.

Signature:

register(shortcut: KeyboardShortcut, opt_allowOverrides?: boolean): void;

Parameters

Parameter Type Description
shortcut KeyboardShortcut The shortcut for this key code.
opt_allowOverrides boolean (Optional) True to prevent a warning when overriding an already registered item.

Returns:

void

Exceptions

{Error} if a shortcut with the same name already exists.