Files
fnx_web/res/static/script/Keyboard.js

38 lines
893 B
JavaScript
Raw Normal View History

2017-11-10 12:39:55 +01:00
/* global ListNavigator, Toolbar */
$(document).keydown(function(event){
2018-09-19 23:31:51 +02:00
if (event.ctrlKey || event.altKey) {
return // prevent custom shortcuts from interfering with system shortcuts
}
2019-07-18 11:47:02 +02:00
switch (event.which) {
case 65: // A or left arrow key go to previous file
case 37:
2017-11-10 12:39:55 +01:00
ListNavigator.previousItem();
2019-07-18 11:47:02 +02:00
break;
case 68: // D or right arrow key go to next file
case 39:
2017-11-10 12:39:55 +01:00
ListNavigator.nextItem();
2019-07-18 11:48:57 +02:00
break;
2019-07-18 11:47:02 +02:00
case 83:
if (event.shiftKey) {
Toolbar.downloadList(); // SHIFT + S downloads all files in list
} else {
Toolbar.download(); // S to download the current file
}
break;
case 82: // R to toggle list shuffle
ListNavigator.toggleShuffle();
break;
case 67: // C to copy to clipboard
2017-11-10 12:39:55 +01:00
Toolbar.copyUrl();
2019-07-18 11:47:02 +02:00
break;
case 73: // I to open the details window
2017-11-10 12:39:55 +01:00
DetailsWindow.toggle();
2019-07-18 11:47:02 +02:00
break;
case 81: // Q to close the window
window.close();
break;
2017-11-10 12:39:55 +01:00
}
2018-09-19 23:31:51 +02:00
});