The Fugue

Counterpoint by Hans Fugal

GLUT Modifier Keys

Posted by Hans Fugal Wed, 13 Jun 2007 21:50:00 GMT

So, I'm hacking up a sweet joystick file. I thought, "Hey wouldn't it be nifty if I could make some buttons do different things if I'm pressing shift or control or something?" It's a known fact of life that you can never have too many joystick buttons.

Well, yes you can do that. But, no you can't. FlightGear itself lets you do that—you use the nasal function getprop("/devices/status/keyboard/shift"), for example. The only problem is that this doesn't work when FlightGear is compiled to use GLUT (vs SDL).

Apparently the geniuses that wrote GLUT don't believe that there is a way to get the state of a modifier key except in conjunction with another event (regular keypress, mouse event, etc.) Read the sickening truth right here, where the problem is brought up on the freeglut-developer list, the "reasoning" against it is presented, there is a swift and sure rebuttal, and then silence.

So, I'm going to have to figure out how to get FlightGear to compile and run with SDL on OS X (so far it has eluded me, but I've got a few more tricks to try).

no comments | Tags , | atom

Comments

Leave a response

Leave a comment