diff --git a/src/view/input/inputhandler.ts b/src/view/input/inputhandler.ts index 22fdc28..17abfe6 100644 --- a/src/view/input/inputhandler.ts +++ b/src/view/input/inputhandler.ts @@ -31,6 +31,11 @@ export class InputHandler extends Listenable<[string, boolean]> { this.keys.delete(ev.code); this.runListeners(ev.code, false); }); + + window.addEventListener('blur', () => { + this.keys.clear(); + this.runListeners('', false); + }); } public has(key: string): boolean {