DAController is a wrapper class for use with the proCONTROLL joystick library written by Christian Riekoff for Processing. It encapsulates the two analog sticks and all the buttons found on a typical dual analog controller.
DAController(ControllDevice d)
The constructor must be passed a ControllDevice obtained from a ControllIO object. It then uses the name of the device to determine which mapping to use. The currently known mappings are for the Super Joy Box 3 PS/PS2 Controller Adaptor for Windows (with the driver installed), the PSX/N64 controller adapter for PC USB, the Logitech Dual Action USB controller, and the XBOX 360 USB controller. If you try to create a controller object with an unrecognized device, it will attempt to use the Logitech mapping. When that happens, please make note of the correct mapping for your device, along with output of getName() for that device and send it on to me.
ControllStick leftStick, rightStick
The ControllStick objects are directly exposed so that multipliers and tolerances can be set on them and so forth. See the proCONTROLL documentation to find out what methods are available on them.
boolean invertLeftX, invertLeftY, invertRightX, invertRightY
Use these to invert any axis you'd like.
float leftTriggerMultiplier, rightTriggerMultiplier
float leftTriggerTolerance, rightTriggerTolerance
float leftTriggerTotalValue, rightTriggerTotalValue
On the XBOX 360 controller the left and right triggers are analog. These properties can be used to set and get the multiplier, tolerance and total value of the triggers. The multiplier and total value properties are still valid for controllers that do not have analog triggers, which will be explained below.
void rumble(float amt) void rumble(float amt, int id)
These simply pass their values to the private ControllDevice rumble() method.
float leftX()
Returns the X value of leftStick, adjusting for inversion.
float leftY()
Returns the Y value of leftStick, adjusting for inversion.
float leftZ()
Returns the value of the left trigger in the case of the XBOX 360 controller, otherwise it returns leftTriggerMultiplier. Also increments leftTriggerTotalValue by the return value.
float rightX()
Returns the X value of rightStick, adjusting for inversion.
float rightY()
Returns the Y value of rightStick, adjusting for inversion.
float rightZ()
Returns the value of the right trigger in the case of the XBOX 360 controller, otherwise it returns rightTriggerMultiplier. Also increments rightTriggerTotalValue by the return value.
boolean T()
Returns true if the Triangle button is pressed (note that this is the Y button on the XBOX 360 controller and the 4 button on the Logitech controller).
boolean C()
Returns true if the Circle button is pressed (note that this is the B button on the XBOX 360 controller and the 3 button on the Logitech controller).boolean X()
Returns true if the X button is pressed (note that this is the A button on the XBOX 360 controller and the 2 button on the Logitech controller).
boolean S()
Returns true if the Square button is pressed (note that this is the X button on the XBOX 360 controller and the 1 button on the Logitech controller).
boolean L1()
Returns true if the L1 button is pressed.
boolean L2()
Returns true if the L2 button is pressed. If you are using and XBOX 360 Controller, this will only be true if leftZ() is non-zero.
boolean L3()
Returns true if the L3 button is pressed.
boolean R1()
Returns true if the R1 button is pressed.
boolean R2()
Returns true if the R2 button is pressed. If you are using and XBOX 360 Controller, this will only be true if rightZ() is non-zero.
boolean R3()
Returns true if the R3 button is pressed.
boolean Start()
Returns true if the Start button is pressed (note that this is button 10 on the Logitech controller).
boolean Select()
Returns true if the Select button is pressed (note that this is button 9 on the Logitech controller and the Back button on the XBO 360 controller).
boolean DUp()
Returns true if Up is pressed on the D-Pad.
boolean DDown()
Returns true if Down is pressed on the D-Pad.
boolean DLeft()
Returns true if Left is pressed on the D-Pad.
boolean DRight()
Returns true if Right is pressed on the D-Pad.