The Remote Project
THE PERFECT HTPC REMOTE?
by Dalibor Lanik
One of the problems with any remote/keyboard can be special buttons. No keyboard/remote can truly be universal, across multiple platforms, Android, Windows, Linux, MacOS... That is why some buttons don't work right out of the box. On i25A, 3 buttons simply were not visible in KODI. Even though KODI has key mapping feature, it just wouldn't work with these 3 buttons. So we have to go a bit deeper into the system.
It requires editing android system, so you have to be rooted. Let's see how to make these keys visible to KODI.
* install KeyEvent Display from Play Store
* run KeyEvent Display app
* press the keys you want to find out keycodes. They will be displayed. Note the codes. In my case 155, 217 and 172 (envelope, search and home)
* Install ES File Explorer from Play Store, turn on root in it and give it root rights.
* From ES, navigate to /proc/bus/input
* copy devices file to your SD card, or just view it from ES.
* in the list of devices, find your keyboard. Mine looks like this:
I: Bus=0003 Vendor=1997 Product=7b03 Version=0110
N: Name=" Multimedia Air Mouse Keyboard"
H: Handlers=sysrq kbd event4
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
* note Vendor and Product. In my case Vendor=1997 Product=7b03
* Now, go to /system/usr/keylayout in ES
* copy file Generic.kl to your PC for editing
* rename file Generic.kl to Vendor_<vendor>_Product_<product>.kl, i.e. in my case "Vendor_1997_Product_7b03.kl"
* download EditPad Lite if you don't have good editor. DO NOT USE notepad. The file must be in UNIX format (LF only)
* edit the file - find the keys noted in step 3, i.e. I edited key 217 to F11 and key 155 to F12, and key 172 to F10:
key 155 F11
key 217 F12
key 172 F10
* save file, pay attention that the output uses LF as line breaks (UNIX standard)
* copy file to your Android box
* copy file to /system/usr/keylayout
* set permissions to 644 (just look what other files in this folder have) -rw-r--r--
Now, even if anything goes wrong with the keyboard mapping file, you'll still be able to connect normal USB keyboard to the TV Box, since we only added keymapping for one specific keyboard (That is, our Rii i25A).
OK, now that we changed Android mapping, we can simply map the F10, F11 and F12 keys (since they work in KODI) to the commands of our choice (in KODI):
* Create file keyboard.xml on your PC and map the F-keys:
<?xml version="1.0" encoding="UTF-8"?>
* Change the commands to your liking. For a full list of commands and more info on keymapping in KODI, go to http://kodi.wiki/view/Keymap. Again, respect the line breaks standard for UNIX (LF only)
* copy the keyboard.xml file to folder Android/data/org.xbmc.kodi/files/.kodi/userdata/keymaps on your TV Box
* Restart KODI, and that's it! :)