Not sure I followed all those details (I hardly know anything about glut ;), but I think we should make a testcase that works when built natively using our headers and the relevant native library, and then fix things so it works when compiled by emscripten as well.
Or is the issue that there is no clear native library to use, it can be either GLUT or FreeGLUT, and the code that works is different among those two? If so, is one of those two overwhelmingly more commonly used? - Alon On Tue, Jan 7, 2014 at 4:04 AM, Floh <[email protected]> wrote: > Hi, > > I've stumbled across something which looks like a bug to me in the > library_glut.js input code, but it could also be a misunderstanding on my > side resulting from the many GLUT versions floating around (GLUT, FreeGlut, > OpenGlut, ...): > > In this commit the backspace and delete keys had been added as special > keys: > > > https://github.com/prenaux/emscripten/commit/c4b07c9d429603e492657992f77ad982577d72d9 > > The delete key returns the special key code 111 (0x6F) and 120 (0x78). > > But there are missing GLUT_KEY_xxx definitions for these in > GL/freeglut_std.h , now the "official" GLUT doc states that these keys are > not returned as special keys, but as ASCII code in the normal keyboard > callback function: > > http://www.opengl.org/documentation/specs/glut/spec3/node54.html > > at the end it states: > > "Note that the escape, backspace, and delete keys are generated as an > ASCII character." > > The latest freeglut_ext.h (downloaded from here: > http://sourceforge.net/projects/freeglut/) has one definition for the > delete key at 0x6F, but none for 0x78 (which would be backspace): > > #define GLUT_KEY_DELETE 0x006F > > > So long story short: > > > 1) it looks like GLUT and FreeGLUT don't agree on how to handle the Delete > key :/ > > 2) the Delete key in FreeGLUT is only defined in the freeglut_ext.h header > which we don't ship with > > 3) FreeGLUT doesn't define a special key code for Backspace anywhere, but > library_glut.js returns it as a special key code > > > I see 2 possible solutions: > > > 1) go with the GLUT standard, remove Delete and Backspace as special keys, > and return them as ASCII code (I would prefer this solution, but it breaks > prenaux' change) > > 2) add the 2 more GLUT_KEY definitions to freeglut_std.h, GLUT_KEY_DELETE > (normally defined in freeglut_ext.h, but we can't include this because 99% of > the stuff in there isn't implemented in library_glut.js), and > GLUT_KEY_BACKSPACE, which would be totally non-standard (neither GLUT nor > FreeGLUT). > > > Advice? :) > > -Floh > > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
