Tested if a joystick axis is not the nullAxis before assigning action to it.
This commit is contained in:
parent
34220640aa
commit
57dd2748e2
@ -72,8 +72,10 @@ public class DefaultJoystickAxis implements JoystickAxis {
|
||||
* @param negativeMapping The mapping to receive events when the axis is positive
|
||||
*/
|
||||
public void assignAxis(String positiveMapping, String negativeMapping){
|
||||
inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false));
|
||||
inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true));
|
||||
if (axisIndex != -1) {
|
||||
inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false));
|
||||
inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user