Maximizing the number of IR Kodi Keymaps

I have a JP1 remote. I would like to program as many functions into the remote as possible, especially being i have a LCD screen and can make custom name buttons on the remote.

I’ve been working on it for a couple days. I have the rc_keymap file. I looked for all the predefined key codes and i found function keys etc that i could customize. Turns out, even though the keycodes were loaded into memory, KODI ignored them all. Using the keymap editor plugin, it would detect a IR button press, but would yield a blank IR code, where normally it finds an ID#.

Through a bunch of trial and error, here is a list of rc_keymap keycodes that by default are compatible and are passed onto Kodi and work. (I am referring to the Key_### names) The actual Hex #s are not a part of this equation.

0x140 = “KEY_POWER”
0x111 = “KEY_HOME”
0x14c = “KEY_MENU”
0x119 = “KEY_BACK”
0x16A = “KEY_PAUSE”
0x16B = “KEY_STOP”
0x113 = “KEY_ENTER”
0x151 = “KEY_LEFT”
0x150 = “KEY_RIGHT”
0x116 = “KEY_UP”
0x11a = “KEY_DOWN”
0x101 = “KEY_0”
0x14e = “KEY_1”
0x10d = “KEY_2”
0x10c = “KEY_3”
0x14a = “KEY_4”
0x109 = “KEY_5”
0x108 = “KEY_6”
0x146 = “KEY_7”
0x105 = “KEY_8”
0x104 = “KEY_9”

0x16C = “KEY_CONTEXT_MENU”
0x118 = “KEY_VOLUMEUP”
0x110 = “KEY_VOLUMEDOWN”
0x141 = “KEY_MUTE”
0x143 = “KEY_RED”
0x10f = “KEY_GREEN”
0x164 = “KEY_YELLOW”
0x165 = “KEY_BLUE”
0x16D = “KEY_SUBTITLE”
0x16E = "KEY_PAGEUP"
0x16F = "KEY_PAGEDOWN"
0x171 = "KEY_INFO"
0x172 = "KEY_EPG"
0x173 = "KEY_AUDIO"
0x174 = "KEY_PVR"
0x177 = "KEY_NEXTSONG"
0x178 = "KEY_PREVIOUSSONG"
0x179 = "KEY_FASTFORWARD"
0x17A = "KEY_REWIND"

#1. Is there a way to get Kodi to detect and KeyMap any IR code (0-255) that i can throw at it? Thus far, even thou it detects any IR code, it ignores those that are not in the known list above.

#2. If not, did i miss any rc_keymap keycodes that cross through and are by default detected by Kodi. I did find a couple keycodes that mapped to the same Kodi KeyMap ID, so i omitted those. Example: Key_Back and Key_Backspace

For years i’ve been using the # keys as my customized IR commands. But, i would like more and not having the # keys has made it more cumbersome not having my numbers.

Thanks

I found the master list of KEY codes to KODI. It is the Lircmap.xml file. Unless someone can correct me, it doesn’t appear you can use custom kodi button designations, as i attempted to add my own custom name and it failed.

Using title within the brackets in the Lircmap.xml code below, represents the kodi button, and the KEY_TITLE represents the rc_map keycodes. Basically, linux internal keycodes to kodi buttons. This creates the mapping. Then the kodi mapping in the keymaps folder tells you what action to perform within kodi.

/storage/.kodi/userdata/keymaps/ (anyfile.xml)

<keymap>
  <global>
    <remote>
      <title>screenshot</title>
    </remote>
  </global>
</keymap>

Lircmap.xml

<remote device="devinput">
	<left>KEY_LEFT</left>
	<right>KEY_RIGHT</right>
	<up>KEY_UP</up>
	<down>KEY_DOWN</down>
	<select>KEY_OK</select>
	<select>KEY_ENTER</select>
	<select>KEY_KPENTER</select>
	<select>KEY_SELECT</select>
	<clear>KEY_DELETE</clear>
	<clear>KEY_ESC</clear>
	<start>KEY_MEDIA</start>
	<start>KEY_HOME</start>
	<back>KEY_EXIT</back>
	<back>KEY_BACK</back>
	<back>KEY_BACKSPACE</back>
	<back>KEY_ESC</back>
	<back>KEY_E</back>
	<record>KEY_RECORD</record>
	<play>KEY_PLAY</play>
	<play>KEY_PLAYPAUSE</play>
	<pause>KEY_PAUSE</pause>
	<stop>KEY_STOP</stop>
	<stop>KEY_STOPCD</stop>
	<forward>KEY_FASTFORWARD</forward>
	<forward>KEY_FORWARD</forward>
	<reverse>KEY_REWIND</reverse>
	<volumeplus>KEY_VOLUMEUP</volumeplus>
	<volumeminus>KEY_VOLUMEDOWN</volumeminus>
	<pageplus>KEY_CHANNELUP</pageplus>
	<pageplus>KEY_PAGEUP</pageplus>
	<pageminus>KEY_CHANNELDOWN</pageminus>
	<pageminus>KEY_PAGEDOWN</pageminus>
	<skipplus>KEY_NEXT</skipplus>
	<skipplus>KEY_NEXTSONG</skipplus>
	<skipminus>KEY_PREVIOUS</skipminus>
	<skipminus>KEY_PREVIOUSSONG</skipminus>
	<guide>KEY_EPG</guide>
	<title>KEY_TITLE</title>
	<title>KEY_TV2</title>
	<title>KEY_CONTEXT_MENU</title>
	<subtitle>KEY_SUBTITLE</subtitle>
	<language>KEY_LANGUAGE</language>
	<info>KEY_INFO</info>
	<info>KEY_PROPS</info>
	<display>KEY_ZOOM</display>
	<display>KEY_ANGLE</display>
	<mute>KEY_MUTE</mute>
	<power>KEY_POWER</power>
	<power>KEY_SLEEP</power>
	<power>KEY_WAKEUP</power>
	<eject>KEY_EJECTCD</eject>
	<eject>KEY_EJECTCLOSECD</eject>
	<menu>KEY_DVD</menu>
	<menu>KEY_MENU</menu>
	<myvideo>KEY_VIDEO</myvideo>
	<mymusic>KEY_AUDIO</mymusic>
	<mymusic>KEY_MP3</mymusic>
	<mypictures>KEY_CAMERA</mypictures>
	<mypictures>KEY_IMAGES</mypictures>
	<livetv>KEY_TUNER</livetv>
	<mytv>KEY_TV</mytv>
	<mytv>KEY_PVR</mytv>
	<teletext>KEY_TEXT</teletext>
	<one>KEY_1</one>
	<one>KEY_NUMERIC_1</one>
	<two>KEY_2</two>
	<two>KEY_NUMERIC_2</two>
	<three>KEY_3</three>
	<three>KEY_NUMERIC_3</three>
	<four>KEY_4</four>
	<four>KEY_NUMERIC_4</four>
	<five>KEY_5</five>
	<five>KEY_NUMERIC_5</five>
	<six>KEY_6</six>
	<six>KEY_NUMERIC_6</six>
	<seven>KEY_7</seven>
	<seven>KEY_NUMERIC_7</seven>
	<eight>KEY_8</eight>
	<eight>KEY_NUMERIC_8</eight>
	<nine>KEY_9</nine>
	<nine>KEY_NUMERIC_9</nine>
	<zero>KEY_0</zero>
	<zero>KEY_NUMERIC_0</zero>
	<star>KEY_KPASTERISK</star>
	<star>KEY_NUMERIC_STAR</star>
	<hash>KEY_NUMERIC_POUND</hash>
	<red>KEY_RED</red>
	<green>KEY_GREEN</green>
	<yellow>KEY_YELLOW</yellow>
	<blue>KEY_BLUE</blue>
	<recordedtv>KEY_PVR</recordedtv>
	<liveradio>KEY_RADIO</liveradio>
</remote>

With all that, that gives me a master list off all the KEYCODES and KODI buttons i can utilize, and then create custom actions for.

If i can figure out how to use custom names, ill post back.

Here is a more friendly representation that i created.

#MASTER LIST OF LINUX KEYCODES AND KODI BUTTON MAPPING
	
0x01 = "KEY_LEFT"          #kodi button <left>
0x02 = "KEY_RIGHT"         #kodi button <right>
0x03 = "KEY_UP"            #kodi button <up>
0x04 = "KEY_DOWN"          #kodi button <down>
0x05 = "KEY_OK"            #kodi button <select>
0x06 = "KEY_ENTER"         #kodi button <select>
0x07 = "KEY_KPENTER"       #kodi button <select>
0x08 = "KEY_SELECT"        #kodi button <select>
0x09 = "KEY_DELETE"        #kodi button <clear>
0x0a = "KEY_ESC"           #kodi button <clear>
0x0b = "KEY_MEDIA"         #kodi button <start>
0x0c = "KEY_HOME"          #kodi button <start>
0x0d = "KEY_EXIT"          #kodi button <back>
0x0e = "KEY_BACK"          #kodi button <back>
0x0f = "KEY_BACKSPACE"     #kodi button <back>
0x10 = "KEY_ESC"           #kodi button <back>
0x11 = "KEY_E"             #kodi button <back>
0x12 = "KEY_RECORD"        #kodi button <record>
0x13 = "KEY_PLAY"          #kodi button <play>
0x14 = "KEY_PLAYPAUSE"     #kodi button <play>
0x15 = "KEY_PAUSE"         #kodi button <pause>
0x16 = "KEY_STOP"          #kodi button <stop>
0x17 = "KEY_STOPCD"        #kodi button <stop>
0x18 = "KEY_FASTFORWARD"   #kodi button <forward>
0x19 = "KEY_FORWARD"       #kodi button <forward>
0x1a = "KEY_REWIND"        #kodi button <reverse>
0x1b = "KEY_VOLUMEUP"      #kodi button <volumeplus>
0x1c = "KEY_VOLUMEDOWN"    #kodi button <volumeminus>
0x1d = "KEY_CHANNELUP"     #kodi button <pageplus>
0x1e = "KEY_PAGEUP"        #kodi button <pageplus>
0x1f = "KEY_CHANNELDOWN"   #kodi button <pageminus>
0x20 = "KEY_PAGEDOWN"      #kodi button <pageminus>
0x21 = "KEY_NEXT"          #kodi button <skipplus>
0x22 = "KEY_NEXTSONG"      #kodi button <skipplus>
0x23 = "KEY_PREVIOUS"      #kodi button <skipminus>
0x24 = "KEY_PREVIOUSSONG"  #kodi button <skipminus>
0x25 = "KEY_EPG"           #kodi button <guide>
0x26 = "KEY_TITLE"         #kodi button <title>
0x27 = "KEY_TV2"           #kodi button <title>
0x28 = "KEY_CONTEXT_MENU"  #kodi button <title>
0x29 = "KEY_SUBTITLE"      #kodi button <subtitle>
0x2a = "KEY_LANGUAGE"      #kodi button <language>
0x2b = "KEY_INFO"          #kodi button <info>
0x2c = "KEY_PROPS"         #kodi button <info>
0x2d = "KEY_ZOOM"          #kodi button <display>
0x2e = "KEY_ANGLE"         #kodi button <display>
0x2f = "KEY_MUTE"          #kodi button <mute>
0x30 = "KEY_POWER"         #kodi button <power>
0x31 = "KEY_SLEEP"         #kodi button <power>
0x32 = "KEY_WAKEUP"        #kodi button <power>
0x33 = "KEY_EJECTCD"       #kodi button <eject>
0x34 = "KEY_EJECTCLOSECD"  #kodi button <eject>
0x35 = "KEY_DVD"           #kodi button <menu>
0x36 = "KEY_MENU"          #kodi button <menu>
0x37 = "KEY_VIDEO"         #kodi button <myvideo>
0x38 = "KEY_AUDIO"         #kodi button <mymusic>
0x39 = "KEY_MP3"           #kodi button <mymusic>
0x3a = "KEY_CAMERA"        #kodi button <mypictures>
0x3b = "KEY_IMAGES"        #kodi button <mypictures>
0x3c = "KEY_TUNER"         #kodi button <livetv>
0x3d = "KEY_TV"            #kodi button <mytv>
0x3e = "KEY_PVR"           #kodi button <mytv>
0x3f = "KEY_TEXT"          #kodi button <teletext>
0x40 = "KEY_1"             #kodi button <one>
0x41 = "KEY_NUMERIC_1"     #kodi button <one>
0x42 = "KEY_2"             #kodi button <two>
0x43 = "KEY_NUMERIC_2"     #kodi button <two>
0x44 = "KEY_3"             #kodi button <three>
0x45 = "KEY_NUMERIC_3"     #kodi button <three>
0x46 = "KEY_4"             #kodi button <four>
0x47 = "KEY_NUMERIC_4"     #kodi button <four>
0x48 = "KEY_5"             #kodi button <five>
0x49 = "KEY_NUMERIC_5"     #kodi button <five>
0x4a = "KEY_6"             #kodi button <six>
0x4b = "KEY_NUMERIC_6"     #kodi button <six>
0x4c = "KEY_7"             #kodi button <seven>
0x4d = "KEY_NUMERIC_7"     #kodi button <seven>
0x4e = "KEY_8"             #kodi button <eight>
0x4f = "KEY_NUMERIC_8"     #kodi button <eight>
0x50 = "KEY_9"             #kodi button <nine>
0x51 = "KEY_NUMERIC_9"     #kodi button <nine>
0x52 = "KEY_0"             #kodi button <zero>
0x53 = "KEY_NUMERIC_0"     #kodi button <zero>
0x54 = "KEY_KPASTERISK"    #kodi button <star>
0x55 = "KEY_NUMERIC_STAR"  #kodi button <star>
0x56 = "KEY_NUMERIC_POUND" #kodi button <hash>
0x57 = "KEY_RED"           #kodi button <red>
0x58 = "KEY_GREEN"         #kodi button <green>
0x59 = "KEY_YELLOW"        #kodi button <yellow>
0x5a = "KEY_BLUE"          #kodi button <blue>
0x5b = "KEY_PVR"           #kodi button <recordedtv>
0x5c = "KEY_RADIO"         #kodi button <liveradio>