This commit is contained in:
Killian Marty 2023-12-09 20:46:58 +01:00
parent 565f6d4c19
commit f6bdd4b51d

View file

@ -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();
})