3
\$\begingroup\$

On Android TV, I need to be able to detect the remote control centre button to start the game.

I tried:

if (Gdx.input.justTouched() || Gdx.input.isKeyJustPressed(Input.Keys.SPACE) || Gdx.input.isKeyJustPressed(Input.Keys.DPAD_CENTER) ||
                Gdx.input.isKeyJustPressed(Input.Keys.ENTER) ||
                Gdx.input.isKeyJustPressed(Input.Keys.BUTTON_SELECT) ||
                Gdx.input.isKeyJustPressed(Input.Keys.BUTTON_START))  {
...}

All does not work. The only one that works is isKeyPressed(Input.Keys.DPAD_CENTER), but that will return more than one key pressed.

\$\endgroup\$
1
\$\begingroup\$

This is pretty late but try Gdx.input.isKeyJustPressed(Input.Keys.CENTER). That works for my Nvidia Shield remote. Also as a side not this is also the A button on the Nvidia Shield controller.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.