public XboxControllerSupport() {
    System.out.println("JInput version: " + Version.getVersion());

    xboxController = getXboxController();
    if (xboxController == null) {
      System.out.println("No Xbox controller detected, disabling game pad support");
    } else {
      System.out.println("360 Controller Found");

      dPad = xboxController.getComponent(Component.Identifier.Axis.POV);
      buttons = new Component[10];
      buttons[A_BUTTON] = xboxController.getComponent(Component.Identifier.Button._0);
      buttons[B_BUTTON] = xboxController.getComponent(Component.Identifier.Button._1);
      buttons[X_BUTTON] = xboxController.getComponent(Component.Identifier.Button._2);
      buttons[Y_BUTTON] = xboxController.getComponent(Component.Identifier.Button._3);
      buttons[START_BUTTON] = xboxController.getComponent(Component.Identifier.Button._7);
      buttons[BACK_BUTTON] = xboxController.getComponent(Component.Identifier.Button._6);
    }
  }
Exemplo n.º 2
0
 /** @param args */
 public static void main(String[] args) {
   System.out.println("JInput version: " + Version.getVersion());
 }