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() {
|
KeyboardInput.prototype.init = function() {
|
||||||
$(window).keydown($.proxy(this._onKeyDown, this));
|
// Using window is ok here because it only runs in the browser
|
||||||
$(window).keyup($.proxy(this._onKeyUp, this));
|
window.onkeydown = this._onKeyDown.bind(this);
|
||||||
|
window.onkeyup = this._onKeyUp.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyboardInput.prototype.registerKey = function(keyCode, onKeyDown, onKeyUp, onKeyFrame) {
|
KeyboardInput.prototype.registerKey = function(keyCode, onKeyDown, onKeyUp, onKeyFrame) {
|
||||||
|
|
@ -44,7 +45,10 @@ define(["Chuck/Control/Key"], function(Key){
|
||||||
KeyboardInput.prototype.update = function() {
|
KeyboardInput.prototype.update = function() {
|
||||||
var callback = null;
|
var callback = null;
|
||||||
var self = this;
|
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.getActivityUpdateNeeded()) {
|
||||||
if (key.getActivityUpdateStatus() == true) {
|
if (key.getActivityUpdateStatus() == true) {
|
||||||
callback = key.getKeyDownFunction();
|
callback = key.getKeyDownFunction();
|
||||||
|
|
@ -67,7 +71,7 @@ define(["Chuck/Control/Key"], function(Key){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
callback = null;
|
callback = null;
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return KeyboardInput;
|
return KeyboardInput;
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,6 @@ define(requires,
|
||||||
this.inputControlUnit = new InputControlUnit(this.me, this);
|
this.inputControlUnit = new InputControlUnit(this.me, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientProcessor.prototype.userIdLeft = function(userId) {
|
|
||||||
// body...
|
|
||||||
};
|
|
||||||
|
|
||||||
ClientProcessor.prototype.sendGameCommand = function(command, options) {
|
ClientProcessor.prototype.sendGameCommand = function(command, options) {
|
||||||
this.clientGame.sendGameCommand(command, options);
|
this.clientGame.sendGameCommand(command, options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Chuck</title>
|
<title>Chuck</title>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue