Remap logical ID instead of name since it is now

logical ID that is used for look-ups and it is
not locale specific.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9783 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 12 years ago
parent 9b763443fa
commit d9dd8603b8
  1. 18
      engine/src/lwjgl/com/jme3/input/lwjgl/JInputJoyInput.java

@ -213,14 +213,15 @@ public class JInputJoyInput implements JoyInput {
throw new IllegalArgumentException( "Component is not an axis:" + comp );
}
String original = comp.getName();
String name = JoystickCompatibilityMappings.remapComponent( controller.getName(), original );
String name = comp.getName();
String original = id.getName();
String logicalId = JoystickCompatibilityMappings.remapComponent( controller.getName(), original );
if( name != original ) {
logger.log(Level.INFO, "Remapped:" + original + " to:" + name);
logger.log(Level.INFO, "Remapped:" + original + " to:" + logicalId);
}
JoystickButton button = new DefaultJoystickButton( getInputManager(), this, getButtonCount(),
name, id.getName() );
name, logicalId );
addButton(button);
buttonIndex.put( comp, button );
}
@ -234,14 +235,15 @@ public class JInputJoyInput implements JoyInput {
throw new IllegalArgumentException( "Component is not an axis:" + comp );
}
String original = comp.getName();
String name = JoystickCompatibilityMappings.remapComponent( controller.getName(), original );
String name = comp.getName();
String original = id.getName();
String logicalId = JoystickCompatibilityMappings.remapComponent( controller.getName(), original );
if( name != original ) {
logger.log(Level.INFO, "Remapped:" + original + " to:" + name);
logger.log(Level.INFO, "Remapped:" + original + " to:" + logicalId);
}
JoystickAxis axis = new DefaultJoystickAxis( getInputManager(),
this, getAxisCount(), name, id.getName(),
this, getAxisCount(), name, logicalId,
comp.isAnalog(), comp.isRelative(),
comp.getDeadZone() );
addAxis(axis);

Loading…
Cancel
Save