|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.input.Input
com.jme.input.joystick.JoystickInput
public abstract class JoystickInput
Manager for attached Joysticks. Singleton - use the get()
method.
Joysticks can be polled by calling Input.update()
.
Field Summary | |
---|---|
static java.lang.String |
INPUT_DUMMY
|
static java.lang.String |
INPUT_LWJGL
|
protected java.util.ArrayList<JoystickInputListener> |
listeners
list of event listeners. |
Constructor Summary | |
---|---|
protected |
JoystickInput()
Protect contructor to avoid direct invocation. |
Method Summary | |
---|---|
void |
addListener(JoystickInputListener listener)
Subscribe a listener to receive joystick events. |
protected abstract void |
destroy()
|
static void |
destroyIfInitalized()
Destroy the input if it was initialized. |
abstract java.util.ArrayList<Joystick> |
findJoysticksByAxis(java.lang.String... axis)
Locate and return a joystick with the given axis names. |
static JoystickInput |
get()
Initialize (if needed) and return the JoystickInput. |
abstract Joystick |
getDefaultJoystick()
This is a method to obtain a single joystick. |
abstract Joystick |
getJoystick(int index)
Game controller at specified index. |
abstract int |
getJoystickCount()
|
static java.lang.Class<?> |
getProvider()
Query current provider for input. |
void |
removeListener(JoystickInputListener listener)
Unsubscribe a listener. |
void |
removeListeners()
Remove all listeners and disable event generation. |
static void |
setProvider(java.lang.Class value)
Change the provider used for joystick input. |
static void |
setProvider(java.lang.String value)
Change the provider used for joystick input. |
Methods inherited from class com.jme.input.Input |
---|
update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INPUT_LWJGL
public static final java.lang.String INPUT_DUMMY
protected java.util.ArrayList<JoystickInputListener> listeners
Constructor Detail |
---|
protected JoystickInput()
Method Detail |
---|
public static JoystickInput get()
getProvider()
.setProvider(String)
before creating the display system
to enable it (and choose implementation).
public static java.lang.Class<?> getProvider()
public static void setProvider(java.lang.String value)
INPUT_LWJGL
.
value
- new provider class name
java.lang.IllegalStateException
- if called after first call of get()
. Note that get is called when
creating the DisplaySystem.
java.lang.IllegalArgumentException
- if the specified class cannot be found using Class.forName(String)
public static void setProvider(java.lang.Class value)
InputSystem.INPUT_SYSTEM_LWJGL
.
value
- new provider
java.lang.IllegalStateException
- if called after first call of get()
. Note that get is called when
creating the DisplaySystem.public void addListener(JoystickInputListener listener)
listener
- to be subscribedpublic void removeListener(JoystickInputListener listener)
listener
- to be unsuscribedaddListener(JoystickInputListener)
public void removeListeners()
public abstract int getJoystickCount()
public abstract Joystick getJoystick(int index)
index
- index of the controller (0 <= index <= getJoystickCount()
)
public abstract Joystick getDefaultJoystick()
public static void destroyIfInitalized()
protected abstract void destroy()
public abstract java.util.ArrayList<Joystick> findJoysticksByAxis(java.lang.String... axis)
axis
- 1 or more names to look by
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |