Optional modifier-key requirement for a gesture spec.
Matching semantics (strict): an omitted modifier field means the
modifier MUST NOT be held — i.e., a bare { kind: 'key', key: 'Escape' }
matches only unmodified Escape, NOT Cmd+Escape. A true means the
modifier MUST be held; false is the same as omitted (must be absent).
This mirrors today's KeyBinding matcher and keeps conflict detection
coherent.
mod is a platform-aware shorthand: matches metaKey on mac, ctrlKey
elsewhere (mirrors KeyBinding.mod).
shift additionally accepts 'optional' meaning "shifted or unshifted
both acceptable" — the explicit opt-in for loose matching, used by
actions like nudge whose step size depends on shift but whose firing
does not. To widen other modifiers similarly, extend their type when
a real consumer needs it.
Optional modifier-key requirement for a gesture spec.
Matching semantics (strict): an omitted modifier field means the modifier MUST NOT be held — i.e., a bare
{ kind: 'key', key: 'Escape' }matches only unmodified Escape, NOT Cmd+Escape. Atruemeans the modifier MUST be held;falseis the same as omitted (must be absent). This mirrors today'sKeyBindingmatcher and keeps conflict detection coherent.modis a platform-aware shorthand: matchesmetaKeyon mac,ctrlKeyelsewhere (mirrorsKeyBinding.mod).shiftadditionally accepts'optional'meaning "shifted or unshifted both acceptable" — the explicit opt-in for loose matching, used by actions like nudge whose step size depends on shift but whose firing does not. To widen other modifiers similarly, extend their type when a real consumer needs it.