Adding custom action to a keycode in XBMC

There are some USB IR remotes out there specifically made to be used in media centers. I bought one of those to setup my parents Raspberry Pi.


It looked like everything worked out of the box with XBMC but then we noticed that the volume down button was not doing anything. So I had to check which keycode was being issued to bind it to the appropiate action in XBMC. You have to activate the debug on XBMC (Settings->System->Debugging) and then pressed the key a couple of times. Then look at the log file (temp/xbmc.log in your userdata directory, which in Linux is ~/.xbmc) for something like this:

18:25:59 T3034951680   DEBUG: OnKey: f14 (0xf09d) pressed, action is ...

You can use cat and grep for that:

$ cat ~/.xbmc/temp/xbmc.log | grep pressed

And there you have your keycode in hexadecimal format. Just convert it to decimal, which in this case is 65197, and then you need to know the name of the action you want to give to that keycode. The list can be found in ButtonTranslator.cpp:

        {"volumedown"        , ACTION_VOLUME_DOWN},

Finally add the key binding in keymaps/keyboard.xml file in your userdata directory:

      <key id="65197">volumedown</key>


You might also like

Add Shutdown option to XBMC in Raspbian
When I installed XBMC in Raspbian I noticed that the shutdown menu only had the "Exit" button, which...

SonataAdminBundle: Fix “The “ batch action is not defined” at app/vendor/sonata-project/admin-bundle/Controller/CRUDController.php in a shared hosting: magic_quotes_gpc
I was getting http 500 errors while deleting entities in SonataAdminBundle using the batch mode (selecting...

Fix no video problem in XBMC
Although is recommended using a dedicated media center distribution (raspbmc, openelec or xbian for example)...

Remove a WordPress action in child theme
If you want to remove a WordPress action that was added in the parent theme like this:function...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.