From c4b07c9d429603e492657992f77ad982577d72d9 Mon Sep 17 00:00:00 2001 From: Pierre Renaux Date: Wed, 6 Nov 2013 18:44:32 +0800 Subject: [library_glut.js]: Handle DELETE & BACKSPACE correctly ; --- src/library_glut.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/library_glut.js b/src/library_glut.js index fefe7bd3..0d843fe7 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -59,6 +59,9 @@ var LibraryGLUT = { getSpecialKey: function(keycode) { var key = null; switch (keycode) { + case 8: key = 120 /* backspace */; break; + case 46: key = 111 /* delete */; break; + case 0x70 /*DOM_VK_F1*/: key = 1 /* GLUT_KEY_F1 */; break; case 0x71 /*DOM_VK_F2*/: key = 2 /* GLUT_KEY_F2 */; break; case 0x72 /*DOM_VK_F3*/: key = 3 /* GLUT_KEY_F3 */; break; @@ -228,14 +231,14 @@ var LibraryGLUT = { if (delta < 0) { button = 4; // wheel down } - + if (GLUT.mouseFunc) { event.preventDefault(); GLUT.saveModifiers(event); Runtime.dynCall('viiii', GLUT.mouseFunc, [button, 0/*GLUT_DOWN*/, Browser.mouseX, Browser.mouseY]); } }, - + // TODO add fullscreen API ala: // http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ onFullScreenEventChange: function(event) { @@ -304,7 +307,7 @@ var LibraryGLUT = { // Firefox window.addEventListener("DOMMouseScroll", GLUT.onMouseWheel, true); } - + Browser.resizeListeners.push(function(width, height) { if (GLUT.reshapeFunc) { Runtime.dynCall('vii', GLUT.reshapeFunc, [width, height]); -- cgit v1.2.3-18-g5258