Skip to content

addEditorHotkey

addEditorHotkey<T>(editor, key, command, precedence?): () => void

Defined in: extensions/commands/utils.ts:143

Registers a command for the specified key.

T extends object

PrismEditor<T>

Editor to add the command to.

string

Key the command will run for.

EditorHotkey<T>

Command for the specified key.

number

Positive integer denoting the precedence of the command where 0 is the highest precedence. Defaults to 2.

Function to remove the hotkey.

(): void

void