summaryrefslogtreecommitdiff
path: root/assets/js/shortcuts.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-10-30 23:08:45 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-10-30 23:08:45 +0100
commit41c51b8bdb9c8e9fa4a7d56f260d594739d4107e (patch)
tree4bb3e824d636c7cf8cb39fd0e1aa25c49c339164 /assets/js/shortcuts.js
parent4d4308c46d4f7801c657cc79d2243e1a81831334 (diff)
downloadmist-41c51b8bdb9c8e9fa4a7d56f260d594739d4107e.tar.gz
mist-41c51b8bdb9c8e9fa4a7d56f260d594739d4107e.tar.bz2
mist-41c51b8bdb9c8e9fa4a7d56f260d594739d4107e.zip
Updated 35 files and added 28 files (automated)
Diffstat (limited to 'assets/js/shortcuts.js')
-rw-r--r--assets/js/shortcuts.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/assets/js/shortcuts.js b/assets/js/shortcuts.js
index 2fa48ca..6ed3c67 100644
--- a/assets/js/shortcuts.js
+++ b/assets/js/shortcuts.js
@@ -1,24 +1,27 @@
document.onkeydown = (e) => {
-
- if ((e.metaKey || e.ctrlKey) && e.key === ".") {
+ if ((e.metaKey || e.ctrlKey) && e.code === "Comma") {
+ if (window.parent.currentSong === null) return;
e.preventDefault();
window.parent.stop();
return false;
}
- if ((e.metaKey || e.ctrlKey) && e.key === "ArrowRight") {
+ if ((e.metaKey || e.ctrlKey) && e.code === "ArrowRight") {
+ if (window.parent.currentSong === null) return;
e.preventDefault();
window.parent.next();
return false;
}
- if ((e.metaKey || e.ctrlKey) && e.key === "ArrowLeft") {
+ if ((e.metaKey || e.ctrlKey) && e.code === "ArrowLeft") {
+ if (window.parent.currentSong === null) return;
e.preventDefault();
window.parent.previous();
return false;
}
- if (e.key === " " && e.target.tagName !== "INPUT") {
+ if (e.code === "Space" && e.target.tagName !== "INPUT") {
+ if (window.parent.currentSong === null) return;
e.preventDefault();
window.parent.playPause();
return false;