escrcpy/electron/events/shortcuts/index.js
2024-05-14 19:16:46 +08:00

14 lines
329 B
JavaScript

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')
})
}