Need help to catch Volume Up/Down key events

Hello.

I’m trying to receive the volume key up/down events into my application on my nvidia shield android tv box.
I have tried to use onKeyDown and dispatchKeyEvent.
I can receive other keys but no volume up/down keys.

Any idea ?

Hello,

I asked one of the engineers about this, and here is the response.

This might help: https://developer.android.com/training/game-controllers/controller-input.html
It could manifest as either a Key* Event (digital) or as a Motion* Event (analog) - so, it depends on the device being used. The getevent cmdline utility can help uncover the event type.