OSMC remote on Kodi Android TV

Hello there. So I have a Pine64 (similar to the Pi3) which I have installed Android TV on with Kodi on that.

I purchased an OSMC remote control as it looked like a decent remote available for Kodi that only has the needed buttons. Most of the controls work on Kodi/Android except the home, info and context menu buttons. I have seen a couple of posts here on how you could get it to work on Kodi/Debian but wondered if it was possible to get them working on Android TV (6.0). I noticed that the OSMC player is able to switch between Android and OSMC, so I assume you can get the remote working on Android?

If anyone could help it would be most appreciated, thanks.

Hello

It depends on the version of Android you have. It may need to be patched to accept those three buttons.

I think the keymap for Android also takes a different input pathway, so keyboard.xml may need modifying for this to work as expected.

Sam

Thanks for your reply.

I had a quick look with the Kodi keymap editor, which also doesn’t recognise the button presses.
I’m far from an expert at Android but I dug a little deeper and looked at “getevent” from an ADB shell, and the button presses are being picked up in Android, though I don’t know what (if anything) I can do with this info: http://pastebin.com/XWZcUbgx

Is this more of a Kodi or Android thing? Perhaps I need to talk to a relevant community.

Hi

I am no Android expert either, so I took a lazy kind of approach, and patched the kernel so that the keys were remapped to regular keyboard presses. This was possible for us as we distributed Android ourselves, but I can appreciate third party ROMs may not make this possible and some people probably don’t want to do this just for a remote.

The getevent output is useful. You will see there are some instructions on using the Linux input layer here: http://kodi.wiki/view/HOW-TO:Set_up_an_MCE_remote_control_in_Linux. I believe this requires a functioning LIRC however.

There is probably a need for a userspace daemon to remap some of the events (on OSMC we use eventlircd + lirc). But I am unsure how much freedom of your system you have.

Sam

Thanks again for your help Sam.

Just to let you know I found a workaround for my case. I created a custom Android key layout file for the remote that binds the ‘info’ key to ‘i’ and the ‘menu’ key to ‘c’, which are default Kodi key bindings. (only tried on a build of Android TV for the Pine64)

Just in case anyone is interested in this, I have uploaded the key layout file and a bit more info here: https://github.com/MonsterKiller/OSMC-AndroidTV-Keylayout

Nice work.

I might make this in to an APK to make things easier for future users

Sam