Skip to main content
Commands, key bindings and where the user’s changes live. Guide: Keyboard shortcuts.

Keymap

Import from @reductoai/docx-editor, @reductoai/docx-editor/model. Extends Observable.

Keymap properties

allCommands()

Every registered command, in registration order.

bind()

Adds a user binding. Throws on a key the user cannot take.

cancelChord()

Abandons a chord’s first press.

chain()

Every command a key reaches now, the one that runs first; later ones run when it declines.

command()

conflicts()

Commands a key already reaches under the same when (both none counts as the same).

destroy()

enabled()

exportJson()

The user’s changes as a file.

handle()

Runs the command a press is bound to; true when one took it (the caller prevents the default).

importJson()

Replaces the user’s changes with a file from exportJson. Throws on a bad file.

keysFor()

Normalized keys of a command, visible ones only.

label()

The label of a command’s first key (“⌘B”), or of a key spec; "" when unbound.

list()

observes()

refusal()

Why the user cannot take a key, or undefined.

register()

Adds a command, or replaces the one with its id (until the returned function runs).

replace()

The Keyboard Shortcuts window’s edit: the command’s keys become key alone, and any command the key reached under the same when gives it up.

reset()

Back to the defaults (and the host’s overrides): one command, or all.

resolve()

The command a key reaches in these contexts, without running it.

run()

Runs a command by id, as a palette row or a host button would.

setContext()

setOverrides()

Host bindings between the defaults and the user’s changes.

stampOf()

subscribe()

Listen to one key, or to every change (including adopted children) when key is omitted.

title()

“Bold (⌘B)”, for a tooltip.

unbind()

Removes a command’s keys, or one of them.

createDocxKeymap()

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

KeybindingOptions

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

Keybinding

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

KeyCommand

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

CommandInfo

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

BindingSource

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

KeybindingStore

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

UserKeybindings

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

localStorageKeybindings()

One localStorage row per app; other tabs of the same origin follow a change. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

memoryKeybindings()

Keeps the changes for the life of the page. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

DOCX_KEYBINDINGS

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

PALETTE_ON_MOD_K

⌘K (Ctrl+K) for the palette, as our apps bind it; Word’s Insert Link keeps its menu entries. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

routePalette()

palette.open toggles the host’s own palette instead of the built-in one. Import from @reductoai/docx-editor, @reductoai/docx-editor/model.

KEYBINDINGS_STORAGE_KEY

Import from @reductoai/docx-editor, @reductoai/docx-editor/model.