com.jme.input.joystick.lwjgl
Class LWJGLJoystickInput
java.lang.Object
com.jme.input.Input
com.jme.input.joystick.JoystickInput
com.jme.input.joystick.lwjgl.LWJGLJoystickInput
public class LWJGLJoystickInput
- extends JoystickInput
LWJGL Implementation of JoystickInput
.
Method Summary |
protected void |
destroy()
|
java.util.ArrayList<Joystick> |
findJoysticksByAxis(java.lang.String... axis)
Locate and return a joystick with the given axis names. |
Joystick |
getDefaultJoystick()
This is a method to obtain a single joystick. |
Joystick |
getJoystick(int index)
Game controller at specified index. |
int |
getJoystickCount()
|
void |
update()
Poll data for this input system part (update the values) and send events to all listeners
(events will not be generated if no listeners were added via addListener). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LWJGLJoystickInput
protected LWJGLJoystickInput()
throws java.lang.RuntimeException
- Throws:
java.lang.RuntimeException
- if initialization failed
update
public void update()
- Description copied from class:
Input
- Poll data for this input system part (update the values) and send events to all listeners
(events will not be generated if no listeners were added via addListener).
- Specified by:
update
in class Input
getJoystickCount
public int getJoystickCount()
- Specified by:
getJoystickCount
in class JoystickInput
- Returns:
- number of attached game controllers
getJoystick
public Joystick getJoystick(int index)
- Description copied from class:
JoystickInput
- Game controller at specified index.
- Specified by:
getJoystick
in class JoystickInput
- Parameters:
index
- index of the controller (0 <= index <= JoystickInput.getJoystickCount()
)
- Returns:
- game controller
getDefaultJoystick
public Joystick getDefaultJoystick()
- Description copied from class:
JoystickInput
- This is a method to obtain a single joystick. It's simple to used but not
recommended (user may have multiple joysticks!).
- Specified by:
getDefaultJoystick
in class JoystickInput
- Returns:
- what the implementation thinks is the main joystick, not null!
destroy
protected void destroy()
- Specified by:
destroy
in class JoystickInput
findJoysticksByAxis
public java.util.ArrayList<Joystick> findJoysticksByAxis(java.lang.String... axis)
- Description copied from class:
JoystickInput
- Locate and return a joystick with the given axis names.
- Specified by:
findJoysticksByAxis
in class JoystickInput
- Parameters:
axis
- 1 or more names to look by
- Returns:
- array of joysticks, each having axis to match every name (case insensitive)