From 7576b2ae14865d3df282411c92d72033d0c336c4 Mon Sep 17 00:00:00 2001 From: Pierre Renaux Date: Wed, 4 Apr 2012 13:18:57 +0800 Subject: [src/library_gl.js]: GLUT.getSpecialKey handles GLUT_KEY_SHIFT/CONTROL/ALT_R/L ; --- src/library_glut.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/library_glut.js') diff --git a/src/library_glut.js b/src/library_glut.js index 11e448b2..cdbb347b 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -72,6 +72,30 @@ var LibraryGLUT = { case 0x24 /*DOM_VK_HOME*/: key = 106 /* GLUT_KEY_HOME */; break; case 0x23 /*DOM_VK_END*/: key = 107 /* GLUT_KEY_END */; break; case 0x2d /*DOM_VK_INSERT*/: key = 108 /* GLUT_KEY_INSERT */; break; + + case 16 /*DOM_VK_SHIFT*/: + case 0x05 /*DOM_VK_LEFT_SHIFT*/: + key = 112 /* GLUT_KEY_SHIFT_L */; + break; + case 0x06 /*DOM_VK_RIGHT_SHIFT*/: + key = 113 /* GLUT_KEY_SHIFT_R */; + break; + + case 17 /*DOM_VK_CONTROL*/: + case 0x03 /*DOM_VK_LEFT_CONTROL*/: + key = 114 /* GLUT_KEY_CONTROL_L */; + break; + case 0x04 /*DOM_VK_RIGHT_CONTROL*/: + key = 115 /* GLUT_KEY_CONTROL_R */; + break; + + case 18 /*DOM_VK_ALT*/: + case 0x02 /*DOM_VK_LEFT_ALT*/: + key = 116 /* GLUT_KEY_ALT_L */; + break; + case 0x01 /*DOM_VK_RIGHT_ALT*/: + key = 117 /* GLUT_KEY_ALT_R */; + break; }; return key; }, -- cgit v1.2.3-18-g5258