Skip to main content

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

Parameter

Type

Description

keyCode

string

The key code for the keyboard shortcut. If registering a key code with a modifier (ex: ctrl+c) use ShortcutRegistry.registry.createSerializedKey;

shortcutName

string

The name of the shortcut to execute when the given keycode is pressed.

quiet

boolean

(Optional) True to not console warn when there is no shortcut to remove.

Returns:

boolean

True if a key mapping was removed, false otherwise.