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#
| Property | Type | Description |
|---|---|---|
keys |
string |
string[] |
run |
ShortcutRun |
An action id (run via engine.actions.run) or an inline function. |
when? |
(context) => boolean |
Only fire the shortcut (and swallow the key) when this returns true. Checks engine state only; scope is handled separately via scope. |
scope |
ShortcutScopeId[] |
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? |
string |
Optional human-readable description, surfaced in help UIs. |
category? |
string |
Optional grouping label for help UIs. |
sequenceTimeout? |
number |
For 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. |