tauri-app-global-shortcut

Installation
SKILL.md

When to use this skill

ALWAYS use this skill when the user mentions:

  • Global hotkeys or keyboard shortcuts outside app focus
  • Shortcut conflict detection and resolution
  • Triggering app focus or commands via keyboard shortcuts

Trigger phrases include:

  • "global shortcut", "hotkey", "keyboard shortcut", "keybinding", "accelerator"

How to use this skill

  1. Install the global-shortcut plugin:
    cargo add tauri-plugin-global-shortcut
    
  2. Register the plugin in your Tauri builder:
    tauri::Builder::default()
        .plugin(tauri_plugin_global_shortcut::Builder::new().build())
    
  3. Configure capabilities in src-tauri/capabilities/default.json:
    { "permissions": ["global-shortcut:allow-register", "global-shortcut:allow-unregister"] }
    
  4. Register shortcuts from the frontend:
    import { register, unregister } from '@tauri-apps/plugin-global-shortcut';
    await register('CommandOrControl+Shift+K', (event) => {
      if (event.state === 'Pressed') {
        console.log('Shortcut triggered!');
      }
    });
    
  5. Handle conflicts by catching registration errors when another app holds the shortcut
  6. Unregister shortcuts on app exit to clean up system-level registrations

Outputs

  • Global shortcut registration with conflict handling
  • Shortcut-to-action routing pattern
  • Cleanup on app exit

References

Keywords

tauri global shortcut, hotkey, keyboard shortcut, keybinding, accelerator

Related skills

More from partme-ai/full-stack-skills

Installs
7
GitHub Stars
361
First Seen
Mar 25, 2026
Security Audits