chore: polish

This commit is contained in:
cha0s 2019-04-20 01:20:05 -05:00
parent 69b9f6f090
commit cc6c85e2f6

View File

@ -56,6 +56,7 @@ export class App extends decorate(class {}) {
this.room.on('entityAdded', this.onRoomEntityAdded, this);
// Input.
this.actionRegistry = new ActionRegistry();
this.actionRegistry.mapKeysToActions(config.actionKeyMap);
this.actionState = this.actionRegistry.state;
this.inputHandle = undefined;
this.isFocused = false;
@ -327,7 +328,6 @@ export class App extends decorate(class {}) {
startProcessingInput() {
const config = this.readConfig();
this.actionRegistry.mapKeysToActions(config.actionKeyMap);
this.actionRegistry.listen(this.stage.element);
// Pointer input.
this.stage.on('pointerDown', this.onPointerDown, this);
@ -374,6 +374,7 @@ export class App extends decorate(class {}) {
}, 1000 * config.pointerMovementFrequency);
// Focus the stage.
this.stage.focus();
this.isFocused = true;
}
startRendering() {