2010-02-09, 07:39
Maybe my search skills suck but I couldn't find it so here it is.
My Microsoft XBOX360 Universal Remote has a DVD Open/Close button but XBMC does not supply a button code (left,right,play...etc) to use it. Find a button code in ButtonTranslator.cpp you are not using and map it to your Open/Close button. I picked the star button because my remote does not have a star.
Below is the contents of the relevant portion of ButtonTranslator.cpp
Step 1 (Pick a button)
Step 2 (Add it to) /home/xbmc/.xbmc/Lircmap.xml
OpenClose is the name of my DVD button on my remote as described in my /etc/lirc/lircd.conf and star is the button we picked to use in the ButtonTranslator.cpp
Step 3 (Add it to) /home/xbmc/.xbmc/Keymap.xml
Step 4 Restart XBMC try the button.
You can get a very good understanding of the relationship between these files by this example so you can map just about any button any way you want. There are lots of commands internal to XBMC you can send.
My Microsoft XBOX360 Universal Remote has a DVD Open/Close button but XBMC does not supply a button code (left,right,play...etc) to use it. Find a button code in ButtonTranslator.cpp you are not using and map it to your Open/Close button. I picked the star button because my remote does not have a star.
Below is the contents of the relevant portion of ButtonTranslator.cpp
Step 1 (Pick a button)
Code:
if (strButton.Equals("left")) buttonCode = XINPUT_IR_REMOTE_LEFT;
else if (strButton.Equals("right")) buttonCode = XINPUT_IR_REMOTE_RIGHT;
else if (strButton.Equals("up")) buttonCode = XINPUT_IR_REMOTE_UP;
else if (strButton.Equals("down")) buttonCode = XINPUT_IR_REMOTE_DOWN;
else if (strButton.Equals("select")) buttonCode = XINPUT_IR_REMOTE_SELECT;
else if (strButton.Equals("back")) buttonCode = XINPUT_IR_REMOTE_BACK;
else if (strButton.Equals("menu")) buttonCode = XINPUT_IR_REMOTE_MENU;
else if (strButton.Equals("info")) buttonCode = XINPUT_IR_REMOTE_INFO;
else if (strButton.Equals("display")) buttonCode = XINPUT_IR_REMOTE_DISPLAY;
else if (strButton.Equals("title")) buttonCode = XINPUT_IR_REMOTE_TITLE;
else if (strButton.Equals("play")) buttonCode = XINPUT_IR_REMOTE_PLAY;
else if (strButton.Equals("pause")) buttonCode = XINPUT_IR_REMOTE_PAUSE;
else if (strButton.Equals("reverse")) buttonCode = XINPUT_IR_REMOTE_REVERSE;
else if (strButton.Equals("forward")) buttonCode = XINPUT_IR_REMOTE_FORWARD;
else if (strButton.Equals("skipplus")) buttonCode = XINPUT_IR_REMOTE_SKIP_PLUS;
else if (strButton.Equals("[b][color=red]star[/color][/b]")) buttonCode = XINPUT_IR_REMOTE_STAR;
else if (strButton.Equals("skipminus")) buttonCode = XINPUT_IR_REMOTE_SKIP_MINUS;
else if (strButton.Equals("stop")) buttonCode = XINPUT_IR_REMOTE_STOP;
else if (strButton.Equals("zero")) buttonCode = XINPUT_IR_REMOTE_0;
else if (strButton.Equals("one")) buttonCode = XINPUT_IR_REMOTE_1;
else if (strButton.Equals("two")) buttonCode = XINPUT_IR_REMOTE_2;
else if (strButton.Equals("three")) buttonCode = XINPUT_IR_REMOTE_3;
else if (strButton.Equals("four")) buttonCode = XINPUT_IR_REMOTE_4;
else if (strButton.Equals("five")) buttonCode = XINPUT_IR_REMOTE_5;
else if (strButton.Equals("six")) buttonCode = XINPUT_IR_REMOTE_6;
else if (strButton.Equals("seven")) buttonCode = XINPUT_IR_REMOTE_7;
else if (strButton.Equals("eight")) buttonCode = XINPUT_IR_REMOTE_8;
else if (strButton.Equals("nine")) buttonCode = XINPUT_IR_REMOTE_9;
// additional keys from the media center extender for xbox remote
else if (strButton.Equals("power")) buttonCode = XINPUT_IR_REMOTE_POWER;
else if (strButton.Equals("mytv")) buttonCode = XINPUT_IR_REMOTE_MY_TV;
else if (strButton.Equals("mymusic")) buttonCode = XINPUT_IR_REMOTE_MY_MUSIC;
else if (strButton.Equals("mypictures")) buttonCode = XINPUT_IR_REMOTE_MY_PICTURES;
else if (strButton.Equals("myvideo")) buttonCode = XINPUT_IR_REMOTE_MY_VIDEOS;
else if (strButton.Equals("record")) buttonCode = XINPUT_IR_REMOTE_RECORD;
else if (strButton.Equals("start")) buttonCode = XINPUT_IR_REMOTE_START;
else if (strButton.Equals("volumeplus")) buttonCode = XINPUT_IR_REMOTE_VOLUME_PLUS;
else if (strButton.Equals("volumeminus")) buttonCode = XINPUT_IR_REMOTE_VOLUME_MINUS;
else if (strButton.Equals("channelplus")) buttonCode = XINPUT_IR_REMOTE_CHANNEL_PLUS;
else if (strButton.Equals("channelminus")) buttonCode = XINPUT_IR_REMOTE_CHANNEL_MINUS;
else if (strButton.Equals("pageplus")) buttonCode = XINPUT_IR_REMOTE_CHANNEL_PLUS;
else if (strButton.Equals("pageminus")) buttonCode = XINPUT_IR_REMOTE_CHANNEL_MINUS;
else if (strButton.Equals("mute")) buttonCode = XINPUT_IR_REMOTE_MUTE;
else if (strButton.Equals("recordedtv")) buttonCode = XINPUT_IR_REMOTE_RECORDED_TV;
else if (strButton.Equals("guide")) buttonCode = XINPUT_IR_REMOTE_TITLE; // same as title
else if (strButton.Equals("livetv")) buttonCode = XINPUT_IR_REMOTE_LIVE_TV;
else if (strButton.Equals("hash")) buttonCode = XINPUT_IR_REMOTE_HASH;
else if (strButton.Equals("clear")) buttonCode = XINPUT_IR_REMOTE_CLEAR;
else if (strButton.Equals("enter")) buttonCode = XINPUT_IR_REMOTE_SELECT; // same as select
else if (strButton.Equals("xbox")) buttonCode = XINPUT_IR_REMOTE_DISPLAY; // same as display
else if (strButton.Equals("teletext")) buttonCode = XINPUT_IR_REMOTE_TELETEXT;
else if (strButton.Equals("red")) buttonCode = XINPUT_IR_REMOTE_RED;
else if (strButton.Equals("green")) buttonCode = XINPUT_IR_REMOTE_GREEN;
else if (strButton.Equals("yellow")) buttonCode = XINPUT_IR_REMOTE_YELLOW;
else if (strButton.Equals("blue")) buttonCode = XINPUT_IR_REMOTE_BLUE;
else if (strButton.Equals("subtitle")) buttonCode = XINPUT_IR_REMOTE_SUBTITLE;
else if (strButton.Equals("language")) buttonCode = XINPUT_IR_REMOTE_LANGUAGE;
else CLog::Log(LOGERROR, "Remote Translator: Can't find button %s", strButton.c_str());
return buttonCode;
}
Step 2 (Add it to) /home/xbmc/.xbmc/Lircmap.xml
Code:
<lircmap>
<remote device="Microsoft_Xbox360">
[color=red]<star>OpenClose</star>[/color]
<left>LeftArrow</left>
<right>RightArrow</right>
I removed the bottom portion of this file to make this post shorter. Yours will be much longer
OpenClose is the name of my DVD button on my remote as described in my /etc/lirc/lircd.conf and star is the button we picked to use in the ButtonTranslator.cpp
Step 3 (Add it to) /home/xbmc/.xbmc/Keymap.xml
Code:
<keymap>
<keymap>
<global>
<remote>
[color=red]<star>XBMC.EjectTray()</star> [/color]
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
Step 4 Restart XBMC try the button.
You can get a very good understanding of the relationship between these files by this example so you can map just about any button any way you want. There are lots of commands internal to XBMC you can send.