Game Development Community

simulate Accelerometer by joystick in iTGB

by Bruno Morin · in iTorque 2D · 04/10/2009 (2:04 pm) · 7 replies

I connect joystick to MAC and want to test Accelerometer.
MAC does detect joystick. but iTGB didn't send any response. many forums mention these codes.
$enableDirectInput = 1;
enableJoystick();
echoInputState();

where should I write this code?

Accelerometer is working fine in IPhone.




#1
04/10/2009 (2:51 pm)
Direct input is a windows and directx system. It doesn't work on a mac unless you are running iTGB through parallels or a nother virtual windows emulator.
#2
04/11/2009 (12:46 pm)
Peters reply is correct, but doesn't mention the larger issue: no one wrote code for joystick handling on the Mac. This is what I gathered when I dug through the forums looking for a solution to the same question Bruno asked. Enable joystick isn't even a function on mac, if you put it in your script it will error.
#3
04/13/2009 (2:55 pm)
thank you guys..
#4
04/13/2009 (5:33 pm)
I think you would have to change the source in order to pull this one off
#5
06/15/2009 (12:10 pm)
ok wait, so you need to write code, that does not exist in Torque Script in order to use the accelerometer?
#6
06/15/2009 (12:13 pm)
Yes support for joystick on the mac is not in the TGB nor iTGB product.
#7
06/15/2009 (12:14 pm)
The accelerometer code works fine on the iPhone. You simply can't *simulate* it with a joystick on the Mac.