const { app, BrowserWindow, globalShortcut } = require('electron') function createWindow() { const win = new BrowserWindow({ width: 1024, height: 768, frame: false, webPreferences: { nodeIntegration: true }, icon: "assets/icon.png" }) win.loadFile('index.html') return win } function init() { const win = createWindow() globalShortcut.register('alt+x', () => { app.exit(0) }) globalShortcut.register('ctrl+j', () => { win.webContents.executeJavaScript(`impress("impress").next()`) }) globalShortcut.register('ctrl+k', () => { win.webContents.executeJavaScript(`impress("impress").prev()`) }) } app.whenReady().then(init)