public class Controllers
extends java.lang.Object
Controller instances. Query the available controllers via getControllers(), add
and remove global ControllerListener instances via addListener(ControllerListener) and
removeListener(ControllerListener). The listeners will be invoked on the rendering thread. The global listeners will
be invoked for all events generated by all controllers. Polling a Controller can be done by invoking one of its getter methods.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
preferredManager
The class name of a preferred
ControllerManager. |
| Constructor and Description |
|---|
Controllers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addListener(ControllerListener listener)
Add a global
ControllerListener that can react to events from all Controller instances. |
static void |
clearListeners()
Removes every global
ControllerListener previously added. |
static com.badlogic.gdx.utils.Array<Controller> |
getControllers()
Returns an array of connected
Controller instances. |
static Controller |
getCurrent() |
static com.badlogic.gdx.utils.Array<ControllerListener> |
getListeners()
Returns all listeners currently registered.
|
static void |
removeListener(ControllerListener listener)
Removes a global
ControllerListener. |
public static java.lang.String preferredManager
ControllerManager. If this is null then an appropriate ControllerManager will
automatically be selected. This must be set before any controllers or managers are found.public static com.badlogic.gdx.utils.Array<Controller> getControllers()
Controller instances. This method should only be called on the rendering thread.public static Controller getCurrent()
public static void addListener(ControllerListener listener)
ControllerListener that can react to events from all Controller instances. The listener will be
invoked on the rendering thread.listener - public static void removeListener(ControllerListener listener)
ControllerListener. The method must be called on the rendering thread.listener - public static void clearListeners()
ControllerListener previously added.public static com.badlogic.gdx.utils.Array<ControllerListener> getListeners()