Package com.jme3.input
Class AbstractJoystick
java.lang.Object
com.jme3.input.AbstractJoystick
- All Implemented Interfaces:
- Joystick
- Direct Known Subclasses:
- AndroidJoystickJoyInput14.AndroidJoystick,- AndroidSensorJoyInput.AndroidSensorJoystick,- GlfwJoystickInput.GlfwJoystick,- JInputJoyInput.JInputJoystick
A joystick represents a single joystick that is installed in the system.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractJoystick(InputManager inputManager, JoyInput joyInput, int joyId, String name) Creates a new joystick instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddAxis(JoystickAxis axis) protected voidaddButton(JoystickButton button) voidassignAxis(String positiveMapping, String negativeMapping, int axisId) Deprecated.Use JoystickAxis.assignAxis() instead.voidassignButton(String mappingName, int buttonId) Deprecated.Use JoystickButton.assignButton() instead.getAxes()Returns a read-only list of all joystick axes for this Joystick.Returns the JoystickAxis with the specified logical ID.intReturns the number of axes on this joystick.Returns the JoystickButton with the specified logical ID.intReturns the number of buttons on this joystick.Returns a read-only list of all joystick buttons for this Joystick.protected InputManagerintgetJoyId()Returns the joyId of this joystick.protected JoyInputgetName()Returns the name of this joystick.intGets the index number for the X axis on the joystick.intGets the index number for the Y axis on the joystick.voidrumble(float amount) Rumbles the joystick for the given amount/magnitude.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jme3.input.JoystickgetPovXAxis, getPovYAxis, getXAxis, getYAxis
- 
Constructor Details- 
AbstractJoystickCreates a new joystick instance. Only used internally.- Parameters:
- inputManager- (alias created)
- joyInput- (alias created)
- joyId- ID to assign to the instance
- name- name to assign to the instance
 
 
- 
- 
Method Details- 
getInputManager
- 
getJoyInput
- 
addAxis
- 
addButton
- 
rumblepublic void rumble(float amount) Rumbles the joystick for the given amount/magnitude.
- 
assignButtonDeprecated.Use JoystickButton.assignButton() instead.Assign the mapping name to receive events from the given button index on the joystick.- Specified by:
- assignButtonin interface- Joystick
- Parameters:
- mappingName- The mapping to receive joystick button events.
- buttonId- The button index.
- See Also:
 
- 
assignAxisDeprecated.Use JoystickAxis.assignAxis() instead.Assign the mappings to receive events from the given joystick axis.- Specified by:
- assignAxisin interface- Joystick
- Parameters:
- positiveMapping- The mapping to receive events when the axis is negative
- negativeMapping- The mapping to receive events when the axis is positive
- axisId- The axis index.
- See Also:
 
- 
getAxisDescription copied from interface:JoystickReturns the JoystickAxis with the specified logical ID.
- 
getAxesReturns a read-only list of all joystick axes for this Joystick.
- 
getAxisCountpublic int getAxisCount()Returns the number of axes on this joystick.- Specified by:
- getAxisCountin interface- Joystick
- Returns:
- the number of axes on this joystick.
 
- 
getButtonDescription copied from interface:JoystickReturns the JoystickButton with the specified logical ID.
- 
getButtonsReturns a read-only list of all joystick buttons for this Joystick.- Specified by:
- getButtonsin interface- Joystick
- Returns:
- an unmodifiable list of pre-existing instances
 
- 
getButtonCountpublic int getButtonCount()Returns the number of buttons on this joystick.- Specified by:
- getButtonCountin interface- Joystick
- Returns:
- the number of buttons on this joystick.
 
- 
getNameReturns the name of this joystick.
- 
getJoyIdpublic int getJoyId()Returns the joyId of this joystick.
- 
getXAxisIndexpublic int getXAxisIndex()Gets the index number for the X axis on the joystick.E.g. for most gamepads, the left control stick X axis will be returned. - Specified by:
- getXAxisIndexin interface- Joystick
- Returns:
- The axis index for the X axis for this joystick.
- See Also:
 
- 
getYAxisIndexpublic int getYAxisIndex()Gets the index number for the Y axis on the joystick.E.g. for most gamepads, the left control stick Y axis will be returned. - Specified by:
- getYAxisIndexin interface- Joystick
- Returns:
- The axis index for the Y axis for this joystick.
- See Also:
 
- 
toString
 
-