From b6efdff286f03a5ba7a64d00d21f1edc088516a1 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 25 Oct 2013 19:13:00 +0100 Subject: [PATCH] Adding the key capture to addCursors. --- src/core/Game.js | 4 ++-- src/input/Keyboard.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Game.js b/src/core/Game.js index 73fd060a..b46fcac5 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -308,11 +308,11 @@ Phaser.Game.prototype = { if (this.renderType == Phaser.CANVAS) { - console.log('%cPhaser ' + Phaser.VERSION + ' initialized. Rendering to Canvas', 'color: #ffff33; background: #000000'); + console.log('%cPhaser initialized. Rendering to Canvas.', 'color: #ffff33; background: #000000'); } else { - console.log('%cPhaser ' + Phaser.VERSION + ' initialized. Rendering to WebGL', 'color: #ffff33; background: #000000'); + console.log('%cPhaser initialized. Rendering to WebGL.', 'color: #ffff33; background: #000000'); } var pos = Phaser.VERSION.indexOf('-'); diff --git a/src/input/Keyboard.js b/src/input/Keyboard.js index cc1ac1d5..c3bf108b 100644 --- a/src/input/Keyboard.js +++ b/src/input/Keyboard.js @@ -107,6 +107,9 @@ Phaser.Keyboard.prototype = { addKey: function (keycode) { this._hotkeys[keycode] = new Phaser.Key(this.game, keycode); + + this.addKeyCapture(keycode); + return this._hotkeys[keycode]; },