{"id":293,"date":"2008-12-18T22:08:00","date_gmt":"2008-12-18T22:08:00","guid":{"rendered":"http:\/\/blog.cyberwizzard.nl\/?p=293"},"modified":"2016-03-17T21:23:40","modified_gmt":"2016-03-17T20:23:40","slug":"configuring-custom-remote-buttons-for-xbmc","status":"publish","type":"post","link":"https:\/\/blog.cyberwizzard.nl\/?p=293","title":{"rendered":"Configuring custom remote buttons for XBMC"},"content":{"rendered":"<p>When you are the proud owner of a MCE remote, you are set for use with XBMC. However, if you are using a custom remote (like the one that came with my Thermaltake DH-101 MediaLab kit) \u2013 you might wonder how you are going to get all the buttons to work. Short answer: you won\u2019t by using the Lircmap.xml file.<\/p>\n<p>I configured my remote using Lircmap.xml like it stated on the site and it worked fine. I modified the bit in both Lircmap.xml and Keymap.xml until the point came where you want to add buttons that are not on the standard remote.<\/p>\n<p>I figured, I could just add another button to the section of Keymap.xml \u2013 in my case XBMC.EjectTray() but although XBMC started fine, you wind up with this:<\/p>\n<pre>ERROR: Remote Translator: Can't find button eject<\/pre>\n<p>This is because XBMC uses a fixed map to determine which buttons are valid. Instead of simply adding buttons by name, they have identifiers for each button so adding your own buttons won\u2019t work.<\/p>\n<p>At this point, you have 2 options:<\/p>\n<p>First, if you only have a few buttons you could recycle unused buttons. Open up <a href=\"http:\/\/xbmc.org\/trac\/browser\/trunk\/XBMC\/xbmc\/ButtonTranslator.cpp\">http:\/\/xbmc.org\/trac\/browser\/trunk\/XBMC\/xbmc\/ButtonTranslator.cpp<\/a> and look for the function called \u2018CButtonTranslator<span class=\"o\">::<\/span>TranslateRemoteString<span class=\"p\">(<\/span><span class=\"k\">const<\/span>\u00a0<span class=\"kt\">char<\/span>\u00a0<span class=\"o\">*<\/span>szButton<span class=\"p\">)\u2019; ctrl+f it if you can\u2019t find it, right now it is at line 777. See the lines following it? Those are the valid button names. For example: \u2018<span class=\"k\">if<\/span>\u00a0<span class=\"p\">(<\/span>strButton<span class=\"p\">.<\/span>Equals<span class=\"p\">(<\/span><span class=\"s\">&#8220;left&#8221;<\/span><span class=\"p\">))<\/span> wButtonCode <span class=\"o\">=<\/span> XINPUT_IR_REMOTE_LEFT<span class=\"p\">;\u2019 \u2013 in this line the name \u2018left\u2019 is specified. Look for buttons you are not using and override their action in Keymap.xml.<\/span><\/span><\/p>\n<p><span class=\"p\"><span class=\"p\">The second option is a bit trickier. First, create \u2018advancedsettings.xml\u2019 in de userdata folder and put \u2018true\u2019 inside the file. Restart XBMC and start monitoring the XBMC log (by default under \/var\/tmp\/xbmc-user.log\u2019).<\/span><\/span><\/p>\n<p><span class=\"p\"><span class=\"p\">Start pressing all remote buttons and note which obc code they produce. Add all these codes to Keymap.xml under the tag \u2013 create it if you have to. A valid piece would look like:<\/span><\/span><\/p>\n<pre>[keymap]<br \/>\t[global]<br \/>\t\t[universalremote]<br \/>\t\t\t[obc30]XBMC.EjectTray()[\/obc30]<br \/>\t\t[\/universalremote]<br \/>\t\t...<\/pre>\n<p style=\"color: red;\">Note that I replaced the tag start and endings with &#8216;[&#8216; and &#8216;]&#8217; because my site seems to eat the correct ones.<\/p>\n<p>Good luck taming XBMC and if you can\u2019t figure out how to read the source file with the button names, you can look at <a href=\"http:\/\/xbmc.org\/wiki\/?title=Keymap.xml#Remote_Buttons\" target=\"_blank\">this wiki article from the XBMC website<\/a>. Note that it is usually out of date.<\/p>\n<p>Update: the OBC codes only worked when I was using my universal remote with the XBox setting \u2013 unfortunately, this does not seem to work for specific remotes. Drat.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you are the proud owner of a MCE remote, you are set for use with XBMC. However, if you are using a custom remote (like the one that came with my Thermaltake DH-101 MediaLab kit) \u2013 you might wonder how you are going to get all the buttons to work. Short answer: you won\u2019t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[293,289,286,287,185,459,291,288,292,294,290],"class_list":["post-293","post","type-post","status-publish","format-standard","hentry","category-general-blog-entries","tag-browser","tag-buttons","tag-configuring","tag-custom","tag-for","tag-not_ok","tag-org","tag-remote","tag-trac","tag-trunk","tag-xbmc"],"views":1391,"_links":{"self":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293"}],"version-history":[{"count":1,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions\/440"}],"wp:attachment":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}