Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

LibGDX: How to detect remote button press for Android TV?

$
0
0

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.


Viewing all articles
Browse latest Browse all 434

Trending Articles