aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Renaux <pierre@talansoft.com>2013-11-06 18:44:32 +0800
committerPierre Renaux <pierre@talansoft.com>2013-11-06 18:44:32 +0800
commitc4b07c9d429603e492657992f77ad982577d72d9 (patch)
treed7af13b59865d00b084b4b7b1b7fce16d05c1752
parent66d585fcd3fa6a17ae889b82aee1e95d420f82c0 (diff)
[library_glut.js]: Handle DELETE & BACKSPACE correctly ;
-rw-r--r--src/library_glut.js9
1 files 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]);