aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-25 14:18:32 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-25 14:18:32 -0500
commita3f4a636b143bcefe4ba34a4ae25e53091e9c1d8 (patch)
tree6658ca49f17ff03a751ef60c5c6274c75c0e1a38
parent58d80ab53ea7c71b6e7dd0e56bee1335514a59f6 (diff)
Use the keydown event
-rw-r--r--src/library_gl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 1c3665cc..58cd9bbe 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -419,7 +419,7 @@ var LibraryGLUT = {
GLUT.lastY = event['clientY'];
},
- onKeypress: function(event) {
+ onKeydown: function(event) {
if (GLUT.keyboardFunc) {
var key = null;
switch (event['keyCode']) {
@@ -457,7 +457,7 @@ var LibraryGLUT = {
glutInit: function(argcp, argv) {
// Ignore arguments
GLUT.initTime = Date.now();
- window.addEventListener("keypress", GLUT.onKeypress, true);
+ window.addEventListener("keydown", GLUT.onKeydown, true);
window.addEventListener("mousemove", GLUT.onMousemove, true);
},