diff --git a/src/engine/client/key_binding.cpp b/src/engine/client/key_binding.cpp index 5ab49eda90..7488dc737b 100644 --- a/src/engine/client/key_binding.cpp +++ b/src/engine/client/key_binding.cpp @@ -465,6 +465,7 @@ class ListBindsCmd: public Cmd::StaticCmd void Run(const Cmd::Args&) const override { + std::vector lines; for (auto& kv: keys) { bool teamSpecific = false; @@ -482,7 +483,8 @@ class ListBindsCmd: public Cmd::StaticCmd { if ( kv.second.binding[ 0 ] ) { - Print( "%s → %s", ExtraInfoKeyString( kv.first ), kv.second.binding[ 0 ].value() ); + std::string line = ExtraInfoKeyString( kv.first ) + " → " + kv.second.binding[ 0 ].value(); + lines.push_back( line ); } } else @@ -491,11 +493,18 @@ class ListBindsCmd: public Cmd::StaticCmd { if ( kv.second.binding[ team ] ) { - Print( "%s [%s] → %s", ExtraInfoKeyString( kv.first ), teamName[ team ], kv.second.binding[ team ].value() ); + std::string line = ExtraInfoKeyString( kv.first ) + " [" + teamName[ team ] + "] → " + kv.second.binding[ team ].value(); + lines.push_back( line ); } } } } + + std::sort( lines.begin(), lines.end() ); + for ( std::string line : lines ) + { + Print( line ); + } } };