mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +00:00
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:
parent
afc3abb81c
commit
64bad02a3b
1 changed files with 7 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue