Working through building the docs.

This commit is contained in:
Richard Davey
2013-10-01 16:15:45 +01:00
parent 0a98bb67d8
commit 9b4b267e7a
37 changed files with 17374 additions and 10 deletions
+31
View File
@@ -27,6 +27,12 @@ Phaser.Keyboard = function (game) {
*/
this._keys = {};
/**
* @property {Description} _hotkeys - Description.
* @private
*/
this._hotkeys = {};
/**
* @property {Description} _capture - Description.
* @private
@@ -72,6 +78,31 @@ Phaser.Keyboard.prototype = {
*/
_onKeyUp: null,
addCallbacks: function (context, onDown, onUp) {
this.callbackContext = context;
this.onDownCallback = onDown;
if (typeof onUp !== 'undefined')
{
this.onUpCallback = onUp;
}
},
addKey: function (keycode) {
this._hotkeys[keycode] = new Phaser.Key(this.game, keycode);
return this._hotkeys[keycode];
},
removeKey: function (keycode) {
delete (this._hotkeys[keycode]);
},
/**
* Description.
* @method start