2010-04-08, 11:14
I've recently bought cheap noname PC remote and at last could try to control XBMC with remote. This one is HID one, as lot of modern remotes are (for example iMON series, GoTView, MCE remotes, etc.) so it sends keypresses as if it is multimedia keyboard. It works fine with XBMC but sad thing I could not get 5 keys to work since XBMS doesn't understand some of keyboard codes - for example lot of multimedia keyboards have key "E-Mail" but XBMC cannot generate VKey for it. So I've added 4 missed codes to sources and wanted to add SLEEP one (XF86Sleep in XOrg) too but could not "invent" VKey for it. Also I've added few more text representations into CButtonTranslator::TranslateKeyboardString() function for human-readable look in keyboard.xml file. Would be glad if someone could merge it into SVN. I haven't added anything into system/keymaps/keyboard.xml so may be it would be good to add empty bindings there too?
Code:
--- xbmc-9.11.orig/xbmc/KeyboardStat.cpp
+++ xbmc-9.11/xbmc/KeyboardStat.cpp
@@ -72,6 +72,10 @@
, { 135, 0x5d } // Right click
, { 136, 0xb2 } // Stop
, { 138, 0x49 } // Info
+//, { 150, 0x } // Sleep
+, { 152, 0xb8 } // Launch file browser
+, { 163, 0xb4 } // Launch Mail
+, { 164, 0xab } // Browser favorites
, { 166, 0xa6 } // Browser back
, { 167, 0xa7 } // Browser forward
, { 171, 0xb0 } // Next track
@@ -79,6 +83,7 @@
, { 173, 0xb1 } // Prev track
, { 174, 0xb2 } // Stop
, { 176, 0x52 } // Rewind
+, { 179, 0xb9 } // Launch media center
, { 180, 0xac } // Browser home
, { 181, 0xa8 } // Browser refresh
, { 214, 0x1B } // Close
--- xbmc-9.11.orig/xbmc/ButtonTranslator.cpp
+++ xbmc-9.11/xbmc/ButtonTranslator.cpp
@@ -1157,8 +1157,12 @@
else if (strKey.Equals("browser_favorites")) buttonCode = 0xF0AB;
else if (strKey.Equals("browser_refresh")) buttonCode = 0xF0A8;
else if (strKey.Equals("browser_search")) buttonCode = 0xF0AA;
+ else if (strKey.Equals("browser_back")) buttonCode = 0xF0A6;
+ else if (strKey.Equals("browser_forward")) buttonCode = 0xF0A7;
else if (strKey.Equals("launch_app1_pc_icon")) buttonCode = 0xF0B6;
else if (strKey.Equals("launch_media_select")) buttonCode = 0xF0B5;
+ else if (strKey.Equals("launch_explorer")) buttonCode = 0xF0B8;
+ else if (strKey.Equals("launch_media_center")) buttonCode = 0xF0B9;
else if (strKey.Equals("play_pause")) buttonCode = 0xF0B3;
else if (strKey.Equals("stop")) buttonCode = 0xF0B2;
else if (strKey.Equals("volume_up")) buttonCode = 0xF0AF;