use of net.java.games.input.ControllerEnvironment in project lwjgl by LWJGL.
the class Controllers method create.
/**
* Initialise the controllers collection
*
* @throws LWJGLException Indicates a failure to initialise the controller library.
*/
public static void create() throws LWJGLException {
if (created)
return;
try {
ControllerEnvironment env = ControllerEnvironment.getDefaultEnvironment();
net.java.games.input.Controller[] found = env.getControllers();
ArrayList<net.java.games.input.Controller> lollers = new ArrayList<net.java.games.input.Controller>();
for (net.java.games.input.Controller c : found) {
if ((!c.getType().equals(net.java.games.input.Controller.Type.KEYBOARD)) && (!c.getType().equals(net.java.games.input.Controller.Type.MOUSE))) {
lollers.add(c);
}
}
for (net.java.games.input.Controller c : lollers) {
createController(c);
}
created = true;
} catch (Throwable e) {
throw new LWJGLException("Failed to initialise controllers", e);
}
}
Aggregations