com.jme.input.joystick
Interface Joystick

All Known Implementing Classes:
DummyJoystickInput.DummyJoystick, LWJGLJoystick

public interface Joystick

Represents a single joystick device.

Author:
Matthew D. Hicks, Irrisor

Method Summary
 int findAxis(java.lang.String name)
          Look through the axis for a given name.
 int getAxisCount()
           
 java.lang.String[] getAxisNames()
          Query the names of the joysticks axes.
 float getAxisValue(int axis)
          Query the current position of a single axis.
 int getButtonCount()
           
 java.lang.String getName()
           
 boolean isButtonPressed(int button)
          Query state of a button.
 void rumble(int axis, float intensity)
          Cause the rumbler (if existent) for specified axis to change force.
 

Method Detail

getAxisNames

java.lang.String[] getAxisNames()
Query the names of the joysticks axes. Indices correspond with getAxisValue(int).

Returns:
an array of axis names

getAxisCount

int getAxisCount()
Returns:
number of axes this joystick has

getAxisValue

float getAxisValue(int axis)
Query the current position of a single axis. Remember to call Input.update() prior to using these method.

Parameters:
axis - index of the axis of interest
Returns:
the current position of the axis between -1 and 1

getButtonCount

int getButtonCount()
Returns:
number of buttons this joystick has

isButtonPressed

boolean isButtonPressed(int button)
Query state of a button. Remember to call Input.update() prior to using these method.

Parameters:
button - index of a button (0 <= index < getButtonCount())
Returns:
true if button is currently pressed

getName

java.lang.String getName()
Returns:
name of this joystick

rumble

void rumble(int axis,
            float intensity)
Cause the rumbler (if existent) for specified axis to change force.

Parameters:
axis - index of the axis to be rumbled
intensity - new force intensity

findAxis

int findAxis(java.lang.String name)
Look through the axis for a given name.

Parameters:
name - the name of the axis we are looking for
Returns:
the index of the matching axis or -1 if none.