In order to to change the location of a systems button on the joystick, very specific steps must be taken in order to quell the chaos. All of the button locations are found in the Human Input class. For example,

public static Button lifterMoveUpButton = new JoystickButton(leftJoystick,1);

would be the button representing the lifterMoveUp action. In order to change the physical location of the button(i.e. A button to B button on a different joystick), you would change the joystick location and the button number. Commented values for available buttons are available in the code below the main buttons.

public static Button lifterMoveUpButton = new JoystickButton(rightJoystick,2);

However, if you wanted to use one of the xbox triggers, you would change the joystick value to xbox, and change the button type to Xbox Trigger.

public static Button xboxLeftTrigger = new XboxTrigger(xboxController,XboxTrigger.TriggerConstant.LEFT_TRIGGER);

If you want to register a command to a button use this line

HumanInput.registerWhileHeldCommand(Humaninput.lifterMoveUpButton, new MyCommand())

Last modified 6 years ago Last modified on Feb 5, 2015, 8:18:53 PM