Merge pull request #550 from qdrj/1.2

add missing Keyboard.removeKey method
This commit is contained in:
Richard Davey 2014-03-12 21:20:13 +00:00
commit 580ee6b75e

View file

@ -116,6 +116,24 @@ Phaser.Keyboard.prototype = {
},
/**
* Removes a Key object from the Keyboard manager.
*
* @method Phaser.Keyboard#removeKey
* @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR
*/
removeKey: function (keycode) {
if (this._keys[keycode])
{
delete (this._keys[keycode]);
this.removeKeyCapture(keycode);
}
},
/**
* Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right.
*