hotkeys
consthotkeys:object
Defined in: src/core/hotkeys.ts:314
Imperative hotkey API.
const dispose = hotkeys.register({ key: "ctrl+s", name: "Save", description: "Write the current buffer to disk", group: "File", handler: () => save(),});hotkeys.setContext("editor"); // activate editor-scoped bindingsType Declaration
Section titled “Type Declaration”groups
Section titled “groups”groups: (
opts?) =>HotkeyGroup[]
Active hotkeys grouped by section.
Parameters
Section titled “Parameters”ListOptions
Returns
Section titled “Returns”list: (
opts?) =>Hotkey[]
Active hotkeys matching the options.
Parameters
Section titled “Parameters”ListOptions
Returns
Section titled “Returns”Hotkey[]
popContext
Section titled “popContext”popContext: () =>
void
Leave the innermost context.
Returns
Section titled “Returns”void
pushContext
Section titled “pushContext”pushContext: (
context) =>void
Enter a nested context.
Parameters
Section titled “Parameters”context
Section titled “context”string
Returns
Section titled “Returns”void
register
Section titled “register”register: (
opts) => () =>void
Register a hotkey; returns a disposer.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”() => void
setContext
Section titled “setContext”setContext: (
context) =>void
Replace the context stack with one context (or none).
Parameters
Section titled “Parameters”context
Section titled “context”string | null
Returns
Section titled “Returns”void
context
Section titled “context”Get Signature
Section titled “Get Signature”get context():
string|null
The active context, or null.
Returns
Section titled “Returns”string | null