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
- Native Menus & Context Menus
- Dialogs and Notifications
- Shell Integration
- Global Shortcuts and Clipboard Access