Skip to main content

Home > blockly > ShortcutRegistry > removeKeyMapping

ShortcutRegistry.removeKeyMapping() method

Removes a mapping between a keycode and a keyboard shortcut.

Signature:

removeKeyMapping(keyCode: string, shortcutName: string, quiet?: boolean): boolean;

Parameters

ParameterTypeDescription
keyCodestringThe key code for the keyboard shortcut. If registering a key code with a modifier (ex: ctrl+c) use ShortcutRegistry.registry.createSerializedKey;
shortcutNamestringThe name of the shortcut to execute when the given keycode is pressed.
quietboolean(Optional) True to not console warn when there is no shortcut to remove.

Returns:

boolean

True if a key mapping was removed, false otherwise.