A keyboard shortcut (modeled after CodeMirror 6 KeyBindings).

interface IParsedKeyBinding {
    focusAfter?: (() => HTMLElement);
    key: string;
    keys: string[];
    mac?: string;
    preventDefault?: boolean;
    run?: (() => void);
    shift?: (() => void);
}

Hierarchy (view full)

Properties

focusAfter?: (() => HTMLElement)

Specify an element to focus after running the action (defaults to the closest editor).

Type declaration

    • (): HTMLElement
    • Returns HTMLElement

key: string

The key(s) to press.

keys: string[]
mac?: string

The key(s) to press on a Mac.

preventDefault?: boolean

Whether the key(s) default action should be prevented or not.

run?: (() => void)

The command to run.

Type declaration

    • (): void
    • Returns void

shift?: (() => void)

The command to run when the shift key is held down.

Type declaration

    • (): void
    • Returns void