@Override public void resume () { inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler); Gdx.app.log(TAG, "controller life cycle listener resumed"); }
public ControllerLifeCycleListener(AndroidControllers controllers) { this.controllers = controllers; this.inputManager = (InputManager)((Context)Gdx.app).getSystemService(Context.INPUT_SERVICE); Gdx.app.addLifecycleListener(this); inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler); }
@Override public void registerInputDeviceListener(InputDeviceListener listener, Handler handler) { V16InputDeviceListener v16Listener = new V16InputDeviceListener(listener); mInputManager.registerInputDeviceListener(v16Listener, handler); mListeners.put(listener, v16Listener); }
@Override protected void onResume() { super.onResume(); // Register an input device listener to watch when input devices are // added, removed or reconfigured. mInputManager.registerInputDeviceListener(this, null); // Query all input devices. // We do this so that we can see them in the log as they are enumerated. int[] ids = mInputManager.getInputDeviceIds(); for (int i = 0; i < ids.length; i++) { getInputDeviceState(ids[i]); } }
@Override protected void onResume() { super.onResume(); // Register an input device listener to watch when input devices are // added, removed or reconfigured. mInputManager.registerInputDeviceListener(this, null); // Query all input devices. // We do this so that we can see them in the log as they are enumerated. int[] ids = mInputManager.getInputDeviceIds(); for (int i = 0; i < ids.length; i++) { getInputDeviceState(ids[i]); } }