Walker News

Configure TV Remote Control To Capture Screenshot Of XBMC On Raspberry Pi

Before I know how to map the TV remote control keys to control XBMC powered by OpenELEC/Raspberry Pi, I can only use a not-so-friendly hotkey to trigger Context Menu function.

With this key-mapping trick, I can redefine the color buttons of TV remote control to do more things like capture screenshot, bring up context menu, etc.
To apply this trick, the Raspberry Pi must connect to TV via HDMI and the TV must support HDMI CEC function. In additional, this guide is based on XBMC running on OpenELEC/Raspberry Pi platform, with reference to XBMC keymap manual.

1. Power on and boot up OpenELEC.

2. [ Optional ] Skip this step, if you already know the media server IP address and its Samba service (shared folder) is running:

To check OpenELEC/Raspberry Pi IP address, go to
System > System Info > Summary 

To check Samba service status, go to
System > OpenELEC > Services

Make sure this shared folder service is turned on for the next step.

XBMC keymap file allows user redefine TV remote control button to trigger other XMBC instruction.

3. From computer/tablet, open the OpenELEC shared folder (replace IP_Address with your media server IP address):

4. Create a new file named as remote.xml (NOTE: file name must be all lower-case characters). If the file is already exist, you may make a backup for the original file before editing. For my case, there is nothing in the folder. So, I created the remote.xml with following content:

5. Reboot the Raspberry Pi and make the new key mapping become effective!
Essentially, this XML file allows me reconfigure the color buttons of Sony TV remote control for sending instruction to XBMC on OpenELEC/Raspberry Pi, i.e. take screenshot (blue button), access context menu (red button), and bring up Info menu (green button).

If you would like to remap other buttons on your HDMI-CEC capable TV remote control to perform different XBMC action, you can add/change the button name elements inside <remote></remote> tag. For the latest list of TV remote control button name (keyname) as well as instruction name (action) recognized by XBMC, kindly refer to ButtonTranslator.cpp source file and look for these function and array keywords:
uint32_t CButtonTranslator::TranslateRemoteString(const char *szButton)

static const ActionMapping actions[]

If that’s too geeky to you, then you may try out this GUI-based addon called Keymap Editor, which I suppose is more intuitive (though I haven’t tried this addon myself – be warned!).

Custom Search

2016  •  Privacy Policy