diff options
author | Leah (ctucx) <leah@ctu.cx> | 2021-03-05 20:59:37 +0100 |
---|---|---|
committer | Leah (ctucx) <leah@ctu.cx> | 2021-03-05 20:59:37 +0100 |
commit | 900a52153d88038f465c85c9b106af341a6cc096 (patch) | |
tree | 4ffff107eaa88f085dcc3b2b51c8502ffbd31559 | |
parent | 340421c3fd7b61a8dc63b1c3fd9ce178dc19df8a (diff) |
replace deprecated keypress event with onkeyup
-rw-r--r-- | webmusic.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webmusic.js b/webmusic.js index ab01afd..4dd6e00 100644 --- a/webmusic.js +++ b/webmusic.js @@ -20,7 +20,7 @@ window.onload = function () { updateState() }; -document.addEventListener("keypress", function onEvent(event) { +window.onkeyup = function (event) { if (event.key === "p") { togglePlayback(); } @@ -30,7 +30,7 @@ document.addEventListener("keypress", function onEvent(event) { else if (event.key === "c") { toggleContinue(); } -}); +}; function togglePlayback() { |