Game Development Community

Changing engine to support modifier keys?

by Vern Jensen · in Torque Game Builder · 04/25/2007 (12:15 pm) · 3 replies

I'd like to modify the engine to directly support modifier keys, so that I can do this:

moveMap.bindCmd(keyboard, "shift", "$pShip.gun.fire();", "$pShip.gun.fireStop();");

Currently, you can't do that to receive events when *only* a modifier key is pressed. You can only get notified when a modifier *and* some other key is pressed. I need notifcation for modifier keys alone.

Before I go and start trying to modify the engine, I figured I'd ask if anyone here has already done the same thing. No sense in reinventing the wheel.

If no one has, could someone point me to the appropriate files to look at? I've never dug around in the TGB source before, and with like 400 files getting compiled, I'm guessing a pointer or two could help. ;-)

#1
06/15/2007 (9:29 am)
You need to use a specific modifier key name e.g. lshift or rshift.
Notice the l for left and r for right in front there.

In order to bind a key it has to be an actual key ;p
#2
06/15/2007 (12:49 pm)
Yeah, that unfortunately works on Windows only, not on Mac, from what I gather. Maybe I should report it as a bug?
#3
06/15/2007 (1:08 pm)
Ah didn't know you were on mac, sorry. The place to look for that in the C++ code is:

sim/actionMap.cc