aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/keymaps/gamepad.xml8
-rw-r--r--system/keymaps/joystick.Alienware.Dual.Compatible.Controller.xml8
-rw-r--r--system/keymaps/joystick.AppleRemote.xml8
-rw-r--r--system/keymaps/joystick.Harmony.xml8
-rw-r--r--system/keymaps/joystick.Interact.AxisPad.xml8
-rw-r--r--system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml8
-rw-r--r--system/keymaps/joystick.Microsoft.Xbox.Controller.S.xml8
-rw-r--r--system/keymaps/joystick.PS3.Remote.Keyboard.xml8
-rw-r--r--system/keymaps/joystick.Sony.PLAYSTATION(R)3.Controller.xml8
-rw-r--r--system/keymaps/joystick.WiiRemote.xml8
-rw-r--r--system/keymaps/keyboard.xml8
-rw-r--r--system/keymaps/remote.xml8
-rw-r--r--xbmc/AdvancedSettings.cpp3
-rw-r--r--xbmc/AdvancedSettings.h1
-rw-r--r--xbmc/ButtonTranslator.cpp18
-rw-r--r--xbmc/ButtonTranslator.h2
-rw-r--r--xbmc/utils/EventClient.cpp4
17 files changed, 124 insertions, 0 deletions
diff --git a/system/keymaps/gamepad.xml b/system/keymaps/gamepad.xml
index 162eb88692..def24377e8 100644
--- a/system/keymaps/gamepad.xml
+++ b/system/keymaps/gamepad.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Alienware.Dual.Compatible.Controller.xml b/system/keymaps/joystick.Alienware.Dual.Compatible.Controller.xml
index 7b661181e6..50522fcaeb 100644
--- a/system/keymaps/joystick.Alienware.Dual.Compatible.Controller.xml
+++ b/system/keymaps/joystick.Alienware.Dual.Compatible.Controller.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.AppleRemote.xml b/system/keymaps/joystick.AppleRemote.xml
index e3ee4c1263..51adb6bc5e 100644
--- a/system/keymaps/joystick.AppleRemote.xml
+++ b/system/keymaps/joystick.AppleRemote.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Harmony.xml b/system/keymaps/joystick.Harmony.xml
index 422afdda0d..439036463a 100644
--- a/system/keymaps/joystick.Harmony.xml
+++ b/system/keymaps/joystick.Harmony.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Interact.AxisPad.xml b/system/keymaps/joystick.Interact.AxisPad.xml
index 479efb5746..6ccdbe9c74 100644
--- a/system/keymaps/joystick.Interact.AxisPad.xml
+++ b/system/keymaps/joystick.Interact.AxisPad.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml b/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
index d9691e50d3..56a8092969 100644
--- a/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
+++ b/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Microsoft.Xbox.Controller.S.xml b/system/keymaps/joystick.Microsoft.Xbox.Controller.S.xml
index cc97bd4564..ceac23077e 100644
--- a/system/keymaps/joystick.Microsoft.Xbox.Controller.S.xml
+++ b/system/keymaps/joystick.Microsoft.Xbox.Controller.S.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.PS3.Remote.Keyboard.xml b/system/keymaps/joystick.PS3.Remote.Keyboard.xml
index 61baef5882..b96cd3c9e1 100644
--- a/system/keymaps/joystick.PS3.Remote.Keyboard.xml
+++ b/system/keymaps/joystick.PS3.Remote.Keyboard.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.Sony.PLAYSTATION(R)3.Controller.xml b/system/keymaps/joystick.Sony.PLAYSTATION(R)3.Controller.xml
index d05279d75f..4cbb441b9f 100644
--- a/system/keymaps/joystick.Sony.PLAYSTATION(R)3.Controller.xml
+++ b/system/keymaps/joystick.Sony.PLAYSTATION(R)3.Controller.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/joystick.WiiRemote.xml b/system/keymaps/joystick.WiiRemote.xml
index 664b1b42bb..2234c029b0 100644
--- a/system/keymaps/joystick.WiiRemote.xml
+++ b/system/keymaps/joystick.WiiRemote.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml
index 4aea3ab987..6762f40f26 100644
--- a/system/keymaps/keyboard.xml
+++ b/system/keymaps/keyboard.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml
index 82ad1ae15c..d8195efc1b 100644
--- a/system/keymaps/remote.xml
+++ b/system/keymaps/remote.xml
@@ -10,6 +10,14 @@
<!-- <button>action</button> -->
<!-- </device> -->
+<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
+<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
+<!-- You set it up by adding a <universalremote> block to the window or <global> section: -->
+<!-- <universalremote> -->
+<!-- <obc45>Stop</obc45> -->
+<!-- </universalremote> -->
+<!-- To find out the OBC's of your remote, try enabling the <displayremotecodes> tag in AdvancedSettings.xml -->
+
<!-- Note that the action can be a built-in function. -->
<!-- eg <B>XBMC.ActivateWindow(MyMusic)</B> -->
<!-- would automatically go to My Music on the press of the B button. -->
diff --git a/xbmc/AdvancedSettings.cpp b/xbmc/AdvancedSettings.cpp
index 1ea846db57..7dc69c4292 100644
--- a/xbmc/AdvancedSettings.cpp
+++ b/xbmc/AdvancedSettings.cpp
@@ -134,6 +134,7 @@ void CAdvancedSettings::Initialize()
m_fullScreenOnMovieStart = true;
m_noDVDROM = false;
m_cachePath = "special://temp/";
+ m_displayRemoteCodes = false;
m_videoCleanDateTimeRegExp = "(.*[^ _\\,\\.\\(\\)\\[\\]\\-])[ _\\.\\(\\)\\[\\]\\-]+(19[0-9][0-9]|20[0-1][0-9])([ _\\,\\.\\(\\)\\[\\]\\-]|[^0-9]$)";
@@ -614,6 +615,8 @@ bool CAdvancedSettings::Load()
m_vecTokens.clear();
CLangInfo::LoadTokens(pRootElement->FirstChild("sorttokens"),m_vecTokens);
+ XMLUtils::GetBoolean(pRootElement, "displayremotecodes", m_displayRemoteCodes);
+
// TODO: Should cache path be given in terms of our predefined paths??
// Are we even going to have predefined paths??
CSettings::GetPath(pRootElement, "cachepath", m_cachePath);
diff --git a/xbmc/AdvancedSettings.h b/xbmc/AdvancedSettings.h
index 6388e31061..9678e4c107 100644
--- a/xbmc/AdvancedSettings.h
+++ b/xbmc/AdvancedSettings.h
@@ -145,6 +145,7 @@ class CAdvancedSettings
bool m_fullScreenOnMovieStart;
bool m_noDVDROM;
CStdString m_cachePath;
+ bool m_displayRemoteCodes;
CStdString m_videoCleanDateTimeRegExp;
CStdStringArray m_videoCleanStringRegExps;
CStdStringArray m_videoExcludeFromListingRegExps;
diff --git a/xbmc/ButtonTranslator.cpp b/xbmc/ButtonTranslator.cpp
index 2f26d44ddf..8ad1ed6782 100644
--- a/xbmc/ButtonTranslator.cpp
+++ b/xbmc/ButtonTranslator.cpp
@@ -504,6 +504,10 @@ int CButtonTranslator::TranslateLircRemoteString(const char* szDevice, const cha
if (it2 == (*it).second.end())
return 0;
+ // Convert the button to code
+ if (strnicmp((*it2).second.c_str(), "obc", 3) == 0)
+ return TranslateUniversalRemoteString((*it2).second.c_str());
+
return TranslateRemoteString((*it2).second.c_str());
}
#endif
@@ -805,6 +809,8 @@ void CButtonTranslator::MapWindowActions(TiXmlNode *pWindow, int windowID)
buttonCode = TranslateGamepadString(pButton->Value());
else if (type == "remote")
buttonCode = TranslateRemoteString(pButton->Value());
+ else if (type == "universalremote")
+ buttonCode = TranslateUniversalRemoteString(pButton->Value());
else if (type == "keyboard")
buttonCode = TranslateKeyboardButton(pButton);
@@ -1011,6 +1017,18 @@ uint32_t CButtonTranslator::TranslateRemoteString(const char *szButton)
return buttonCode;
}
+uint32_t CButtonTranslator::TranslateUniversalRemoteString(const char *szButton)
+{
+ if (!szButton || strlen(szButton) < 4 || strnicmp(szButton, "obc", 3))
+ return 0;
+ const char *szCode = szButton + 3;
+ // Button Code is 255 - OBC (Original Button Code) of the button
+ uint32_t buttonCode = 255 - atol(szCode);
+ if (buttonCode > 255)
+ buttonCode = 0;
+ return buttonCode;
+}
+
uint32_t CButtonTranslator::TranslateKeyboardString(const char *szButton)
{
uint32_t buttonCode = 0;
diff --git a/xbmc/ButtonTranslator.h b/xbmc/ButtonTranslator.h
index c3c476c7ad..112c3902ed 100644
--- a/xbmc/ButtonTranslator.h
+++ b/xbmc/ButtonTranslator.h
@@ -101,6 +101,8 @@ private:
static uint32_t TranslateGamepadString(const char *szButton);
static uint32_t TranslateRemoteString(const char *szButton);
+ static uint32_t TranslateUniversalRemoteString(const char *szButton);
+
static uint32_t TranslateKeyboardString(const char *szButton);
static uint32_t TranslateKeyboardButton(TiXmlElement *pButton);
diff --git a/xbmc/utils/EventClient.cpp b/xbmc/utils/EventClient.cpp
index 9b042191da..e704912873 100644
--- a/xbmc/utils/EventClient.cpp
+++ b/xbmc/utils/EventClient.cpp
@@ -82,6 +82,10 @@ void CEventButtonState::Load()
{
m_iKeyCode = CButtonTranslator::TranslateRemoteString( m_buttonName.c_str() );
}
+ else if ( m_mapName.compare("R2") == 0 ) // xbox unviversal remote map
+ {
+ m_iKeyCode = CButtonTranslator::TranslateUniversalRemoteString( m_buttonName.c_str() );
+ }
else if ( (m_mapName.length() > 3) &&
(m_mapName.compare(0, 3, "LI:") == 0) ) // starts with LI: ?
{