view: inputhandler: release all keys when focus is lost

This commit is contained in:
Matthias Schiffer 2018-11-09 13:34:01 +01:00
parent 453a9391cc
commit d5ba388698
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -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 {