diff --git a/json/shortcuts.json b/json/shortcuts.json index 4382801..c626df6 100644 --- a/json/shortcuts.json +++ b/json/shortcuts.json @@ -1,5 +1,10 @@ { - "ctrl+r": "reload", - "command+r": "reload", - "ctrl+shift+i": "devtool" + "process": { + "ctrl+r": "reload", + "command+r": "reload", + "ctrl+shift+i": "devtool" + }, + "renderer": { + "ctrl+n": "newfolder" + } } \ No newline at end of file diff --git a/scripts/keybinds/handleKey.js b/scripts/keybinds/handleKey.js index 9eb99f1..b5c6dd3 100644 --- a/scripts/keybinds/handleKey.js +++ b/scripts/keybinds/handleKey.js @@ -8,7 +8,14 @@ module.exports = () => { ipc.sendSync('keybind', message); }; - Object.keys(binds).forEach((bind) => { - mousetrap.bind(bind, () => sendIpcMessage(binds[bind])); + const process = binds.process; + const renderer = binds.renderer; + + Object.keys(process).forEach((bind) => { + mousetrap.bind(bind, () => sendIpcMessage(process[bind])); + }); + + Object.keys(renderer).forEach((bind) => { + mousetrap.bind(bind, require(`./renderer/${renderer[bind]}`)); }); }; \ No newline at end of file