This is the code:
public class TestPad extends SimpleApplication implements AnalogFunctionListener{
public static final String GROUP_MOVEMENT = "group movement";
public static final FunctionId F_MOVE = new FunctionId(GROUP_MOVEMENT, "Move");
InputMapper inputMapper;
public static void main(String[] args){
TestPad app = new TestPad();
AppSettings settings = new AppSettings(true);
settings.setUseJoysticks(true);
app.setSettings(settings);
app.start();
}
@Override
public void simpleInitApp() {
GuiGlobals.initialize(this);
inputMapper = GuiGlobals.getInstance().getInputMapper();
inputMapper.map(F_MOVE, InputState.Negative, Axis.JOYSTICK_LEFT_Y);
inputMapper.map(F_MOVE, KeyInput.KEY_UP);
inputMapper.map(F_MOVE, InputState.Negative, KeyInput.KEY_DOWN);
inputMapper.addAnalogListener(this, F_MOVE);
inputMapper.activateGroup(GROUP_MOVEMENT);
}
@Override
public void valueActive(FunctionId fi, double d, double d1) {
System.out.println(d);
}
}
If I connect a DirectInput device everything is ok, but if I connect a Xinput device and press an analog axis I get this error:
WARN: no axis mapping for:JoystickAxis[name=Rotazione Y, parent=Gamepad F310 (Controller), id=2, logicalId=ry, isAnalog=true, isRelative=false, deadZone=0.0]
WARN: no axis mapping for:JoystickAxis[name=Rotazione X, parent=Gamepad F310 (Controller), id=3, logicalId=rx, isAnalog=true, isRelative=false, deadZone=0.0]
Which is very similar to this output with another Xinput device (the xbox controller)