Skip to content

Commit c7eb81c

Browse files
committed
Merge pull request #71 from CardcaptorRLH85/patch-1
Fix for the Xbox 360 Controller Definition
2 parents a3876ce + 60fb546 commit c7eb81c

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

strongback/src/org/strongback/hardware/Hardware.java

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -870,33 +870,34 @@ public static Gamepad logitechF310(int port) {
870870
() -> joystick.getRawButton(8),
871871
() -> joystick.getRawButton(9));
872872
}
873-
}
874-
/**
875-
* Create a Microsoft Xbox360 gamepad controlled by the Driver Station.
876-
*
877-
* @param port the port on the driver station that the gamepad is plugged into
878-
* @return the input device; never null
879-
*/
880-
public static Gamepad xbox360(int port) {
881-
Joystick joystick = new Joystick(port);
882-
return Gamepad.create(joystick::getRawAxis,
883-
joystick::getRawButton,
884-
joystick::getPOV,
885-
() -> joystick.getRawAxis(0),
886-
() -> joystick.getRawAxis(1) * -1,
887-
() -> joystick.getRawAxis(4),
888-
() -> joystick.getRawAxis(5) * -1,
889-
() -> joystick.getRawAxis(2),
890-
() -> joystick.getRawAxis(3),
891-
() -> joystick.getRawButton(5),
892-
() -> joystick.getRawButton(6),
893-
() -> joystick.getRawButton(1),
894-
() -> joystick.getRawButton(2),
895-
() -> joystick.getRawButton(3),
896-
() -> joystick.getRawButton(4),
897-
() -> joystick.getRawButton(8),
898-
() -> joystick.getRawButton(7),
899-
() -> joystick.getRawButton(9),
900-
() -> joystick.getRawButton(10));
873+
874+
/**
875+
* Create a Microsoft Xbox360 gamepad controlled by the Driver Station.
876+
*
877+
* @param port the port on the driver station that the gamepad is plugged into
878+
* @return the input device; never null
879+
*/
880+
public static Gamepad xbox360(int port) {
881+
Joystick joystick = new Joystick(port);
882+
return Gamepad.create(joystick::getRawAxis,
883+
joystick::getRawButton,
884+
joystick::getPOV,
885+
() -> joystick.getRawAxis(0),
886+
() -> joystick.getRawAxis(1) * -1,
887+
() -> joystick.getRawAxis(4),
888+
() -> joystick.getRawAxis(5) * -1,
889+
() -> joystick.getRawAxis(2),
890+
() -> joystick.getRawAxis(3),
891+
() -> joystick.getRawButton(5),
892+
() -> joystick.getRawButton(6),
893+
() -> joystick.getRawButton(1),
894+
() -> joystick.getRawButton(2),
895+
() -> joystick.getRawButton(3),
896+
() -> joystick.getRawButton(4),
897+
() -> joystick.getRawButton(8),
898+
() -> joystick.getRawButton(7),
899+
() -> joystick.getRawButton(9),
900+
() -> joystick.getRawButton(10));
901+
}
901902
}
902903
}

0 commit comments

Comments
 (0)