diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-10-24 17:43:37 +0200 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-10-24 17:43:37 +0200 |
commit | ae187b6d75c8079da0be1dc288613bad8466fe61 (patch) | |
tree | 5ea0d34185a2270f29ffaa65e1f5258028d7d5d0 /assets/shortcuts.js | |
download | mist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.gz mist-ae187b6d75c8079da0be1dc288613bad8466fe61.tar.bz2 mist-ae187b6d75c8079da0be1dc288613bad8466fe61.zip |
Initial commit
Diffstat (limited to 'assets/shortcuts.js')
-rw-r--r-- | assets/shortcuts.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/assets/shortcuts.js b/assets/shortcuts.js new file mode 100644 index 0000000..2fa48ca --- /dev/null +++ b/assets/shortcuts.js @@ -0,0 +1,26 @@ +document.onkeydown = (e) => { + + if ((e.metaKey || e.ctrlKey) && e.key === ".") { + e.preventDefault(); + window.parent.stop(); + return false; + } + + if ((e.metaKey || e.ctrlKey) && e.key === "ArrowRight") { + e.preventDefault(); + window.parent.next(); + return false; + } + + if ((e.metaKey || e.ctrlKey) && e.key === "ArrowLeft") { + e.preventDefault(); + window.parent.previous(); + return false; + } + + if (e.key === " " && e.target.tagName !== "INPUT") { + e.preventDefault(); + window.parent.playPause(); + return false; + } +}
\ No newline at end of file |