-
Notifications
You must be signed in to change notification settings - Fork 2
/
keyboardShortcuts.js
21 lines (18 loc) · 1.14 KB
/
keyboardShortcuts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
window.addEventListener('keydown', function(event) {
// event.preventDefault();
if ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key == 'ArrowUp') {firstTree();}
else if ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key == 'ArrowDown') {lastTree();}
else if ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key == 'ArrowLeft') {prevTree();}
else if ((event.metaKey || event.ctrlKey) && event.shiftKey && event.key == 'ArrowRight') {nextTree();}
});
window.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.shiftKey && event.code == 'KeyL') {search(treesArray);}
});
// file menu shortcuts
window.addEventListener('keydown', function(event) {
if (event.ctrlKey && event.shiftKey && event.code === 'KeyS') {saveTreeRemote();}
else if (event.ctrlKey && event.shiftKey && event.code === 'KeyR') {renameToggle();}
else if (event.ctrlKey && event.shiftKey && event.code === 'KeyD') {downloadToggle();}
else if (event.ctrlKey && event.shiftKey && event.code === 'KeyM') {editToggle();}
else if (event.ctrlKey && event.shiftKey && event.code === 'KeyT') {tagsToggle()}
});