diff --git a/lib/Chuck/Control/KeyboardInput.js b/lib/Chuck/Control/KeyboardInput.js index c2720d8..994b84c 100755 --- a/lib/Chuck/Control/KeyboardInput.js +++ b/lib/Chuck/Control/KeyboardInput.js @@ -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; diff --git a/lib/Chuck/Processors/ClientProcessor.js b/lib/Chuck/Processors/ClientProcessor.js index a39a7e6..1fecad0 100755 --- a/lib/Chuck/Processors/ClientProcessor.js +++ b/lib/Chuck/Processors/ClientProcessor.js @@ -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); } diff --git a/static/html/index.html b/static/html/index.html index 77e38c4..2da2e5d 100755 --- a/static/html/index.html +++ b/static/html/index.html @@ -2,8 +2,6 @@