mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Merge pull request #550 from qdrj/1.2
add missing Keyboard.removeKey method
This commit is contained in:
commit
580ee6b75e
1 changed files with 18 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue