Listen for keydown event on document

This commit is contained in:
Unrud 2022-02-21 22:30:18 +01:00
parent ad3847f5aa
commit 56cff8deb2

View file

@ -498,7 +498,7 @@ window.addEventListener("load", function() {
document.addEventListener("touchend", handleEnd);
document.addEventListener("touchcancel", handleEnd);
document.addEventListener("touchmove", handleMove);
window.addEventListener("keydown", function(evt) {
document.addEventListener("keydown", function(evt) {
if (activeScene && activeScene.classList.contains("key")) {
handleKeydown(evt);
}