|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.input.Joystick
public final class Joystick
A joystick represents a single joystick that is installed in the system.
Constructor Summary | |
---|---|
Joystick(InputManager inputManager,
JoyInput joyInput,
int joyId,
java.lang.String name,
int buttonCount,
int axisCount,
int xAxis,
int yAxis)
Creates a new joystick instance. |
Method Summary | |
---|---|
void |
assignAxis(java.lang.String positiveMapping,
java.lang.String negativeMapping,
int axisId)
Assign the mappings to receive events from the given joystick axis. |
void |
assignButton(java.lang.String mappingName,
int buttonId)
Assign the mapping name to receive events from the given button index on the joystick. |
int |
getAxisCount()
Returns the number of axes on this joystick. |
int |
getButtonCount()
Returns the number of buttons on this joystick. |
java.lang.String |
getName()
Returns the name of this joystick. |
int |
getXAxisIndex()
Gets the index number for the X axis on the joystick. |
int |
getYAxisIndex()
Gets the index number for the Y axis on the joystick. |
void |
rumble(float amount)
Rumbles the joystick for the given amount/magnitude. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Joystick(InputManager inputManager, JoyInput joyInput, int joyId, java.lang.String name, int buttonCount, int axisCount, int xAxis, int yAxis)
Method Detail |
---|
public void rumble(float amount)
amount
- The amount to rumble. Should be between 0 and 1.public void assignButton(java.lang.String mappingName, int buttonId)
mappingName
- The mapping to receive joystick button events.buttonId
- The button index.getButtonCount()
public void assignAxis(java.lang.String positiveMapping, java.lang.String negativeMapping, int axisId)
positiveMapping
- The mapping to receive events when the axis is negativenegativeMapping
- The mapping to receive events when the axis is positiveaxisId
- The axis index.getAxisCount()
public int getXAxisIndex()
E.g. for most gamepads, the left control stick X axis will be returned.
assignAxis(java.lang.String, java.lang.String, int)
public int getYAxisIndex()
E.g. for most gamepads, the left control stick Y axis will be returned.
assignAxis(java.lang.String, java.lang.String, int)
public int getAxisCount()
public int getButtonCount()
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |