Docs menu
DocsAPI reference

Global shortcuts

System-wide hotkeys that fire even when your app isn't focused.

Register a system-wide hotkey that fires even when your app isn't focused (a launcher, quick-capture tool, etc.). Capability: globalShortcut — prompts once per accelerator on first registration.

List the accelerators in "shortcuts" in the manifest, then register one with a callback:

// app.json: { "capabilities": ["globalShortcut"], "shortcuts": ["CmdOrCtrl+Shift+K"] }
const ok = await window.chatoss.shortcuts.register('CmdOrCtrl+Shift+K', () => {
  // fires on every press, even when another app is focused
});
// later:
await window.chatoss.shortcuts.unregister('CmdOrCtrl+Shift+K');
  • You can only register accelerators you listed in "shortcuts".
  • The first registration of each prompts the user once (ok is false if they deny).
  • Shortcuts are released automatically when your app closes.