2828#include " global/io/file.h"
2929#include " global/serialization/xmlstreamreader.h"
3030#include " global/serialization/xmlstreamwriter.h"
31+ #include " global/containers.h"
3132
3233#include " multiwindows/resourcelockguard.h"
34+ #include " ui/navigationcommands.h"
3335
3436#include " log.h"
3537
3638using namespace muse ;
3739using namespace muse ::shortcuts;
3840using namespace muse ::async;
41+ using namespace muse ::ui;
3942
4043static constexpr std::string_view SHORTCUTS_TAG (" Shortcuts" );
4144static constexpr std::string_view SHORTCUT_TAG (" SC" );
@@ -46,6 +49,25 @@ static constexpr std::string_view AUTOREPEAT_TAG("autorepeat");
4649
4750static const std::string SHORTCUTS_RESOURCE_NAME (" SHORTCUTS" );
4851
52+ static const std::map<std::string, rcommand::Command> compatActionToCommand = {
53+ { " nav-next-section" , NEXT_SECTION_COMMAND },
54+ { " nav-prev-section" , PREV_SECTION_COMMAND },
55+ { " nav-next-panel" , NEXT_PANEL_COMMAND },
56+ { " nav-prev-panel" , PREV_PANEL_COMMAND },
57+ { " nav-next-tab" , NEXT_PANEL_COMMAND },
58+ { " nav-prev-tab" , PREV_PANEL_COMMAND },
59+ { " nav-trigger-control" , TRIGGER_CONTROL_COMMAND },
60+ { " nav-right" , RIGHT_COMMAND },
61+ { " nav-left" , LEFT_COMMAND },
62+ { " nav-up" , UP_COMMAND },
63+ { " nav-down" , DOWN_COMMAND },
64+ { " nav-escape" , ESCAPE_COMMAND },
65+ { " nav-first-control" , FIRST_CONTROL_COMMAND },
66+ { " nav-last-control" , LAST_CONTROL_COMMAND },
67+ { " nav-nextrow-control" , NEXTROW_CONTROL_COMMAND },
68+ { " nav-prevrow-control" , PREVROW_CONTROL_COMMAND },
69+ };
70+
4971static const std::map<QKeySequence::StandardKey, QKeyCombination> SHORTCUTS_EXPAND_IGNORE_MAP = {
5072 { QKeySequence::StandardKey::HelpContents, Qt::Key_Help },
5173 { QKeySequence::StandardKey::Open, Qt::Key_Open },
@@ -324,6 +346,10 @@ Shortcut ShortcutsRegister::readShortcut(XmlStreamReader& reader) const
324346
325347 if (tag == ACTION_CODE_TAG ) {
326348 shortcut.action = reader.readAsciiText ();
349+ const rcommand::Command& command = muse::value (compatActionToCommand, shortcut.action );
350+ if (command.isValid ()) {
351+ shortcut.action = command.toString ();
352+ }
327353 } else if (tag == STANDARD_KEY_TAG ) {
328354 shortcut.standardKey = QKeySequence::StandardKey (reader.readInt ());
329355 } else if (tag == SEQUENCE_TAG ) {
0 commit comments