Kodi Community Forum

Full Version: keymaps ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I recently installed OSMC on a Raspberry Pi 3 and everything works quite well.

However, there is something which seems under-documented about "keymaps".
I don't use a keyboard, I use an IR remote control (through LIRC).
I made my own configuration file for LIRC and thus used specific key names (eg KEY_VOLUMEUP).

I found the list of available "KEY_something" via irrecord --list-namespace.
But, I haven't found any precise information on how I should map my buttons to KEY_something and then to some action in Kodi.

The best approach has been to guess what KEY_something was doing and thus assign it to some button.

Up to now, I have a working configuration file for LIRC which is quite usable, but I don't know how to customise even further the actions.

To me, that's not the good was of doing it. Smile
But, what would be the best way ? The documentation is not that clear.
Have you seen the wiki pages on keymaps (wiki), HOW-TO:Modify keymaps (wiki) and lirc (wiki)? They cover most of it aside from the namespace list which you already have.

Also the default keymaps are on GitHub.

Most people just use the Add-on:Keymap Editor (wiki) for this kind of thing, which simplifies things greatly.
Thanks for your answer.

Your answer help me when you mentioned the lirc wiki page, but also confused me when you mentioned the "Keymap Editor" add-on.
The wiki page "First time users" (in your signature) helped me a little bit also, because there is a "remote control" section which is interesting, especially the "guide" section (one of the link is not useful because many pages got deleted on OpenElec wiki).

If I understand correctly, the add-on "Keymap Editor" is only applicable to "keyboard.xml".

But now I understand a little bit how to do what I want (but I need to decide what would be the best approach):
- I need to make my own Lircmap.xml because I want to keep my lircd.conf reflecting the actual buttons on my IR remote control.
- I will probably need to make my own remote.xml (because I want "CodecInfo" action mapped to some button).


However, the "Action IDs" are not clear.
For example, I know it's possible to switch from "Video playing" to "Main menu" back and forth using the same button. But I don't see anything mentioning this.
Thus, I am a little bit frustrated because the "Action IDs" wiki page is (at least on this point) incomplete or unclear (to me). So it's a possibility I'm missing some nice feature/shortcuts.

Moreover, if I understand correctly, "remote.xml" have redundant mapping (for new users, it's confusing), for example there is "<back>Back</back>" in "<global>" section and in 5 other sections.
No, keymap editor works for all keymaps. I've used it to map a context menu key on my remote for example (the TV remote via CEC).

Basically kodi has the built in set of keymaps (the ones on Github) and you can add your own, which will override the built in ones. Your customised keymaps live in the keymaps sub folder in your userdata (wiki) folder.

The naming of the file doesn't matter, except that they are loaded in alphabetical order. So if you have the same entry (the same key in the same section in each file) in the built in ones, in mykeys.xml and in zzmaps.xml (for example, to pick a couple of random file names). Then the one in zzmaps.xml will be used, having overwritten the entries in the other two. The built in ones are split into multiple files just for clarity of what they apply to. If you look at each one on Github you can see they each have different sections corresponding to the device in the filename. They could have been done in one large file, but that's less clear and easy to maintain.

Within the files you can have different sections for different Kodi windows or modes of operation within kodi. So the same key can do different actions of you're in the main menu or in the full screen playback window for example. This is where the add-on comes in as it simplifies setting things up in the different sections. The add-on itself write to a single file called gen.xml in the keymaps folder in userdata (wiki) as mentioned above.