Keyboard shortcuts update

This commit is contained in:
goodtube4u
2024-07-27 11:17:13 +10:00
parent 6b514094a9
commit cd0d84f7ce
2 changed files with 6 additions and 6 deletions

View File

@@ -3375,6 +3375,11 @@
// Add keyboard shortcuts
function goodTube_shortcuts_init(player) {
document.addEventListener('keydown', function(event) {
// Don't do anything if we're holding control
if (event.ctrlKey) {
return;
}
// Get the key pressed in lower case
let keyPressed = event.key.toLowerCase();
@@ -3388,11 +3393,6 @@
}
}
// Don't do anything if we're holding control, or we're not viewing a video
if (event.ctrlKey || typeof goodTube_getParams['v'] === 'undefined') {
return;
}
// If we're not focused on a HTML form element
let focusedElement = event.srcElement;
let focusedElement_tag = false;

2
goodtube.min.js vendored

File diff suppressed because one or more lines are too long