Kodi Community Forum
Unable to set LG Remote map (CEC) - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
---- Thread: Unable to set LG Remote map (CEC) (/showthread.php?tid=199365)

Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

I've been trying to set keymapping on my LG CEC remote so I can use things like show info and context menu aswell but I just can't get it to work.

I first tried to following xbmc's mapping guide which didn't work, I tried loading the default remote.xml, didn't work I tried naming remote.xml to keymap.xml didn't work, I tried putting them in both system/keymaps as the keymaps dir in userdata didn't work, I tried throwing in a little script someone wrote for his/her samsung tv from a Raspberry Pi/RaspBMC specific forum, didn't do anything either. I downloaded the Key Mapping plugin, but when I try to set any other keys then the oe mentioned below my TV overrules me pushing the button and gives me a "invalid key" error on screen, so, if I want to set the arrow up button and click Arrow up it works just fine but if I want to set context menu to, say, a number (0-9) I get the mentioned error. If I try to set it to one of the colored buttonds (red for example) it doesn't register me pushing the button and just returns to the selection screen. End of it all there is no change whatever I try to add or remove (and yes I'm rebooting, restarting xbmc etc. etc.).

Ok first of all, this is the remote I have for my LG 42LV4500-ZC TV, it took me some googling because they all look a like but none of them where actually the same lol

Now for what it does, it auto maps the following buttons (without making a keymaps file) with CEC:

Arrow up, down, left and right to up down left and right
OK to select (or just OK, whatever you want to call it)
Back to Previous dir or exit video or, well, pretty much just back
stop to stop
play to play (seems to be context menu on selecting a dir)
pauze to pauze
and the fast forward/backward buttons to what they should do.

All of the other buttons give either a "function not available" (0-9 for example) or an option from my TV (Ratio brings up a menu, sound is just TV sound, Info shows TV channel information etc. etc.).

I have more then enough buttons to work with but, it just doesn't work, like, at all.
Just mapping the context menu and Info would work good enough for me really since that's all I need next to the buttons that work already but I'm in serious need of some help then cuz lol, i'm fresh out of ideas.

RE: Unable to set LG Remote map (CEC) - dandnsmith - 2014-07-06

A common problem with a lot of TV/Remotes is knowing which keys actually get passed through CEC (as this varies quite a lot), and so which are available for mapping.
You haven't mentioned which OS you're using, or the release numbers for that and XBMC (which has been subject to recent changes).
Were it me, I'd look in the stmlabs forum dealing with raspbmc, which has some extensive threads on the topic (and also links to various bits of XBMC documentation which are appropriate).
The other thing you haven't mentioned is whether you've tried turning on debugging, as, when you do, the xbmc log will show results for what codes is is receiving, and how it interprets them.


RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

My bad, it's RaspBMC indeed running the latest version, kernel 3,11 (if i'm not mistaking) and the latest Gotham build (stable, no nightly) they released in uhmm june (?) I think.

I would post it there if it didn't take foreeeevvveeerrrr for someone to respond over there.

I think indeed the problem lies in what the CEC passes through, I think it's limited to just the few buttons I mentioned above since my TV seems to still react to all the other buttons.
I'm going to tail the process later on (didn't get to that yet, just hoped someone might know a general "quick fix") and just click every button on the remote 1 at a time but judging the fact that the Key Mapping addon does register arrow up as something like 168 while doing nothing when hammering on, say, the red button I have very little hope for it Sad.
I was kind of hoping to instantly get disproven about that which I already came up with Tongue.


This is the entire log pushing keys (roughly) in order 1-9, List, 0, Q.VIEW, Vol up, Vol dwn, FAV, RATIO, MUTE, Page up, Page dwn, GUIDE, HOME, Q.MENU, Up, Left, (I think i forgot OK which is Select), Right, Down, Back, INFO, Exit, Red, Green, Yellow, Blue, TEXT, T.OPT, SUBTITLE, Stop, Play, Pauze, Fast backward, Fast forward, Simplink, AD.

That order should be correct (see remote pic for further detail), I had to push the back button a couple extra times if something popped up but this is the general order I tried.


RE: Unable to set LG Remote map (CEC) - dandnsmith - 2014-07-06

