aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrady Svedin <brady.svedin@gmail.com>2024-05-09 19:29:02 -0600
committerBrady Svedin <brady.svedin@gmail.com>2024-05-09 19:49:47 -0600
commitb2211b50232ffa421c7d0c4ef8c7d5c7dbc49caa (patch)
tree3324aba055c337107f44bbdc9341ae27f392121d
parentf1267ebf159d937477e9998e67e47d64ac85d6be (diff)
downloadxbmc-b2211b50232ffa421c7d0c4ef8c7d5c7dbc49caa.tar.xz
Allow for better joystick hotkey overrides
This makes joystick hotkey overrides with the same hold duration as another action possible. Also updated joystick.xml comments to showcase new behavior.
-rw-r--r--system/keymaps/joystick.xml25
-rw-r--r--xbmc/input/keymaps/KeymapTypes.h2
2 files changed, 21 insertions, 6 deletions
diff --git a/system/keymaps/joystick.xml b/system/keymaps/joystick.xml
index 2db760b4c0..8097e32c4d 100644
--- a/system/keymaps/joystick.xml
+++ b/system/keymaps/joystick.xml
@@ -28,14 +28,29 @@
<!-- <a holdtime="500">ContextMenu</a> -->
<!-- </joystick> -->
<!-- -->
-<!-- Buttons can be also require hotkeys to be pressed: -->
+<!-- Buttons can be overloaded with hotkeys: -->
<!-- <joystick profile="game.controller.default"> -->
-<!-- <start hotkey="back">Stop</start> -->
+<!-- <a>Select</a> -->
+<!-- <a hotkey="back">ContextMenu</a> -->
+<!-- </joystick> -->
+<!-- -->
+<!-- It is even possible to combine both hotkeys and hold durations: -->
+<!-- <joystick profile="game.controller.default"> -->
+<!-- <a>Select</a> -->
+<!-- <a hotkey="back">ContextMenu</a> -->
+<!-- <a hotkey="back" holdtime="500">Stop</a> -->
+<!-- </joystick> -->
+<!-- -->
+<!-- Both hold duration and hotkeys can be the only stand alone variant of -->
+<!-- an action: -->
+<!-- <joystick profile="game.controller.default"> -->
+<!-- <a hotkey="back">ContextMenu</a> -->
+<!-- <b holdtime="500">Stop</b> -->
<!-- </joystick> -->
<!-- -->
-<!-- Due to limitations in the button mapper, buttons can be overloaded with -->
-<!-- different hold durations, but not different hotkeys for the same -->
-<!-- duration. -->
+<!-- A limitation is that if a single press is mapped in a section, a -->
+<!-- global "holdtime" overload will be ignored. The workaround is to -->
+<!-- duplicate the holdtime overload in the section. -->
<!-- -->
<!-- More documentation on keymaps can be found on -->
<!-- http://kodi.wiki/view/keymaps -->
diff --git a/xbmc/input/keymaps/KeymapTypes.h b/xbmc/input/keymaps/KeymapTypes.h
index 501766cf18..c2d18609e8 100644
--- a/xbmc/input/keymaps/KeymapTypes.h
+++ b/xbmc/input/keymaps/KeymapTypes.h
@@ -38,7 +38,7 @@ struct KeymapAction
struct KeymapActionGroup
{
int windowId = -1;
- std::set<KeymapAction> actions;
+ std::multiset<KeymapAction> actions;
};
} // namespace KEYMAP
} // namespace KODI