OptionalonOptional: subscribe to OS-level global hotkey events (regardless of focus). Returns an unsubscribe handle.
Omitted by the browser reference implementation. See HostKeysBridge.registerGlobalHotkey.
OptionalregisterOptional: register an OS-level global hotkey (works even when the host window is not focused). Returns true on success, false if the chord cannot be registered (e.g. already claimed by another app).
Omitted by the browser reference implementation — browsers cannot
register OS-level global hotkeys without privileged APIs. Electron
(globalShortcut) and Tauri (GlobalShortcut) provide this.
Subscribe a callback to a chord. Returns an unsubscribe handle.
Implementations MUST:
callback exactly once per matching chord event (implementations
are responsible for any OS-autorepeat filtering)callback synchronously during the event delivery'Ctrl+Shift+K', 'Cmd+P')
Host-bridge contract for pluggable keyboard backends.
The browser reference implementation (the default createKeysService behaviour when
hostBridgeis omitted) registers adocument-level keydown listener and satisfies this interface structurally — it exposessubscribe(chord, callback) => unsubscribesemantics but omits the two OS-level optional fields (browsers cannot register global hotkeys without privileged APIs).Host apps (Electron, Tauri) implement this interface in their own code and pass it via
createKeysService({ hostBridge: myBridge })— the service then delegates subscription lifecycle to the bridge and remains browser-free.Reference implementations for Electron / Tauri are explicitly out of v1.4 scope and live in host-app examples / follow-up milestones (see REQUIREMENTS.md "Future Requirements").
Example