diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 65a91bc5..9bb8ba15 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -161,7 +161,7 @@ private observer = new ResizeObserver(this.onResise.bind(this)) private focused = false private fullscreen = false - private activeKeys: any = {} + private activeKeys: Set = new Set() get admin() { return this.$accessor.user.admin @@ -409,10 +409,9 @@ return } - let keys = Object.keys(this.activeKeys) - for(let key of keys) { + for (let key of this.activeKeys) { this.$client.sendData('keyup', { key }) - delete this.activeKeys[key] + this.activeKeys.delete(key) } } @@ -503,7 +502,7 @@ let key = this.getCode(e) this.$client.sendData('keydown', { key }) - this.activeKeys[key] = true + this.activeKeys.add(key) } onKeyUp(e: KeyboardEvent) { @@ -513,7 +512,7 @@ let key = this.getCode(e) this.$client.sendData('keyup', { key }) - delete this.activeKeys[key] + this.activeKeys.delete(key) } onResise() {