From f6bdd4b51d3ad5d811a0fd9fbaa218da1f2512dd Mon Sep 17 00:00:00 2001 From: Killian Marty Date: Sat, 9 Dec 2023 20:46:58 +0100 Subject: [PATCH] pnj --- public_html/js/input.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public_html/js/input.js b/public_html/js/input.js index 3756cae..9e16512 100644 --- a/public_html/js/input.js +++ b/public_html/js/input.js @@ -32,7 +32,10 @@ class Input { }); window.addEventListener("keydown", (e)=>{ - e.preventDefault(); //blocks the action of the key (cf. Killian) + //blocks the action of the key (cf. Killian) + if(["Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(e.code) > -1) { + e.preventDefault(); + } this.keysDown.add(e.key.toLowerCase()) this.updateDir(); })