com.jme.input.joystick.lwjgl
Class LWJGLJoystickInput

java.lang.Object
  extended by com.jme.input.Input
      extended by com.jme.input.joystick.JoystickInput
          extended by com.jme.input.joystick.lwjgl.LWJGLJoystickInput

public class LWJGLJoystickInput
extends JoystickInput

LWJGL Implementation of JoystickInput.


Field Summary
 
Fields inherited from class com.jme.input.joystick.JoystickInput
INPUT_DUMMY, INPUT_LWJGL, listeners
 
Constructor Summary
protected LWJGLJoystickInput()
           
 
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 com.jme.input.joystick.JoystickInput
addListener, destroyIfInitalized, get, getProvider, removeListener, removeListeners, setProvider, setProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLJoystickInput

protected LWJGLJoystickInput()
                      throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException - if initialization failed
Method Detail

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)