Update common jar to allow the client to tell the host which controllers are attached

This commit is contained in:
Cameron Gutman 2017-02-04 21:02:11 -08:00
parent a539ac62ec
commit 7df1a39fcb
2 changed files with 5 additions and 3 deletions

Binary file not shown.

View File

@ -132,7 +132,8 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
private void releaseControllerNumber(GenericControllerContext context) { private void releaseControllerNumber(GenericControllerContext context) {
// If this device sent data as a gamepad, zero the values before removing // If this device sent data as a gamepad, zero the values before removing
if (context.assignedControllerNumber) { if (context.assignedControllerNumber) {
conn.sendControllerInput(context.controllerNumber, (short) 0, conn.sendControllerInput(context.controllerNumber, currentControllers,
(short) 0,
(byte) 0, (byte) 0, (byte) 0, (byte) 0,
(short) 0, (short) 0, (short) 0, (short) 0,
(short) 0, (short) 0); (short) 0, (short) 0);
@ -537,11 +538,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
} }
} }
conn.sendControllerInput(controllerNumber, conn.sendControllerInput(controllerNumber, currentControllers,
(short)0, (byte)0, (byte)0, (short)0, (short)0, (short)0, (short)0); (short)0, (byte)0, (byte)0, (short)0, (short)0, (short)0, (short)0);
} }
else { else {
conn.sendControllerInput(controllerNumber, inputMap, conn.sendControllerInput(controllerNumber, currentControllers,
inputMap,
leftTrigger, rightTrigger, leftTrigger, rightTrigger,
leftStickX, leftStickY, leftStickX, leftStickY,
rightStickX, rightStickY); rightStickX, rightStickY);