Skip to content

Commit 2c70b31

Browse files
MartinFillonTchips46
authored andcommitted
fix(input): initialized input handler record to prevent undefined
1 parent 9e6c5a5 commit 2c70b31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/input/src/input-handler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type InputEnum } from "./input.enum";
1+
import { InputEnum } from "./input.enum";
22

33
export class InputHandler {
44
public inputs: Record<string, boolean> = {};
@@ -11,6 +11,10 @@ export class InputHandler {
1111
window.addEventListener("keyup", (e: KeyboardEvent) => {
1212
this.inputs[e.code] = false;
1313
});
14+
15+
for (const key in InputEnum) {
16+
this.inputs[key] = false;
17+
}
1418
}
1519

1620
getKeyStatus(key: InputEnum): boolean {

0 commit comments

Comments
 (0)