mirror of
https://github.com/wassname/phaser.git
synced 2026-07-26 13:27:43 +08:00
Working through building the docs.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user