Custom remote for Libreelec 9.0

  • I created my custom rc_keymap:

    and I noticed this does not work as I wanted. Most keys are fine, but some others, don't. For example, KEY_E (in kodi it shows epg) ignored. Then I realized my approach is wrong, I am limited to keys defined in usr/share/kodi/system/Lircmap.xml:

    As KEY_E is not defined and there is no any action to show epg linked to any other key, this is reason why it does not work. My question: what is simplest way to map specific scan code to action that will show epg (E press on physical keyboard equivalent), S (shutdown menu), I (info), O (extended info) etc?

    [edit]

    Ok, key epg is available (I missed that), but still how to define custom actions?

  • You should just make a remote.xml file with your custom actions in ~/.kodi/userdata/keymaps/

    for example this is mine:

    <keymap>

    <FullscreenVideo>

    <remote>

    <zero>AudioNextLanguage</zero>

    <seven>subtitledelayminus</seven>

    <nine>subtitledelayplus</nine>

    </remote>

    </FullscreenVideo>

    </keymap>

    So keypress 0 on my remote is next language, 7 is subtitledelayminus. Just follow the kodi wiki about keymaps: Keymap - Official Kodi Wiki

    If I remember correctly only the <remote> actions will work with a ir-remote.

    A while ago there where problems with ir-remotes on amlogic devices and then the guys of coreelec had set the ir-remote in keyboard mode so the remotes should work, but I don't know if you can do that through configuration or you should rebuild libreelec with this option.

  • Where to get list of available tags for <remote></remote> I mean <zero> <nine> etc? Am I limited to tags defined in Lircmap.xml? For example what's missing - in Kodi, press S shows shutdown menu. There is no <s> tag available, so am I forced to remap kodi keymap and map shutdown menu to some other key?

  • Yes, indeed. With ir-keyrable you can determine the scancode of the buttons of your remote and save it in /storage/.config/rc_keymaps/doesn'tmatterhowyoucallit as you already did before.. This is described in the libreelec wiki and on the forum thread for amlogic devices. The point is you can map how you want it just choose any available action from the lircmap.xml to a button of you remote. It's not because on the button there is a 1 you should map it to KEY_1. If you want epg on button 1 then you map it to KEY_EPG. If you don't find the specific key in lircmap.xml then you take just a available KEY_ you don't want to use for another action and then you map it in remote.xml to the action you want iti to do.

    For example my red button on my remote is mapped to opening the netflix plugin: <red>RunAddon(plugin.video.netflix)</red>

    The default actions of your remote that or connected with lircmap.xml or defined in /usr/share/kodi/system/keymaps/remote.xml

    Just read the wiki and forum post on the libreelec site and the wiki on the kodi site. Check some examples of remote.xml, rc_keymap and the lircmap.xml put them next to each other and find the links. adjust some stuff just to test and test it. Eventually, you willl figure it out.

  • Best stick to the kodi button names in the devinput section of Lircmap.xml and use the keycodes that are mapped to kodi buttons (eg KEY_INFO, KEY_MENU, KEY_FORWARD, KEY_REWIND, ...).

    A full list of kodi button names is in the IRTranslator source file irtranslator.cpp#l164-l229

    As explained in the Kodi wiki LIRC - Official Kodi Wiki remote button mapping is a two-step process. First Lircmap.xml maps a KEY_xxx code to a kodi button name and then you assign actions to kodi buttons in remote.xml

    so long,

    Hias

  • First Lircmap.xml maps a KEY_xxx code to a kodi button name and then you assign actions to kodi buttons in remote.xml

    This is a line I was already searching for a long time ago and eventually figured it out myself. This should be put somewhere in the LibreElec remote wiki. It would have spared me a lot of time figuring everything out.

    To be honest, as well the kodi wiki as the libreElec wiki are a little bit confusing about this matter.

  • This is a line I was already searching for a long time ago and eventually figured it out myself. This should be put somewhere in the LibreElec remote wiki. It would have spared me a lot of time figuring everything out.

    To be honest, as well the kodi wiki as the libreElec wiki are a little bit confusing about this matter.

    Agree.

  • This is a line I was already searching for a long time ago and eventually figured it out myself. This should be put somewhere in the LibreElec remote wiki. It would have spared me a lot of time figuring everything out.

    To be honest, as well the kodi wiki as the libreElec wiki are a little bit confusing about this matter.

    I just added a paragraph to the Introduction section of the IR wiki page, with links to the relevant kodi wiki pages. Hope this makes things clearer now.

    so long,

    Hias