Walker News

Understand Kodi remote.xml keymap file structure

When a Raspberry Pi running OpenELEC connects to a HDMI CEC-enabled TV, that TV remote control can interact with Kodi media center using the system default remote.xml keymap file.

If you need to change the default mapping, you can create user-defined remote.xml and save it in this directory:
/storage/.kodi/userdata/keymaps

If you access to OpenELEC Samba server, then save it in this path:
userdata\keymaps

Structure of remote.xml
<keymap>

  <global>
    <remote>
      <button>action/function</button>
    </remote>
  </global>

  <window>
    <remote>
      <button>action/function</button>
    </remote>
  </window>

</keymap>

Inside the <keymap></keymap> tag, you must have one global section and few optional window section. The global section is enclosed by <global></global> tag and window section is enclosed by respective window tag (e.g. <Home></Home>, <SlideShow></SlideShow>, etc).

If there is no window section, Kodi refers to mapping in global section; otherwise, the keymap in window section takes precedence.
So, you can define yellow button in global section to perform action A, in <Home></Home> section to perform action B, and in <SlideShow></SlideShow> it will perform action C.

Obviously, with this keymap, the yellow button will only trigger action C when Kodi is in slideshow screen and perform action A when Kodi is not showing Home screen or slideshow.

Within the section tag is a list of keymap tag, i.e. what action or function will trigger when a button is pressed. The keymap tag is in this format:
<button>action/function name</button>

For example, blue button to capture Kodi screenshot:
<blue>Screenshot</blue>

Green button to open Music’s Playlists window:
<green>ActivateWindow(Music,Playlists)</green>

With reference to Kodi keymap and system default remote.xml, I create this user-defined remote.xml:

Customized kodi remote.xml for TV remote control

According to mapping in global section, Kodi will play Relax.xsp (smart playlist) when I press “seven” button. If “zero” button is pressed, then it will reload keymap, so that new changes saved in remote.xml become effective without rebooting Raspberry Pi.
After saving changes in remote.xml, you must either reboot the system or trigger “reloadkeymaps” function for Kodi to understand new mapping.

When Kodi is playing video, pressing “two” button will trigger BigSkipForward function, as per keymap settings defined in FullscreenVideo section.

If your TV does not come with CEC feature, then you’ll need to attach an infrared receiver to Raspberry Pi USB port and deal with both remote.xml and Lircmap.xml files.

Custom Search

2016  •  Privacy Policy