[SOLVED] Which keycodes are available to use? (KEY_PROG1, KEY_F13 etc don't work)


I could not get some (many in fact) keycodes working in the meson-ir config. They are: KEY_PROG1KEY_PROG2, …, KEY_F13KEY_F24, KEY_SETUP, KEY_O etc

My system is CoreELEC-Amlogic-ng.arm-19.2-Matrix_rc2-Generic

ir-keytable reads them, the codes are seen with ir-keytable -v and also ir-keytable -t shows them properly when pressed but it’s all

First, I tried to simply configure the remote button as the hardware button ‘O’ (Player process info) and wrote 0x57 = “KEY_O” but it’s no use, player doesn’t react at it. Then I tried to set it to KEY_PROG1 and redefine in Keymap Editor - no luck, the same. The Keymap Editor pretends to catch the button (“press the button in 5 sec” dismisses) but doesn’t redefine the rule as though the code were empty

The Keymap Editor sees the button when I define it, for examole, as KEY_GREEN in MYREMOTE.toml but this definition has side effects, that’s why I’d prefer to use KEY_PROG1 etc. So it seems like that only some of the keycodes can be used in the toml. So the questions are:

  1. Where can I get the full list of the codes available to use in the meson-ir remote config?
  2. Why KEY_O and the other KEY_* don’t work? More exact, they work in ir-keytable but no further

Not exactly what I planned but that’s life

Unfortunatelly, the only solution mark is possible while I got the two solutions

  1. [SOLVED] Which keycodes are available to use? (KEY_PROG1, KEY_F13 etc don't work) - #12 by Ray
  2. [SOLVED] Which keycodes are available to use? (KEY_PROG1, KEY_F13 etc don't work) - #11 by vpeter




The links to the docs are helpful, of course, but the trouble is that Keymap Editor accepts not all codes from “input-event-codes.h” (even after I read the docs yet again). I get the different results with the different codes. Some work but others don’t

I asked on the local forum, nobody helped out but at least one guy had the same issue, then I decided to ask here

Of course, I could not check every code from the bunch, but, for example, KEY_GREEN behave absolutely not the same way as, for other example, KEY_F13 (or KEY_PROG1, KEY_PROG2)

Steps to reproduce:

  1. ir-keytable -t - ok, the proper codes are shown when the buttons are pressed
  2. overriding KEY_GREEN - ok, the rule is being changed at once and then being written to /storage/.kodi/userdata/keymaps/gen.xml on “Save”
  3. overriding KEY_F13 or KEY_PROG1 - the countdown 5sec message dismisses but the rule (the same one as in previous step, it’s important) stays unchanged. And gen.xml stays the same on “Save”, too

Here we are, almost by Orwell: all codes are equal, but some codes are more equal than others

These codes work (got it on this page), but the others don’t, at least that I tried

The main issue is that even though you can use valid linux key’s defined in kernel, the Mediacenter doesn’t know all of them. To complicate things further CE is using eventlircd that is mapping keyboard events to IR keys to please the media center. You could remove eventlird and your remote will act like a real keyboard but you will have to remap some keys.

systemctl mask eventlircd

But something is passed though to the final events receiver (i.e. keymap editor). It’s seen from that the countdown breaks just after remote button is pressed. Nevermind, it’s only “ah if would…”. The things are done as they’re done

Well. let’s forget for a while all these event handler chain complexness. Is there the full IR remote codes list available for the reassignment in Keymap Editor? The codes that are not ignored by it and preferrably aren’t used already. For it would be a headache to catch the unwanted actions. PROG1…4 and F13…24 would be perfect but… I just want to map the multiple unused buttons on my rather huge remote to anything useful. So the well number of vacant codes is needed

So far I found by myself IRTranslator.cpp and /usr/share/kodi/system/keymaps/remote.xml but have no idea how to get what I need from them


P.S. Seemed to find anything

Kodi translates the received LIRC events to Kodi button names via Lircmap.xml and then buttons are mapped to Kodi actions via remote.xml and keyboard.xml files

and, in LIRC

Customized buttons are for people who require more buttons than are defined by default. For example;


This is it? If so, then where Lircmap.xml should be put? In /storage/.config/ or where?

Can you try with following combination:

A clean install (never a problem with CoreELEC since it boots from external media);
A standard remote configuration file (pick any that works the remote repo);
The the Kodi Keymap editor (this is where the magic should happen).


I already have “any that works” remote configuration: Play/Pause/arrows/Enter work. So the Kodi Keymap Editor that does the part of that I need. But it woukd be fine to force it do the things it doesn’t want to do

The remote is completely alien for the mediacenter box and also completely noname and outdated. It’s from ancient DVD or maybe even VCR player. But it’s gorgeous because it has many buttons so I want to program them

I hope right now I understood partly what’s happening. It’s the typical “Universal Remote”, so I (maybe) need the OBC codes (maybe no). Anyway, now the question is: how to make the custom Lircmap.xml?

What the right path is? /storage/.config or /storage/.kodi or what?
Does it override or complement the original lircmap?

Glad you asked:





Glad you answered. Now it’s finally… still not working

The Keymap Editor - whatever. I can’t get it working with the non-standard buttons (we’ll see below they are all obc255 by all means) and let them. Now I try to do the things manually. But… see the previous paragraph

=== part of /storage/.config/rc_keymaps/NOVEX.toml
it just works, no questions at all

=== full current content of /storage/.kodi/userdata/keymaps/gen.xml
the keymap editor’s file was manually edited and of course obcXXX buttons don’t work while the others work

But let’s look into /storage/.kodi/userdata/Lircmap.xml. I think it’s the most tricky part and I suspect the problem is here but not sure of course

First, the docs are not obvious:

Copy the part between

<remote device=“mceusb”> … </remote>

and paste it in the file. Change the new mceusb to MyRemote (or whatever name you picked for your remote in the lirc configuration

The question is: what picked name? But I created all three sections: mceusb, novex and NOVEX. They are all being loaded, we see it in logs. I hope my custom mceusb section overrides the original one but who knows… I refedined there the couple of buttons but saw no difference. Probably I’m doing wrong

grep -i remote /storage/.kodi/temp/kodi.log |paste

All was in vain, the buttons didn’t work. Not worth mentioning that Keymap Editor don’t see them, naturally

=== The debugging log for these buttons: RED is ok but the others are obc255 while their lirc codes are ok. Why?

So, where I’ve mistaken?

So, no ideas?

Maybe there are working and complete custom IR config with obcXXX keys for Matrix anywhere?

I’m not sure if my post would be helpful but I made config from scratch for amremote (and not for meson-ir). This is the file /storage/.config/remote.conf.
Then I modified keys I like in file /storage/.kodi/userdata/keymaps/keyboard.xml.

And everything works exactly like I want. Maybe you could invest some time into this path.

I told you in my previous post. There is only one way and that is patching Kodi. Why not using a different linux Key id?

Oh, sorry, I seemed didn’t understand your post very well and now I think I finally got it) Many thanks! The reason I didn’t want to use the ordinal keys was simple - this solution is, well, not as tidy

Bad luck

No prob. It wasn’t clear anyways. I did the same in the past researched and got to the point that it is better to use some known key id’s and then remap them simply with keymap editor. I mean who cares if KEY_UP later is key_down in kodi if that’s what you want right? It’s just a translation. You are looking fto support uniq ones to have a high key remote do all crazy tasks.

No, your post is helpful a lot. My thankfulness!

I’ve been thinking in this direction but didn’t experiment so far because ir-meson took too much life force out of me so I need a small vacation) Btw, there’s the AlexELEC project and it’s author first switched from amremote to ir-meson then switched back. He said that amremote was more steady than ir-meson. Maybe it’s related to some older versions, dunno

So, now I got all the way the pair of solutions to choose from

AlexElec is not legit btw. Just as a side note.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.