Internal: |- preamble -|- downloads -|- dependencies -|- building -|- end -|
2011-03-09: I recently had an occasion to question the keyboard callback values from freeglut, and wrote, well copy and pasted together, this application just to show the value returned by the keyboard callbacks, both 'normal' and 'special'.
One known difference so far is Ctrl+Space. In WIN32, this continues to return a space, ' ', while in unix/linux/MAC it returns a zero, '\0'. Others have yet to be found.
Also it seems for later versions of freeglut compiled in WIN32, the 'special' keyboard is called back with the specific modifier keys themselves, on pressing Shift, Ctrl, Alt, ..., and during these particular callbacks, freeglut will output a warning if glutGetModifiers() is called ;=((
Why it was chosen to return these modifier keys them selves in WIN32 is unknown, since you only get the key down event, and not the key up, so they are useless for maintaining your own internal state. And it seems a little odd to output a warning like 'glutGetModifiers() called outside input callback', when this _IS_ strictly an 'input' callback ;=((
It seems to depend on the age of the freeglut_ext.h, as to whether these additional callbacks are defined, like say GLUT_KEY_SHIFT_L, so looks like a relative 'modern' inclusions...
Take care downloading and running executables from the web!
|For a unix/linux, and hopefully MAX OS X builds, but is equivalent to the above|
glutkbde01.zip - Contains just a WIN32 executable, glutkbd.exe.
glutkbd-01.zip - Contains the FULL source, in multiple folders.
glutkbd-1.0.0.tar.gz - Just an alternative source container.
Needs freeglut, http://freeglut.sourceforge.net/, but perhaps can be built with other version of GLUT. I used the SVN development source checkout with -
svn co https://freeglut.svn.sourceforge.net/svnroot/freeglut/trunk/freeglut freeglut
I compiled just the static library, using the multi-threaded static runtime, /MT and /MTd, thus applications linking to these static libraries need to define FREEGLUT_STATIC, and FREEGLUT_LIB_PRAGMAS=0, before including freeglut_std.h/freeglut_ext.h.
Of course it is recommended that you likewise download the latest SVN source, but feel free to use my MSVC build files in the 'msvc' folder of the freeglut source zips below.
The freeglute01.zip 'binaries' zip includes libfreeglut.lib, a static library, compiled with MS runtime /MT, and the demonstration executables. Note, not all example function as expected ;=(( freeglut-01.zip is the complete source used, but some other MSVC files and folders have now been deleted to avoid confusion.
Of course, there is also a dependency on Winmm.lib, OpenGL32.lib, Glu32.lib and Glaux.lib, which seems to usually already be installed in all versions of Windows, but sometimes they may come with the Windows SDK installation.
Actually the initial MSVC build files in my added 'msvc' folder, the MSVC6 DSW/DSP files, were generated using my perl script, amsrcs04.pl - see here. This script emulates some parts of the unix automake tool kit, in that is reads the configure.ac file, figures out the Makefile.am files used, reads them, and generates the various *.dsp files, and a final <project>.dsw file. So these MSVC6 build files were the base of the converted MSVC8 sln/vcproj files.
To build from the full source, unzip the glutkbd-01.zip to a folder of your choice, and load the glutkbd.sln in MSVC8 (2005) or later, correct the include and library path to where you built freeglut, or to possibly other version of GLUT, and build. This was in Windows XP, but should function in other later windows version, but not tried.
Either unzip the glutkbd-01.zip, OR the glutkbd-1.0.0.tar.gz - they are equivalent. Then just run the 'makeme.sh'... Have only tested this in Ubuntu 8,04 LTS. Attempts have been made to automake 'find' the glut libraries in all ports - cygwin, mingw and apple-darwin - in configure.ac, but these have NOT been tested.
Have fun ;=))