Help to find the correct dialog to map in my remote control

It´s hard to explain, but a while back I had a different RPI and different TV set. I got the remote control working flawlessly. After I upgrade both TV and RPI, never again was so perfect.
I got a Panasonic 42" plasma TV and RPI1 running some debian and kodi. Did it manually took me a hard time but I got it working.
So, the four colloured buttons, I set to use as my “help” buttons. Like, red was for open subtitles dialog during a movie, green was start, yellow to stop and blue I set to open the properties dialog when inside the movie list. So while I was navigate my movie list, or song, or serie or pictures, the blue button open up a dialog that permits me to delete, mark as watched, mark as unwatched and so on.
My new TV do not have so many buttons to map, but the last one, I´m really miss. Because Without a keyboard connected, I can´t do any of those actions. One that is particularly missed, is theaction to delete an old entry on the sources list.
If I make myself clear, I appreciate the help. If, anybody could point me the files to edit, I don´t mind, do it. I even prefer that last option.
Thanks a lot,

The info your looking for is found in Kodi’s keymap wiki. Most of the basic stuff can be done inside of Kodi by installing an add-on called “Keymap Editor” which most people find easier than manually creating an xml file.

If your just using CEC for control your likely going to be fairly limited in what buttons can be mapped. For example I don’t think most TV’s will forward a context menu button to a connected device so if you don’t have colored buttons you may have to resort to mapping it to << /rw/>>/ff or similar due to the limited number of buttons a TV may be forwarding over CEC.

Thanks a lot for your response. This page is new to me. I´ll take a look.
I had installed Keymap Editor add on, but I find very confusing because of all levels that it divide the actions. There is a lot of options of ContextMenu. Global, Video, and so on…
Also, my Keymap Editor add on is not working at the moment. But I really don´t mind because I prefer know what I´m doing and editing the text file. (Probably that´s the reason why is not working.)

As I looked at this link that you sent, I realized that a lot changed since I start using Kodi.
Again Thanks a lot for that. With this new information, I´ll try to solve my issue and update this thicket as soon as I can.

Those “levels” are windowid’s and they control the scope of where the programed action works. If you put something in “global” then it works everywhere expect for when you are in a windows that has that same keyid programmed to a different action or has been excluded. In this way you could have (for example) an info button bring up the full screen info windows when you are in the videos window but during full screen playback you have it perform some other action.

You should probably still start with keymap editor since you are using CEC. The debug log does not return correct data for that type of device so it isn’t super useful for figuring out what buttons are available and what their keyid’s are. If you just program anything in keymap editor it will usually either not respond, meaning the key is likely not forwarded, or come back with a valid keyid which you can use to manually keymap something. Do pay attention to the numbers coming back as it is possible to think your recording a key and it actually is exiting and keeping the previous value. If you brought in a code for “up” for example and then tried it again with “exit” on your remote this would happen, as this add-on isn’t capable of discovering the keyid of “exit”. You will likely find the mapping to be similar to the following…

LG TV keyid's
up			166
down		167
left		169
right		168
select/ok	11
back		216
exit		216
stop		224
<<			221
>>			223
play		234
pause		230
red			251
green		252
yellow		253
blue		254