Interface: AmnesiaShortcutsProps
Defined in: shortcuts.tsx:37
Props for AmnesiaShortcuts.
Properties
enabled?
optionalenabled?:boolean
Defined in: shortcuts.tsx:81
When false, completely disables the shortcut binding without
unmounting the component. Useful for temporarily silencing Amnesia
while a modal owns its own keybindings. Defaults to true.
preventDefault?
optionalpreventDefault?:boolean
Defined in: shortcuts.tsx:74
When true, the handler calls event.preventDefault() whenever the
chord matches and shortcuts are not skipped — regardless of whether
an undo / redo entry actually existed. This is the right default
because async undo / redo cannot synchronously decide whether to
suppress the browser's native chord. Defaults to true.
scopeId?
optionalscopeId?:string
Defined in: shortcuts.tsx:50
Pin the binding to a specific scope. When omitted, the chord routes to whichever scope is currently active (the most recently focused claim, or the default scope when no claim is held).
skipEditableTargets?
optionalskipEditableTargets?:boolean
Defined in: shortcuts.tsx:65
When true, shortcuts are ignored while focus is on a native editable
surface (text-like <input> types, <textarea>, <select>, or
contenteditable). Browsers ship their own undo stack for those, and
stealing the chord usually breaks user expectations.
The check is shadow-DOM transparent: events that originate inside
an open shadow root whose deep target is editable are also skipped,
even though event.target is retargeted to the host outside the
shadow boundary.
Defaults to true.
target?
optionaltarget?:AmnesiaShortcutsTarget
Defined in: shortcuts.tsx:43
DOM target (or string alias) to attach the listener to. Defaults to
"window". See AmnesiaShortcutsTarget for the full set of
acceptable values.