view: inputhandler: release all keys when focus is lost
This commit is contained in:
parent
453a9391cc
commit
d5ba388698
1 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,11 @@ export class InputHandler extends Listenable<[string, boolean]> {
|
||||||
this.keys.delete(ev.code);
|
this.keys.delete(ev.code);
|
||||||
this.runListeners(ev.code, false);
|
this.runListeners(ev.code, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('blur', () => {
|
||||||
|
this.keys.clear();
|
||||||
|
this.runListeners('', false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public has(key: string): boolean {
|
public has(key: string): boolean {
|
||||||
|
|
Reference in a new issue