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
|
|
|
|
}
|
|
|
|
|
2017-11-10 12:39:55 +01:00
|
|
|
if(event.which === 65 || event.which === 37){ // A or left arrow key go to previous file
|
|
|
|
ListNavigator.previousItem();
|
|
|
|
}else if(event.which === 68 || event.which === 39){ // D or right arrow key go to next file
|
|
|
|
ListNavigator.nextItem();
|
|
|
|
}else if(event.shiftKey && event.which === 83){ // SHIFT + S downloads all files in list
|
|
|
|
Toolbar.downloadList();
|
|
|
|
}else if(event.which === 83){ // S key downloads only selected file
|
|
|
|
Toolbar.download();
|
|
|
|
}else if(event.which === 67){ // C to copy to clipboard
|
|
|
|
Toolbar.copyUrl();
|
|
|
|
}else if(event.which === 73){ // I to open info window
|
|
|
|
DetailsWindow.toggle();
|
|
|
|
}
|
2018-09-19 23:31:51 +02:00
|
|
|
});
|