import { globalShortcut } from 'electron' export default (mainWindow) => { mainWindow.on('focus', () => { globalShortcut.register('CommandOrControl+F', (event) => { mainWindow.webContents.send('focus-on-search') }) }) mainWindow.on('blur', () => { globalShortcut.unregister('CommandOrControl+F') }) }