0Pricing
Electron Desktop App Development · Lesson

Global Shortcuts and Clipboard Access

Extend your native OS integration by registering system-wide keyboard shortcuts and reading or writing the system clipboard from Electron.

Reaching Beyond the Window

Native apps often respond even when not focused. Global shortcuts and clipboard access make your Electron app feel truly native.

The globalShortcut Module

Use globalShortcut in the main process to listen for key combos system-wide, even when your app is in the background.

const { globalShortcut } = require('electron');
app.whenReady().then(() => {
  globalShortcut.register('CommandOrControl+Shift+K', () => {
    console.log('shortcut fired');
  });
});

All lessons in this course

  1. Native Menus & Context Menus
  2. Dialogs and Notifications
  3. Shell Integration
  4. Global Shortcuts and Clipboard Access
← Back to Electron Desktop App Development