Mac version of TGB can't trap the left contol key?
by Alain Labrie · in Torque Game Builder · 06/04/2011 (10:22 am) · 1 replies
I am currently porting my game to Mac and I have run into an issue. It seems that the Mac version of TGB 1.7.5 does not trap the left (or right) control key press.
so far these don't work:
but a combination like:
works fine.
I am currently looking to at macCarbinput.cc, but if anyone has had this problem in the past I would appreciate the heads up.
so far these don't work:
moveMap.bindCmd(keyboard, "rcontrol", "kart1.doJump();", ""); moveMap.bindCmd(keyboard, "lcontrol", "kart1.doJump();", ""); moveMap.bindCmd(keyboard, "ctrl", "kart1.doJump();", "");
but a combination like:
moveMap.bindCmd(keyboard, "ctrl p", "kart1.doJump();", "");
works fine.
I am currently looking to at macCarbinput.cc, but if anyone has had this problem in the past I would appreciate the heads up.
Torque Owner Alain Labrie
Ware-Wolf Games
It turns out that the mac sends the identical scan code for lctrl and rctrl same goes for lshift and rshift...
This means that TGB interprets CTRL and SHIFT (also the MAC keys OPT and COMMAND) as modifier keys only. Therefore you can only use them in combination with other keys like (CTRL + p) or (SHIFT + o).
I understand why GG made this choice from an engine design perspective. I guess it would be very frustrating to use the editor without shortcut keys. :-)
I guess I will have to change a bit of code to make this work. Probably going to remove modifier key support in exchange for direct access to the keys themselves...