diff --git a/client/app.js b/client/app.js index a50ea4c..2de39b6 100644 --- a/client/app.js +++ b/client/app.js @@ -90,8 +90,7 @@ export class App extends decorate(class {}) { this.onBlur = this.onBlur.bind(this); this.onFocus = this.onFocus.bind(this); // Global keys. - this.onGlobalKeydown = this.onGlobalKeydown.bind(this); - window.addEventListener('keydown', this.onGlobalKeydown); + this.inputNormalizer.on('keyDown', this.onGlobalKeydown, this); this.pointingAt = [-1, -1]; this.pointerMovementHandle = undefined; // Net. @@ -236,8 +235,8 @@ export class App extends decorate(class {}) { this.isFocused = true; } - onGlobalKeydown(event) { - switch (event.key) { + onGlobalKeydown(key) { + switch (key) { case 'F2': this.isDebugging = !this.isDebugging; break;