Clef shortcuts.

• Aug 12, 2020 - 23:41

I created my own shortcut for adding the treble and bass clefs this time, and I came to find out that the function is actually fake. Does not work. Or is it just the computer I have?


Comments

How/where do you set shortcuts for adding any clef?

Ah, I see, defaults are Ctrl+Y,Ctrl+1, and Ctrl+Y,Ctrl+2
Indeed work on Note Entry mode only.

But:

      {
         MsWidget::MAIN_WINDOW,
         STATE_NORMAL | STATE_NOTE_ENTRY,
         "clef-violin",
         QT_TRANSLATE_NOOP("action","Treble Clef"),
         QT_TRANSLATE_NOOP("action","Add treble clef"),
         0,
         Icons::Invalid_ICON,
         Qt::WindowShortcut
         },
      {
         MsWidget::MAIN_WINDOW,
         STATE_NORMAL | STATE_NOTE_ENTRY,
         "clef-bass",
         QT_TRANSLATE_NOOP("action","Bass Clef"),
         QT_TRANSLATE_NOOP("action","Add bass clef"),
         0,
         Icons::Invalid_ICON,
         Qt::WindowShortcut
         },

as per that code it should be possible in normal mode too? Hmm...

            { "clef-violin",                [](Score* cs, EditData&){ cs->cmdInsertClef(ClefType::G);                                 }},
            { "clef-bass",                  [](Score* cs, EditData&){ cs->cmdInsertClef(ClefType::F);                                 }},

then

void Score::cmdInsertClef(ClefType type)
      {
      if (!noteEntryMode())
            return;
      undoChangeClef(staff(inputTrack()/VOICES), inputState().cr(), type);
      }

OK, it is not ;-)

But then:

void Score::cmdInsertClef(Clef* clef, ChordRest* cr)
      {
      undoChangeClef(cr->staff(), cr, clef->clefType());
      delete clef;
      }

so there is a method, it just isn't used apparently, not for the shortcut at least.

There doesn't seem to be a good reason for not allowing this in normal mode, so see https://github.com/musescore/MuseScore/pull/6446

Do you still have an unanswered question? Please log in first to post your question.