Package com.jme3.input
Interface Joystick
- All Known Implementing Classes:
AbstractJoystick
,AndroidJoystickJoyInput14.AndroidJoystick
,AndroidSensorJoyInput.AndroidSensorJoystick
,GlfwJoystickInput.GlfwJoystick
,JInputJoyInput.JInputJoystick
public interface Joystick
A joystick represents a single joystick that is installed in the system.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignAxis
(String positiveMapping, String negativeMapping, int axisId) Deprecated.Use JoystickAxis.assignAxis() instead.void
assignButton
(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.int
Returns the number of axes on this joystick.Returns the JoystickButton with the specified logical ID.int
Returns the number of buttons on this joystick.Returns a read-only list of all joystick buttons for this Joystick.int
getJoyId()
Returns the joyId of this joystick.getName()
Returns the name of this joystick.Returns the POV X axis for this joystick.Returns the POV Y axis for this joystick.getXAxis()
Returns the X axis for this joystick.int
Gets the index number for the X axis on the joystick.getYAxis()
Returns the Y axis for this joystick.int
Gets the index number for the Y axis on the joystick.void
rumble
(float amount) Rumbles the joystick for the given amount/magnitude.
-
Method Details
-
rumble
void rumble(float amount) Rumbles the joystick for the given amount/magnitude.- Parameters:
amount
- The amount to rumble. Should be between 0 and 1.
-
assignButton
Deprecated.Use JoystickButton.assignButton() instead.Assign the mapping name to receive events from the given button index on the joystick.- Parameters:
mappingName
- The mapping to receive joystick button events.buttonId
- The button index.- See Also:
-
assignAxis
Deprecated.Use JoystickAxis.assignAxis() instead.Assign the mappings to receive events from the given joystick axis.- Parameters:
positiveMapping
- The mapping to receive events when the axis is negativenegativeMapping
- The mapping to receive events when the axis is positiveaxisId
- The axis index.- See Also:
-
getAxis
Returns the JoystickAxis with the specified logical ID.- Parameters:
logicalId
- The id of the axis to search for as returned by JoystickAxis.getLogicalId().- Returns:
- the pre-existing instance, or null if not found
-
getAxes
List<JoystickAxis> getAxes()Returns a read-only list of all joystick axes for this Joystick.- Returns:
- an unmodifiable list of pre-existing instances
-
getButton
Returns the JoystickButton with the specified logical ID.- Parameters:
logicalId
- The id of the axis to search for as returned by JoystickButton.getLogicalId().- Returns:
- the pre-existing instance, or null if not found
-
getButtons
List<JoystickButton> getButtons()Returns a read-only list of all joystick buttons for this Joystick.- Returns:
- an unmodifiable list of pre-existing instances
-
getXAxis
JoystickAxis getXAxis()Returns the X axis for this joystick.E.g. for most gamepads, the left control stick X axis will be returned.
- Returns:
- the pre-existing instance
- See Also:
-
getYAxis
JoystickAxis getYAxis()Returns the Y axis for this joystick.E.g. for most gamepads, the left control stick Y axis will be returned.
- Returns:
- the pre-existing instance
- See Also:
-
getPovXAxis
JoystickAxis getPovXAxis()Returns the POV X axis for this joystick. This is a convenience axis providing an x-axis subview of the HAT axis.- Returns:
- the pre-existing instance
- See Also:
-
getPovYAxis
JoystickAxis getPovYAxis()Returns the POV Y axis for this joystick. This is a convenience axis providing a y-axis subview of the HAT axis.- Returns:
- the pre-existing instance
- See Also:
-
getXAxisIndex
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.
- Returns:
- The axis index for the X axis for this joystick.
- See Also:
-
getYAxisIndex
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.
- Returns:
- The axis index for the Y axis for this joystick.
- See Also:
-
getAxisCount
int getAxisCount()Returns the number of axes on this joystick.- Returns:
- the number of axes on this joystick.
-
getButtonCount
int getButtonCount()Returns the number of buttons on this joystick.- Returns:
- the number of buttons on this joystick.
-
getName
String getName()Returns the name of this joystick.- Returns:
- the name of this joystick.
-
getJoyId
int getJoyId()Returns the joyId of this joystick.- Returns:
- the joyId of this joystick.
-