summaryrefslogtreecommitdiff
path: root/assets/js/shortcuts.js
blob: 2fa48cae5571c6d3a556a9a5b1cc1795308e6986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
    }
}