Add shortcuts

Adds shortcuts to the UI. These shortcuts are:
Ctrl-Z: Undo
Ctrl-Y: Redo
Ctrl-E: Retry
This commit is contained in:
somebody 2022-07-30 21:34:42 -05:00
parent 5d135e091e
commit 59d55369cb
1 changed files with 26 additions and 0 deletions

View File

@ -3275,6 +3275,32 @@ $(document).ready(function(){
return true;
}
});
// Shortcuts
$(window).keydown(function (ev) {
// Only ctrl prefixed (for now)
if (!ev.ctrlKey) return;
let handled = true;
switch (ev.key) {
// Ctrl+Z - Back
case "z":
button_actback.click();
break;
// Ctrl+Y - Forward
case "y":
button_actfwd.click();
break;
// Ctrl+E - Retry
case "e":
button_actretry.click();
break;
default:
handled = false;
}
if (handled) ev.preventDefault();
});
});