Search Docs
Loading...
Skip to content

Interface: Shortcut

A keyboard shortcut. keys is a chord ('Mod+z'); sequences (string arrays) currently bind on their first chord. run is an action id or an inline function.

Properties#

PropertyTypeDescription
keysstringstring[]
runShortcutRunAn action id (run via engine.actions.run) or an inline function.
when?(context) => booleanOnly fire the shortcut (and swallow the key) when this returns true. Checks engine state only; scope is handled separately via scope.
scopeShortcutScopeId[]Restrict the shortcut to one or more UI scopes: it is a candidate only when the resolved active scope is in this list. Use the editor fallback scope (ly.img.scope.editor) for a shortcut that should fire anywhere inside the editor; an empty array fires in any scope.
description?stringOptional human-readable description, surfaced in help UIs.
category?stringOptional grouping label for help UIs.
sequenceTimeout?numberFor multi-step (sequence) shortcuts: the maximum idle gap, in milliseconds, allowed between key presses before the in-progress sequence is forgotten. Ignored for single-chord shortcuts. Defaults to 1000ms.