OptionalhostOptional pluggable backend for chord subscription. When provided, the
service delegates keys.registerAction → bridge.subscribe(chord, cb)
and stores the returned unsubscribe handle keyed on actionId. The
default document-listener path is NOT attached when hostBridge is
provided — the bridge is authoritative. See HostKeysBridge.
OptionallistenerEventTarget to attach the default keydown listener to. Defaults to the
global document when running in a DOM environment, else an isolated
new EventTarget() (SSR / Node-test safe). Passing a fresh
new EventTarget() is useful for unit tests. Mirrors the pattern used
by the shell and service test harnesses.
Ignored when hostBridge is provided — the bridge owns subscription
lifecycle and no document listener is attached.
OptionalonCalled on keys.forward (napplet-forwarded chord) and on document keydown
handled by the reference listener. Receives the DOM-style field names
(ctrlKey/altKey/shiftKey/metaKey) to match the shell's HotkeyHooks
contract. The service translates from the wire shape
({ ctrl, alt, shift, meta }) before invoking this callback.
OptionalreservedOptional set of shell-reserved chords. Strings in the @napplet/nap/keys
wire format (e.g. 'Ctrl+Shift+K', 'Cmd+P'). Reserved chords are not
assigned as napplet action bindings; document keydowns that match them
invoke onForward but do not push keys.action.
Normalized once at service construction via the same chord parser used
for action.defaultKey — 'Ctrl+K' / 'Control+k' / 'ctrl+K' all
match. Static; no runtime mutation. For dynamic reservation see the
deferred HostKeysBridge.reserveAbsolute(chords) extension.
Options for creating a keys service via createKeysService().
Example