Invidious is an alternative front-end to YouTube
js: add support to detect alt, meta and control key in keydown handler (#704)
leonklingeleacaf7b969add
diff --git a/assets/js/player.js b/assets/js/player.jsindex 4a61258c..0d0ecebd 100644--- a/assets/js/player.js+++ b/assets/js/player.js@@ -327,8 +327,13 @@ window.addEventListener('keydown', e => {let action = null;const code = e.keyCode;- const key = e.key;- switch (key) {+ const decoratedKey =+ e.key+ + (e.altKey ? '+alt' : '')+ + (e.ctrlKey ? '+ctrl' : '')+ + (e.metaKey ? '+meta' : '')+ ;+ switch (decoratedKey) {case ' ':case 'k':action = toggle_play;@@ -405,7 +410,7 @@ window.addEventListener('keydown', e => {break;default:- console.info('Unhandled key down event: %s:', key, e);+ console.info('Unhandled key down event: %s:', decoratedKey, e);break;}