mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
More shortcut stuff
This commit is contained in:
14
goodtube.js
14
goodtube.js
@@ -3027,16 +3027,7 @@
|
||||
|
||||
// Add keyboard shortcuts
|
||||
function goodTube_iframe_addKeyboardShortcuts() {
|
||||
let keyDownFired = false;
|
||||
document.addEventListener('keydown', function (event) {
|
||||
// Only do this once
|
||||
if (keyDownFired) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Indicate the keydown has fired
|
||||
keyDownFired = true;
|
||||
|
||||
// Don't do anything if we're holding control OR alt OR the command key on mac OR the "hide and mute ads" fallback is active
|
||||
if (event.ctrlKey || event.altKey || event.metaKey || goodTube_fallback) {
|
||||
return;
|
||||
@@ -3071,11 +3062,6 @@
|
||||
window.top.postMessage('goodTube_nextVideo', '*');
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
// Indicate the keydown has not fired
|
||||
keyDownFired = false;
|
||||
});
|
||||
}
|
||||
|
||||
// Support double speed shortcuts
|
||||
|
||||
Reference in New Issue
Block a user