assets/scripts.js: Do not trigger key events with modifier keys

These key combinations usually mean something else and are not
intended for the web page.
This commit is contained in:
Vladimir Panteleev 2019-07-27 22:09:35 +00:00
parent afc3abb81c
commit 64bad02a3b

View file

@ -336,6 +336,8 @@ window.onload = function() {
};
document.onkeypress = function (e) {
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
return;
if (e.code == 'KeyF')
toggleFullScreen();
if (e.code == 'KeyR')
@ -344,14 +346,13 @@ window.onload = function() {
togglePlayPause();
};
document.onkeydown = function (evt) {
var v = document.getElementById("video");
if (evt.key == 'ArrowLeft') {
document.onkeydown = function (e) {
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
return;
if (e.key == 'ArrowLeft') {
jumpBack();
}
if (evt.key == 'ArrowRight') {
if (e.key == 'ArrowRight') {
jumpForward();
}
};