diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/view/input/inputhandler.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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 { |