public AndroidControllers() { Gdx.app.addLifecycleListener(this); gatherControllers(false); setupEventQueue(); ((AndroidInput)Gdx.input).addKeyListener(this); ((AndroidInputThreePlus)Gdx.input).addGenericMotionListener(this); // use InputManager on Android +4.1 to receive (dis-)connect events if(Gdx.app.getVersion() >= 16) { try { String className = "com.badlogic.gdx.controllers.android.ControllerLifeCycleListener"; Class.forName(className).getConstructor(AndroidControllers.class).newInstance(this); } catch(Exception e) { Gdx.app.log(TAG, "Couldn't register controller life-cycle listener"); } } }
@Override public AndroidInput getInput() { return input; }
@Override public AndroidInput getGdxInput() { return new OuyaInput(Gdx.app, ((Activity)Gdx.app), ((AndroidGraphics)Gdx.graphics).getView(), cfgApp); }
public AndroidInput getGdxInput() { return null; }