parent
265d5705df
commit
946020a43a
@ -1,4 +1,5 @@ |
||||
{ |
||||
"ctrl+r": "reload", |
||||
"command+r": "reload" |
||||
"command+r": "reload", |
||||
"ctrl+shift+i": "devtool" |
||||
} |
@ -1,9 +0,0 @@ |
||||
const mousetrap = require('../dep/mousetrap'); |
||||
|
||||
const binds = require('../../json/shortcuts.json'); |
||||
|
||||
module.exports = () => { |
||||
Object.keys(binds).forEach((bind) => { |
||||
mousetrap.bind(bind, require(`./${binds[bind]}.js`)); |
||||
}); |
||||
}; |
@ -0,0 +1,14 @@ |
||||
const mousetrap = require('../dep/mousetrap'); |
||||
const electron = require('electron'); const ipc = electron.ipcRenderer; |
||||
|
||||
const binds = require('../../json/shortcuts.json'); |
||||
|
||||
module.exports = () => { |
||||
const sendIpcMessage = (message) => { |
||||
ipc.sendSync('keybind', message); |
||||
}; |
||||
|
||||
Object.keys(binds).forEach((bind) => { |
||||
mousetrap.bind(bind, () => sendIpcMessage(binds[bind])); |
||||
}); |
||||
}; |
@ -0,0 +1,4 @@ |
||||
module.exports = (broswerWindow, app) => { |
||||
broswerWindow.webContents.openDevTools(); |
||||
return 'opened inspect element'; |
||||
}; |
@ -0,0 +1,7 @@ |
||||
const {ipcMain: ipc} = require('electron'); |
||||
|
||||
module.exports = (browserWindow, app) => { |
||||
ipc.on('keybind', (event, arg) => { |
||||
try {event.returnValue = require(`./${arg}`)(browserWindow, app);} catch {} |
||||
}); |
||||
}; |
@ -0,0 +1,3 @@ |
||||
module.exports = (browserWindow, app) => { |
||||
browserWindow.reload(); |
||||
}; |
@ -1,4 +0,0 @@ |
||||
module.exports = () => { |
||||
window.reload(); |
||||
console.log('e'); |
||||
}; |
Loading…
Reference in new issue