1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-25 22:14:32 +00:00

Add shortcut key for deleting selected torrents

Added processing of pressing 'Delete' key on keyboard.
This commit is contained in:
buinsky 2015-01-29 22:29:28 +03:00
parent 28b976bdb8
commit 0fee2216d0
2 changed files with 16 additions and 5 deletions

View File

@ -352,11 +352,20 @@ window.addEvent('load', function () {
function closeWindows() { function closeWindows() {
MochaUI.closeAll(); MochaUI.closeAll();
} };
window.addEvent('keydown', function (event) { var keyboardEvents = new Keyboard({
if (event.key == 'a' && event.control) { defaultEventType: 'keydown',
event.stop(); events: {
myTable.selectAll(); 'ctrl+a': function(event) {
myTable.selectAll();
event.preventDefault();
},
'delete': function(event) {
deleteFN();
event.preventDefault();
}
} }
}); });
keyboardEvents.activate();

View File

@ -29,6 +29,8 @@ function getLocalStorageItem(name, defaultVal) {
return val; return val;
} }
var deleteFN = function() {};
initializeWindows = function() { initializeWindows = function() {
function addClickEvent(el, fn) { function addClickEvent(el, fn) {