aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/keymaps/gamepad.xml7
-rw-r--r--system/keymaps/keyboard.xml7
-rw-r--r--system/keymaps/remote.xml7
-rw-r--r--xbmc/input/ButtonTranslator.cpp16
4 files changed, 26 insertions, 11 deletions
diff --git a/system/keymaps/gamepad.xml b/system/keymaps/gamepad.xml
index 0f4422fcd0..1e839ca59d 100644
--- a/system/keymaps/gamepad.xml
+++ b/system/keymaps/gamepad.xml
@@ -18,9 +18,10 @@
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
-<!-- Note that the action can be a built-in function. -->
-<!-- eg <B>ActivateWindow(MyMusic)</B> -->
-<!-- would automatically go to My Music on the press of the B button. -->
+<!-- Note that the action can be a built-in function. -->
+<!-- eg <B>ActivateWindow(MyMusic)</B> -->
+<!-- would automatically go to My Music on the press of the B button. -->
+<!-- An empty action removes the corresponding mapping from the default keymap -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml
index 7fe13d116b..f420c48ee8 100644
--- a/system/keymaps/keyboard.xml
+++ b/system/keymaps/keyboard.xml
@@ -18,9 +18,10 @@
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
-<!-- Note that the action can be a built-in function. -->
-<!-- eg <B>ActivateWindow(MyMusic)</B> -->
-<!-- would automatically go to My Music on the press of the B button. -->
+<!-- Note that the action can be a built-in function. -->
+<!-- eg <B>ActivateWindow(MyMusic)</B> -->
+<!-- would automatically go to My Music on the press of the B button. -->
+<!-- An empty action removes the corresponding mapping from the default keymap -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml
index 8e37d0f305..aded72bba4 100644
--- a/system/keymaps/remote.xml
+++ b/system/keymaps/remote.xml
@@ -18,9 +18,10 @@
<!-- <obc45>Stop</obc45> -->
<!-- </universalremote> -->
-<!-- Note that the action can be a built-in function. -->
-<!-- eg <B>ActivateWindow(MyMusic)</B> -->
-<!-- would automatically go to My Music on the press of the B button. -->
+<!-- Note that the action can be a built-in function. -->
+<!-- eg <B>ActivateWindow(MyMusic)</B> -->
+<!-- would automatically go to My Music on the press of the B button. -->
+<!-- An empty action removes the corresponding mapping from the default keymap -->
<!-- Joysticks / Gamepads: -->
<!-- See the sample PS3 controller configuration below for the format. -->
diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp
index 62c07106d0..0efbddae58 100644
--- a/xbmc/input/ButtonTranslator.cpp
+++ b/xbmc/input/ButtonTranslator.cpp
@@ -1325,8 +1325,20 @@ void CButtonTranslator::MapWindowActions(TiXmlNode *pWindow, int windowID)
else if (type == "appcommand")
buttonCode = TranslateAppCommand(pButton->Value());
- if (buttonCode && pButton->FirstChild())
- MapAction(buttonCode, pButton->FirstChild()->Value(), map);
+ if (buttonCode)
+ {
+ if (pButton->FirstChild() && pButton->FirstChild()->Value()[0])
+ MapAction(buttonCode, pButton->FirstChild()->Value(), map);
+ else
+ {
+ buttonMap::iterator it = map.find(buttonCode);
+ while (it != map.end())
+ {
+ map.erase(it);
+ it = map.find(buttonCode);
+ }
+ }
+ }
pButton = pButton->NextSiblingElement();
}