diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-11-09 13:34:01 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-11-09 13:37:43 +0100 |
commit | d5ba38869897f7904edf6f6f57dd1ce17eff5368 (patch) | |
tree | 616468e105662cbad942e1a5b32b277f95655e55 /src/view/input | |
parent | 453a9391ccf1ab0c7a6869c44664bfcdd1b68fa1 (diff) | |
download | rpgedit-d5ba38869897f7904edf6f6f57dd1ce17eff5368.tar rpgedit-d5ba38869897f7904edf6f6f57dd1ce17eff5368.zip |
view: inputhandler: release all keys when focus is lost
Diffstat (limited to 'src/view/input')
-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 { |