(Joystick Input) XBox 360 Controller

Hey guys, just fiddling around with my XBox 360 controller to see if I can get it all working. So far all buttons and analogs are completely functional, except for the vibration/rumble function. Anyone got a clue wether I’m doing something wrong, it is specific for this controller or if this function is not completely functional at the moment?



I’m trying things along this line:

[java]inputManager.getJoysticks()[0].rumble(1f)[/java]

Values are supposed to be between 0 and 1 but whatever value I try, the controller is a dead weight. I know my controller is on joystick 0, as all buttons are mapped on that one and functional. Other values would try to make my keyboard or wacom tablet rumble and I’m not in for that kind of surprises :wink:





To provide some information in return, here is the whole controller mapped out:

[java] inputManager.addMapping(“LS Up”, new JoyAxisTrigger(curJoystick, 0, true));

inputManager.addMapping(“LS Down”, new JoyAxisTrigger(curJoystick, 0, false));

inputManager.addMapping(“LS Left”, new JoyAxisTrigger(curJoystick, 1, false));

inputManager.addMapping(“LS Right”, new JoyAxisTrigger(curJoystick, 1, true));

inputManager.addListener(this, “LS Left”, “LS Right”, “LS Down”, “LS Up”);



inputManager.addMapping(“RS Up”, new JoyAxisTrigger(curJoystick, 2, true));

inputManager.addMapping(“RS Down”, new JoyAxisTrigger(curJoystick, 2, false));

inputManager.addMapping(“RS Left”, new JoyAxisTrigger(curJoystick, 3, false));

inputManager.addMapping(“RS Right”, new JoyAxisTrigger(curJoystick, 3, true));

inputManager.addListener(this, “RS Left”, “RS Right”, “RS Down”, “RS Up”);



inputManager.addMapping(“DPAD Left”, new JoyAxisTrigger(curJoystick, JoyInput.AXIS_POV_X, true));

inputManager.addMapping(“DPAD Right”, new JoyAxisTrigger(curJoystick, JoyInput.AXIS_POV_X, false));

inputManager.addMapping(“DPAD Down”, new JoyAxisTrigger(curJoystick, JoyInput.AXIS_POV_Y, true));

inputManager.addMapping(“DPAD Up”, new JoyAxisTrigger(curJoystick, JoyInput.AXIS_POV_Y, false));

inputManager.addListener(this, “DPAD Left”, “DPAD Right”, “DPAD Down”, “DPAD Up”);



inputManager.addMapping(“Trigger L”, new JoyAxisTrigger(curJoystick, 4, false));

inputManager.addMapping(“Trigger R”, new JoyAxisTrigger(curJoystick, 4, true));

inputManager.addListener(this, “Trigger L”, “Trigger R”);



joysticks[curJoystick].assignButton(“Button A”, 0);

joysticks[curJoystick].assignButton(“Button B”, 1);

joysticks[curJoystick].assignButton(“Button X”, 2);

joysticks[curJoystick].assignButton(“Button Y”, 3);

inputManager.addListener(this, “Button A”, “Button B”, “Button X”, “Button Y”);



joysticks[curJoystick].assignButton(“Button LB”, 4);

joysticks[curJoystick].assignButton(“Button RB”, 5);

joysticks[curJoystick].assignButton(“Button Back”, 6);

joysticks[curJoystick].assignButton(“Button Start”, 7);

inputManager.addListener(this, “Button LB”, “Button RB”, “Button Back”, “Button Start”);



joysticks[curJoystick].assignButton(“Button LS”, 8 );

joysticks[curJoystick].assignButton(“Button RS”, 9);

inputManager.addListener(this, “Button LS”, “Button RS”);[/java]

Rumble isn’t supported for Xbox360 controller because we use DirectInput to access it but Microsoft doesn’t like it anymore. The new thing is XInput which is Vista/7 only and currently its not supported by us.

Thanks Mo :wink: