User keymaps disregarded

Hi, I’m trying to set a key on my remote to launch an addon. I tried using the official kodi Keymap Editor addon to map an unused remote key via meson-ir to an unused kodi function key, for example KEY_WWW or KEY_RED. It does not work under any circumstances. It’s simply disregarded and whatever the key was originally assigned to do it does. This is true across multiple reboots, reloads, anything. There is no documentation at all that I can find through googling and searching through these forums. Someone asked a similar question and seemed to figure it out on his own, but everything about it was quite unclear. One way or another I want to find a way to map an IR button to launch an addon. Is this impossible? Does CoreElec just not support .xml keymaps in /storage/.kodi/userdata/keymaps/? Does it need to be somewhere else? I’ve hit a brick wall here and anything that can help me get past this would be appreciated.

This issue is going to be better served in the Kodi forums.

Start HERE

Yes it does support them.

Use keymap editor to remap any Kodi function to the button you want to use on your remote control. That will give you a gen.xml file like the following, in this example I’ve used the STOP function.

<keymap>
  <global>
    <keyboard>
      <key id="37">stop</key>
    </keyboard>
  </global>
</keymap>

Then stop Kodi and edit the gen.xml file and replace the STOP function with the script you want to run, like so.

<keymap>
  <global>
    <keyboard>
      <key id="37">runscript(script.amlogic.framecapture)</key>
    </keyboard>
  </global>
</keymap>

Restart Kodi and it should work perfectly fine.

Thanks for this. The xml generated by the keymap editor did not work. It was formatted without line breaks or spaces. I copied yours and replaced the key id and the name of the script I wanted to run and it works now.