-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathshortcuts.js
46 lines (43 loc) · 1.23 KB
/
shortcuts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const { globalShortcut } = require('electron')
let shortcutsActive = false
const shortcuts = {
global: {
CLOSE: 'CommandOrControl+W',
CONNECT: 'CommandOrControl+Shift+C',
DISCONNECT: 'CommandOrControl+Shift+D',
RUN: 'CommandOrControl+R',
RUN_SELECTION: 'CommandOrControl+Alt+R',
RUN_SELECTION_WL: 'CommandOrControl+Alt+S',
STOP: 'CommandOrControl+H',
RESET: 'CommandOrControl+Shift+R',
NEW: 'CommandOrControl+N',
SAVE: 'CommandOrControl+S',
CLEAR_TERMINAL: 'CommandOrControl+L',
EDITOR_VIEW: 'CommandOrControl+Alt+1',
FILES_VIEW: 'CommandOrControl+Alt+2',
},
menu: {
CLOSE: 'CmdOrCtrl+W',
CONNECT: 'CmdOrCtrl+Shift+C',
DISCONNECT: 'CmdOrCtrl+Shift+D',
RUN: 'CmdOrCtrl+R',
RUN_SELECTION: 'CmdOrCtrl+Alt+R',
RUN_SELECTION_WL: 'CmdOrCtrl+Alt+S',
STOP: 'CmdOrCtrl+H',
RESET: 'CmdOrCtrl+Shift+R',
NEW: 'CmdOrCtrl+N',
SAVE: 'CmdOrCtrl+S',
CLEAR_TERMINAL: 'CmdOrCtrl+L',
EDITOR_VIEW: 'CmdOrCtrl+Alt+1',
FILES_VIEW: 'CmdOrCtrl+Alt+2'
},
// Shortcuts
}
function disableShortcuts (win, value) {
console.log(value ? 'disabling' : 'enabling', 'shortcuts')
win.send('ignore-shortcuts', value)
}
module.exports = {
shortcuts,
disableShortcuts
}