|
Re: Is It Possible to Code for 2 Joysticks and a Gamepad?
A gamepad is actually a single device (so you would only call Joystick(3) in your code, unless for some reason you have two)
If you look in Control Panel, there is a special category where gamepads/joysticks show up (Devices and Printers in windows 7), if you go to the gamepad properties, you can get the raw button and axis values of the joystick (the screen shows the state and axis/button id of each); some gamepads don't bind their inputs the way you expect them to, so it's a good idea to look here to figure out your button/axis IDs.
If I recall correctly, the Xbox 360 controller may not be fully supported by the Joystick class or have some weird bindings that aren't intuitive in code, but I've never tried myself so I could be wrong. A lot of teams use the Logitech f310 for gamepads (for an alternative to PS3/XB360).
We personally use a Logitech Extreme 3D Pro, I like the button layout for standard joysticks a little better than gamepads. I generally try to map operator (and driver) buttons so that they mimic the outcome of actions (such as using the upper/lower buttons of a button pair to raise and lower a mechanism) and this tends to work out a little better on a regular joystick.
Usually, I avoid giving the operator any analog inputs, as this forces them to 'guess', it's better to have a fixed setpoint for nearly everything where precision/repeatability is important.
|