I finally got it working (including the power buttons). I have the same remote as RAL67 (lsub returns Bus 002 Device 005: ID 04b4:0100 Cypress Semiconductor Corp.). The top button colors and assignments are slightly different than the one in the first message of this thread:
The issue is a bug in XBMC that does not handle correctly the keyboard power events (the remote emulates a keyboard and a mouse).
The problem is the same as here:
http://forum.xbmc.org/showthread.php?tid=63966
And more specifically:
http://forum.xbmc.org/showpost.php?p=499...stcount=33 (Thanks to hb76)
In summary to resolve, you need to:
1 - Be prepared to compile XBMC
2 - Change the code to hardcode the keyboard assignments
3 - Recompile
4 - Insert the proper key ids in keyboard.xml
In more details:
1 - Building XBMC can be complex depending of your distro and which version of XBMC you want to compile. I was only able to compile it using this procedure:
http://forum.xbmc.org/showthread.php?tid=89817
Unfortunatly, you will end up with the latest unstable version of XBMC. If anyone has a procedure to build XBMC Dharma 10.0 on Ubuntu since it was moved to GIT, please let me know.
2 - The change to the code is straight forward. Search for KeyboardStat.cpp in the directory where you downloaded the source. You will need to add the 2 lines indicated by a + sign (don't leave the plus signs!)
Code:
static bool LookupKeyMapping(BYTE* VKey, char* Ascii, WCHAR* Unicode, int source, XBMC_KeyMapping* map, int count)
{
for(int i = 0; i < count; i++)
{
if(source == map[i].source)
{
if(VKey)
*VKey = map[i].VKey;
if(Ascii)
*Ascii = map[i].Ascii;
if(Unicode)
*Unicode = map[i].Unicode;
return true;
}
}
+ if((source == 150) || (source == 124))
+ *VKey=XBMCK_POWER;
return false;
}
3 - Recompile. If you succeeded in step 1, this should be easy enough...
4 - Copy /usr/share/xbmc/system/keymaps/keyboard.xml to $HOME/.xbmc/userdata/keymaps
Add the following keys to the global section:
<key id="61504">ActivateWindow(shutdownmenu)</key> <!-- Power button to Displays the shutdown menu with options -->
<key id="61599">XBMC.Suspend()</key> <!-- Stanby button Directly puts computer to standby -->
You can also customize the other keys. If you want to know what key id to use, simply start XBMC, press the key and exit. In $HOME/.xbmc/temp/xbmc.log, you will find the values like this:
DEBUG: SDLKeyboard: scancode: xxx, sym: 0, unicode: 0, modifier: 0
DEBUG: OnKey: yyyyy pressed, action is ...
On Dharma latest unstable, the values were in Hexadecimal. You can use the Ubuntu calculator to convert them to Decimal. I have personnally added these other keys:
<key id="127055">ContextMenu</key> <!-- Key with a picture of a folder on and 7pqrs above which previously generated a Notification - MCEKeypress RecordTV -->
<key id="323593">CodecInfo</key> <!-- Key with a picture of Windows on and 0 above -->
<key id="61952">Info</key> <!-- Key with a picture of a monitor on and Desktop above -->
<key id="61624">OSD</key> <!-- Key with a picture of a monitor on and Mypc above -->
<key id="61536">ShowSubtitles</key> <!-- numlock key + key with a picture of Windows on and 0 above -->
That's it! The skip keys behave a bit strangely and some key send two events (for instance, if I press Info I also gets the CodecInfo) but this is pretty much usable.
Enjoy!