summaryrefslogtreecommitdiff
path: root/assets/shortcuts.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/shortcuts.js')
-rw-r--r--assets/shortcuts.js26
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