Permalink
Browse files

Fixed scope error

  • Loading branch information...
CodeHunger
CodeHunger committed Jul 2, 2012
1 parent c951fb5 commit 9d9f906b963df5c7d4a5294bade64eb8be7aa1a3
Showing with 8 additions and 8 deletions.
  1. +8 −8 source/controllers/keyboard.js
@@ -28,13 +28,13 @@ ControllerKeyboard.prototype.keyDown = function(event) {
var controller = event.data.scope;
if (controller.isActive) {
- for(var key in scope.keys) {
+ for(var key in controller.keys) {
if(key == event.keyCode) {
- if(scope.keysState[key] !== true || scope.repetitiveInput) {
- scope.jarallax.setProgress(scope.jarallax.progress + scope.keys[key]);
+ if(controller.keysState[key] !== true || controller.repetitiveInput) {
+ controller.jarallax.setProgress(controller.jarallax.progress + controller.keys[key]);
}
- scope.keysState[key] = true;
- if(scope.preventDefault) {
+ controller.keysState[key] = true;
+ if(controller.preventDefault) {
event.preventDefault();
}
}
@@ -44,10 +44,10 @@ ControllerKeyboard.prototype.keyDown = function(event) {
ControllerKeyboard.prototype.keyUp = function(event) {
if (this.isActive) {
- var scope = event.data.scope;
- for(var key in scope.keys) {
+ var controller = event.data.scope;
+ for(var key in controller.keys) {
if(key == event.keyCode) {
- scope.keysState[key] = false;
+ controller.keysState[key] = false;
}
}
}

0 comments on commit 9d9f906

Please sign in to comment.