addEditorHotkey
addEditorHotkey<
T>(editor,key,command,precedence?): () =>void
Defined in: extensions/commands/utils.ts:143
Registers a command for the specified key.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”editor
Section titled “editor”PrismEditor<T>
Editor to add the command to.
string
Key the command will run for.
command
Section titled “command”EditorHotkey<T>
Command for the specified key.
precedence?
Section titled “precedence?”number
Positive integer denoting the precedence of the command where 0
is the highest precedence. Defaults to 2.
Returns
Section titled “Returns”Function to remove the hotkey.
():
void
Returns
Section titled “Returns”void