public class DefaultJoystickAxis extends java.lang.Object implements JoystickAxis
LEFT_TRIGGER, POV_X, POV_Y, RIGHT_TRIGGER, X_AXIS, Y_AXIS, Z_AXIS, Z_ROTATION
Constructor and Description |
---|
DefaultJoystickAxis(InputManager inputManager,
Joystick parent,
int axisIndex,
java.lang.String name,
java.lang.String logicalId,
boolean isAnalog,
boolean isRelative,
float deadZone)
Creates a new joystick axis instance.
|
Modifier and Type | Method and Description |
---|---|
void |
assignAxis(java.lang.String positiveMapping,
java.lang.String negativeMapping)
Assign the mappings to receive events from the given joystick axis.
|
int |
getAxisId()
Returns the axisId of this joystick axis.
|
float |
getDeadZone()
Returns the suggested dead zone for this axis.
|
Joystick |
getJoystick()
Returns the joystick to which this axis object belongs.
|
java.lang.String |
getLogicalId()
Returns the logical identifier of this joystick axis.
|
java.lang.String |
getName()
Returns the name of this joystick.
|
boolean |
isAnalog()
Returns true if this is an analog axis, meaning the values
are a continuous range instead of 1, 0, and -1.
|
boolean |
isRelative()
Returns true if this axis presents relative values.
|
void |
setDeadZone(float f)
Sets/overrides the dead zone for this axis.
|
java.lang.String |
toString() |
public DefaultJoystickAxis(InputManager inputManager, Joystick parent, int axisIndex, java.lang.String name, java.lang.String logicalId, boolean isAnalog, boolean isRelative, float deadZone)
public void assignAxis(java.lang.String positiveMapping, java.lang.String negativeMapping)
assignAxis
in interface JoystickAxis
positiveMapping
- The mapping to receive events when the axis is negativenegativeMapping
- The mapping to receive events when the axis is positivepublic Joystick getJoystick()
getJoystick
in interface JoystickAxis
public java.lang.String getName()
getName
in interface JoystickAxis
public java.lang.String getLogicalId()
getLogicalId
in interface JoystickAxis
public int getAxisId()
getAxisId
in interface JoystickAxis
public boolean isAnalog()
isAnalog
in interface JoystickAxis
public boolean isRelative()
isRelative
in interface JoystickAxis
public float getDeadZone()
getDeadZone
in interface JoystickAxis
public void setDeadZone(float f)
public java.lang.String toString()
toString
in class java.lang.Object