That log helps some of your keys are working (as, indeed, you've already said), but I've no experience with handling TV remotes via CEC (my remotes are all directly connected to RPi systems, except for Android tablets using things like YATSE).
If you do 'tail -f' the log, youll be able to isolate the key actions which don't get passed to the RPi - with that detail it should be possible to list those which do, but don't provoke an action, and map them in a keyboard.xml and /or a remote.xml.

I'm sorry to hear your comment about stmlabs, as I've found a well formatted question with sufficient detail will get a response (and the response time has to depend on whether someone feel they have enough information to respond)

RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

As far as I can see, while tailing, is that only the buttons that are currently mapped actually send a signal. I have no idea if you can overwrite it somehow or make the RPi demand a response through HDMI (which I highly doubt Tongue) but hey, you never know Smile.
Maybe someone with a similar problem will come along and have a valid solution.

As for STM, my overal experience is that, even with valid questions, you have to bump your thread for atleast a week, even if Sam himself answers your problems.
I've had responses like "yeah that should technically be possible" from Sam but 0 response for a few weeks on the "yeah, but how?" follow up question.
Most things I figured out myself at that point or found someone else that could help me on IRC or whatever Tongue.

RaspBMC is pretty solid though, no real remarks on it. Always have a few ofcourse but that's natural.
If I have to reinstall (RaspBMC was stock on my SD) I'm going with xbian though (which I will do after I buy a Jetstream 760, or 700, whatever), but then again, that's not for everyone, RaspBMC (and OpenELEC) is far more user friendly to those that don't now how to do everything in SSH.

RE: Unable to set LG Remote map (CEC) - evangelion - 2014-07-06

You may already have seen This, but if not see if it helps, worked for me.

RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

Yeah I tried that already, the only keys that it actually registers are up, down, left, right, OK, back, stop, play pauze and the 2 fast for and backward Sad

I'm most likely just stuck with what I got but maybe someone knows some workaround.

RE: Unable to set LG Remote map (CEC) - miappa - 2014-07-06

Remap your FF/RW buttons to info and context menu.
Even if you actually use those you will only use it in fullscreenvideo (and perhaps music playback), and if so you can set global action to info/context and remap the fullscreenvideo to ff/rw (and again perhaps music playback).

Start wit the following:
Turn on debug logging and press RW.
Look in log for '... OnKey xxxx' and write down the xxxx number. Do the same for FF.

Create a text file called remote.xml and place it in /home/pi/.xbmc/userdata/keymaps.
Add the following:

    <key id="xxxx">ContextMenu</key>
    <key id="xxxx">Info</key>

And reboot.

If you want to have RW/FF, add the following to for example fullscreenvideo (inside keymap tags but outside the global tags):
    <key id="xxxx">Rewind</key>
    <key id="xxxx">FastForward</key>

P.S: Do not use a text editor that uses windows line endings (e.g. Notepad), use something that uses linux/unix line endings.

Edit: Are you certain that the coloured buttons doesn´t work with CEC?

RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

Yeah I just tried using the colored buttons using "tail -f ~pi/.xbmc/temp/xbmc.log |grep OnKey" but it doesn't register them, just the buttons I mentioned that worked register something.

Setting them to the rewind and fastforward button is a good idea really, it's indeed just used while actually watching something, not in the general menu.

Too bad that I can't map anything to all the other buttons though, half of the remote is useless in XBMC like this Tongue.

RE: Unable to set LG Remote map (CEC) - evangelion - 2014-07-06

I think you need to re-read the link I posted, both yours and miappa's last posts are covered on page 1.

RE: Unable to set LG Remote map (CEC) - miappa - 2014-07-06

Hehe... Gotta be honest, I didn´t even look at that link, my apologies.

Note: I see that it might not be RW/FF, it looks like it is the skip buttons that works with CEC.

Guess I´m lucky, I have a Viera and 31/50 buttons can be used with CEC.

RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-06

Hmmm I just fully read the page, I might be able to use some of those commands. Don't need all of them, don't use plugins for instance so no need for that but I can make one do context menu and the other show info for example.

I might just get a universal remote though, or get an infrared module for my Pi, whichever is cheaper Tongue.

For now this should work though, the only thing I really need to map is the context menu since I already put my select (OK button) to show information instead of play file which pretty much does the trick Smile.

RE: Unable to set LG Remote map (CEC) - evangelion - 2014-07-07

I doubt a universal remote would yield any more usable buttons, it's the TV's firmware that is the limiter here, nothing to do with the remote or XBMC.

Just map one of the usable buttons (skipminus, skipplus, or even select) to whatever you want them to do, OSD, ContextMenu etc.

RE: Unable to set LG Remote map (CEC) - ThaMadHatter - 2014-07-07

Myeah i've done that Smile
The only thing I could do is add an infrared module to my pi then, that's pretty much it.

It sucks that you can't update the firmware of this TV, atleast, not as far as I know. There is bound to be an update somewhere (or some custom firmware or whatever).

This forum uses Lukasz Tkacz MyBB addons.