kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

CEC Remote Keymap the easy way..

Fri Oct 17, 2014 10:04 pm

After recently getting my pi re purposed as a medium for watching my DVD rips (which I own). I was delighted to see that my TV remote worked out of the box (ish) in openelec.

The one major flaw was that I had no back button! With no back but to the pi is unusable. I had the android remote installed but I wanted to make it easy to use for my kids (who don't have phones). I also have a harmony 300 remote which has a spare mode on it.

So my plan was to remap the available buttons to something more sensible on the remote. I found the guides on the kodi website and forums which suggested I create an XML file with the mappings in /storage/.xbmc/userdata/keymaps. I have moderate success with this using the log file to get my key names and putting them in the file against new actions. But it didn't work quite right and it took me several hours to realise that xbmc was lying to me about my button names!! I wasted hours and hours seconding guessing file names etc when all along I had the wrong button names. Suffice is to say ignore the names and go only by the hex value (convert to decimal).

It was just at the point I was about to start over with the right button names when I found a much simpler way that took all of 5 minutes!

1) Install the Kodi Keymap GUI add on in settings>addons.
2) Launch Keymap add-on and select edit.
3) Choose an action to remap.
4) Press the button you want it to be mapped to.

It was that simple! The Keymap GUI generates the XML in just the right format. It even reloads the Keymap when you save it.

I can't believe how much time I wasted following guides etc when I could of mapped it in the GUI.

So I thought I'd post here to hopefully save someone else the trouble.

peanutismint
Posts: 36
Joined: Thu Nov 22, 2012 7:14 pm

Re: CEC Remote Keymap the easy way..

Tue May 10, 2016 5:28 pm

Just wanted to say thanks for this great tip! I didn't even know this Keymap Editor addon existed. This will make my life so much easier going forward! :-)

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: CEC Remote Keymap the easy way..

Tue May 10, 2016 5:35 pm

Glad it helped. Mine still works fine.

dover19
Posts: 3
Joined: Sun Dec 18, 2016 3:07 am

Re: CEC Remote Keymap the easy way..

Thu Jan 05, 2017 8:38 pm

So if a specific button does not get recorded, does that mean that kodi doesn't get a signal from that specific button?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5268
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: CEC Remote Keymap the easy way..

Fri Jan 06, 2017 2:17 pm

dover19 wrote:So if a specific button does not get recorded, does that mean that kodi doesn't get a signal from that specific button?
Yes, it's up to the TV which buttons are acted on locally and which are forwarded through CEC.
If the TV doesn't forward the button then there is nothing kodi can do.

Some TV's do have hidden settings for adjusting the CEC buttons forwarded. E.g. for Panasonic see this:
http://forum.kodi.tv/showthread.php?tid ... pid1367645

This is actually documented in the TV instruction manual. But I suspect most TV''s won't expose this.
Normally you just hope the coloured buttons or numbers are sent, and then you can map them to more useful functions.

Return to “Media centres”