aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-25 00:03:15 -0500
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-01-25 00:03:15 -0500
commit341d6a705ef217700dfe12a8c5fce6b0952f8cb9 (patch)
tree3de594fac8c7035377ed25d0b298e8494a56db58
parent1daad6d4f2f178600e07232ff71ca525fa02cb85 (diff)
Fix the keyboard handling with the Closure compiler
-rw-r--r--src/library_gl.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 8ce614f8..3c2e1585 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -418,28 +418,28 @@ var LibraryGLUT = {
onKeypress: function(event) {
if (GLUT.keyboardFunc) {
var key = null;
- switch (event.keyCode) {
- case event.DOM_VK_F1: key = 1 /* GLUT_KEY_F1 */; break;
- case event.DOM_VK_F2: key = 2 /* GLUT_KEY_F2 */; break;
- case event.DOM_VK_F3: key = 3 /* GLUT_KEY_F3 */; break;
- case event.DOM_VK_F4: key = 4 /* GLUT_KEY_F4 */; break;
- case event.DOM_VK_F5: key = 5 /* GLUT_KEY_F5 */; break;
- case event.DOM_VK_F6: key = 6 /* GLUT_KEY_F6 */; break;
- case event.DOM_VK_F7: key = 7 /* GLUT_KEY_F7 */; break;
- case event.DOM_VK_F8: key = 8 /* GLUT_KEY_F8 */; break;
- case event.DOM_VK_F9: key = 9 /* GLUT_KEY_F9 */; break;
- case event.DOM_VK_F10: key = 10 /* GLUT_KEY_F10 */; break;
- case event.DOM_VK_F11: key = 11 /* GLUT_KEY_F11 */; break;
- case event.DOM_VK_F12: key = 12 /* GLUT_KEY_F12 */; break;
- case event.DOM_VK_LEFT: key = 100 /* GLUT_KEY_LEFT */; break;
- case event.DOM_VK_UP: key = 101 /* GLUT_KEY_UP */; break;
- case event.DOM_VK_RIGHT: key = 102 /* GLUT_KEY_RIGHT */; break;
- case event.DOM_VK_DOWN: key = 103 /* GLUT_KEY_DOWN */; break;
- case event.DOM_VK_PAGE_UP: key = 104 /* GLUT_KEY_PAGE_UP */; break;
- case event.DOM_VK_PAGE_DOWN: key = 105 /* GLUT_KEY_PAGE_DOWN */; break;
- case event.DOM_VK_HOME: key = 106 /* GLUT_KEY_HOME */; break;
- case event.DOM_VK_END: key = 107 /* GLUT_KEY_END */; break;
- case event.DOM_VK_INSERT: key = 108 /* GLUT_KEY_INSERT */; break;
+ switch (event['keyCode']) {
+ case event['DOM_VK_F1']: key = 1 /* GLUT_KEY_F1 */; break;
+ case event['DOM_VK_F2']: key = 2 /* GLUT_KEY_F2 */; break;
+ case event['DOM_VK_F3']: key = 3 /* GLUT_KEY_F3 */; break;
+ case event['DOM_VK_F4']: key = 4 /* GLUT_KEY_F4 */; break;
+ case event['DOM_VK_F5']: key = 5 /* GLUT_KEY_F5 */; break;
+ case event['DOM_VK_F6']: key = 6 /* GLUT_KEY_F6 */; break;
+ case event['DOM_VK_F7']: key = 7 /* GLUT_KEY_F7 */; break;
+ case event['DOM_VK_F8']: key = 8 /* GLUT_KEY_F8 */; break;
+ case event['DOM_VK_F9']: key = 9 /* GLUT_KEY_F9 */; break;
+ case event['DOM_VK_F10']: key = 10 /* GLUT_KEY_F10 */; break;
+ case event['DOM_VK_F11']: key = 11 /* GLUT_KEY_F11 */; break;
+ case event['DOM_VK_F12']: key = 12 /* GLUT_KEY_F12 */; break;
+ case event['DOM_VK_LEFT']: key = 100 /* GLUT_KEY_LEFT */; break;
+ case event['DOM_VK_UP']: key = 101 /* GLUT_KEY_UP */; break;
+ case event['DOM_VK_RIGHT']: key = 102 /* GLUT_KEY_RIGHT */; break;
+ case event['DOM_VK_DOWN']: key = 103 /* GLUT_KEY_DOWN */; break;
+ case event['DOM_VK_PAGE_UP']: key = 104 /* GLUT_KEY_PAGE_UP */; break;
+ case event['DOM_VK_PAGE_DOWN']: key = 105 /* GLUT_KEY_PAGE_DOWN */; break;
+ case event['DOM_VK_HOME']: key = 106 /* GLUT_KEY_HOME */; break;
+ case event['DOM_VK_END']: key = 107 /* GLUT_KEY_END */; break;
+ case event['DOM_VK_INSERT']: key = 108 /* GLUT_KEY_INSERT */; break;
default: return;
};
if (key !== null) {