diff options
-rw-r--r-- | js/keyboard.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/keyboard.js b/js/keyboard.js index 73594d5..2fddfa5 100644 --- a/js/keyboard.js +++ b/js/keyboard.js @@ -1,7 +1,7 @@ function Keyboard() { this.keys = {KEY_A: 0, KEY_B: 1, KEY_SELECT: 2, KEY_START: 3, KEY_UP: 4, KEY_DOWN: 5, KEY_LEFT: 6, KEY_RIGHT: 7}; - + this.state1 = Array(8); for (var i = 0; i < this.state1.length; i++) this.state1[i] = 0x40; this.state2 = Array(8); @@ -36,6 +36,9 @@ Keyboard.prototype.keyDown = function(evt) { if (!this.setKey(evt.keyCode, 0x41) && evt.preventDefault) evt.preventDefault(); } +Keyboard.prototype.keyPress = function(evt) { + evt.preventDefault(); +} Keyboard.prototype.keyUp = function(evt) { if (!this.setKey(evt.keyCode, 0x40) && evt.preventDefault) evt.preventDefault(); |