mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
removed jQuery, fixes #3
This commit is contained in:
parent
e64ed28c27
commit
50770509b5
3 changed files with 8 additions and 10 deletions
|
|
@ -9,8 +9,9 @@ define(["Chuck/Control/Key"], function(Key){
|
|||
}
|
||||
|
||||
KeyboardInput.prototype.init = function() {
|
||||
$(window).keydown($.proxy(this._onKeyDown, this));
|
||||
$(window).keyup($.proxy(this._onKeyUp, this));
|
||||
// Using window is ok here because it only runs in the browser
|
||||
window.onkeydown = this._onKeyDown.bind(this);
|
||||
window.onkeyup = this._onKeyUp.bind(this);
|
||||
}
|
||||
|
||||
KeyboardInput.prototype.registerKey = function(keyCode, onKeyDown, onKeyUp, onKeyFrame) {
|
||||
|
|
@ -44,7 +45,10 @@ define(["Chuck/Control/Key"], function(Key){
|
|||
KeyboardInput.prototype.update = function() {
|
||||
var callback = null;
|
||||
var self = this;
|
||||
$.each(this._registry, function(keyCode, key) {
|
||||
|
||||
for (var keyCode in this._registry) {
|
||||
var key = this._registry[keyCode];
|
||||
|
||||
if (key.getActivityUpdateNeeded()) {
|
||||
if (key.getActivityUpdateStatus() == true) {
|
||||
callback = key.getKeyDownFunction();
|
||||
|
|
@ -67,7 +71,7 @@ define(["Chuck/Control/Key"], function(Key){
|
|||
}
|
||||
}
|
||||
callback = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return KeyboardInput;
|
||||
|
|
|
|||
|
|
@ -70,10 +70,6 @@ define(requires,
|
|||
this.inputControlUnit = new InputControlUnit(this.me, this);
|
||||
}
|
||||
|
||||
ClientProcessor.prototype.userIdLeft = function(userId) {
|
||||
// body...
|
||||
};
|
||||
|
||||
ClientProcessor.prototype.sendGameCommand = function(command, options) {
|
||||
this.clientGame.sendGameCommand(command, options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue