diff --git a/src/common/JoyMap.cxx b/src/common/JoyMap.cxx index c2f20362e..8c8522e2f 100644 --- a/src/common/JoyMap.cxx +++ b/src/common/JoyMap.cxx @@ -196,9 +196,6 @@ json JoyMap::saveMapping(const EventMode mode) const [](const MapType& a, const MapType& b) { // Event::Type first - if(a.second != b.second) - return a.second < b.second; - if(a.first.button != b.first.button) return a.first.button < b.first.button; @@ -211,7 +208,10 @@ json JoyMap::saveMapping(const EventMode mode) const if(a.first.hat != b.first.hat) return a.first.hat < b.first.hat; + if(a.first.hdir != b.first.hdir) return a.first.hdir < b.first.hdir; + + return a.second < b.second; } ); diff --git a/src/common/KeyMap.cxx b/src/common/KeyMap.cxx index 7fa9b0ab9..ff0ef92fb 100644 --- a/src/common/KeyMap.cxx +++ b/src/common/KeyMap.cxx @@ -228,13 +228,13 @@ json KeyMap::saveMapping(const EventMode mode) const [](const MapType& a, const MapType& b) { // Event::Type first - if(a.second != b.second) - return a.second < b.second; - if(a.first.key != b.first.key) return a.first.key < b.first.key; - return a.first.mod < b.first.mod; + if(a.first.mod != b.first.mod) + return a.first.mod < b.first.mod; + + return a.second < b.second; } );