Redirecting TV remote key codes to CoreElec via CEC


I’m using my remote LG TV to control Kodi, using CEC (“symlink” in LG terms). However, is very limited. I would like to use some keys of my LG remote, far from typical “play, pause, up, etc”. For example, the “text” button (has no function when connected an HDMI source) or the “Home” button (that has a function in my TV). Is possible to assign these remote keys to new functions on Coreelec?

Thank you

Install Keymap Editor and use it to map keys on your remote to the functions on CoreELEC.
I have mapped “green” button on my Panasonic’s remote to enable/disable subtitles, “red” button to invoke SpeedFan Information add-on to display on TV screen few parameters of my NAS:
You can also edit Keymap Editor’s config file /storage/.kodi/userdata/keymaps/gen.xml

Awesome!!! I’ll try it tomorrow!!!

Thank you rabaraf!!!

Well, I tried it, but doesn’t work. I’m using, as I wrote in the subject, that I use the IR receiver of my LG TV and tried to capture some buttoms to do some actions on Kodi. I tried buttons like “HOME” or “TEXT” in my LG TV remote, but Keymap Editor doesn’t detect those buttons I press in the 5 seconds that the user have to press them. Without any configuration, after install Coreelec out of the box, Kodi responds to cursor keys, “ok”, player buttons (play, pause, stop) and even “back” and “exit” but no other one.

Some suggestion?

Thank you

  1. Did you close Keymap Editor with Save once you are finished mapping within those 5 seconds?
  2. Is anything added to /storage/.kodi/userdata/keymaps/gen.xml ?
    If “yes” for 1. and “no” for 2. then it simply means those two buttons you want to be mapped are not having their codes. Try also with some of the “well known” buttons which are present on every TV remote: red, green, yellow and blue.

I tried the “colored” buttons, and same behaviour. I guess that while I’m playing a remote button in the 5 seconds, should appear some code or something similar (the captured one) but nothing happens.

check /storage/.kodi/userdata/keymaps/gen.xml

That folder is empty, there are not files or folder in :frowning:

If there is no gen.xml file created when you map TV’s button using Keymap Editor then you apparently doing something wrong.
Create manually gen.xml file with the following content:

 	<key id="254">screenshot</key>
    <key id="254">screenshot</key>
    <key id="254">screenshot</key>

It is mapping “green” button to screenshot action.
Check if you have screenshot file created in /storage/screenshots folder when you press “green” button.

Thank you rabaraf. I created the gen.xml file
and then I rebooted my MeCool KIII Pro and then I pressed the green key some times (in fact, I pressed all coloured keys), but no screenshots taked on /storage/screenshots.

I noticed another insteresting behaviour. I switched on my TV. Kodi screen remains dimmed (for energy saving when no key are pressed after some time). Usually, if I press on my LGTV remote the “usable” keys (movement keys, ok, play, pause, etc) Kodi detect the pressed key and the screen at full bright (waking up from dimming mode). However, if I press any of the colored keys, Kodi does nothing. My LG TV led light blinks (like happens when I press any key on my LG remote) but Kodi seems to not receive any signal thru HDMI cable when I press other keys than movement/play control).

Could this information help anyway?

The problem is that I’m simple user only without a deep knowledge how all those things are working :slight_smile: so it’s difficult for me to answer the question why Kodi doesn’t respond when you press on your TV’s remote colored buttons.
I checked the same with dimmed screen. When the movie is paused and I press the only one colour button that is not mapped to any action in my configuration, then the screen is waking up from dim mode so I would say that maybe in LG those buttons can’t be mapped? You need to confirm that with other LG TV owners.
What I would do also is to check if other buttons when pressed during the “learn” 5-seconds mode in KeyMap Editor are recorded in gen.xml file.
Sorry but I can’t help more.

Don’t worry, I appreciate anyway your help. At least, thank to you, I know that I’m not doing things wrong and your info about how your Kodi respond to coloured buttons, is very interesting too. I think I’ll change some configuration in CEC addon.

Thank you!!