You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
728 B
35 lines
728 B
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)
|