Allow to insert text to frames with ctrl+T and paste copied text with ctrl+V

• Sep 9, 2020 - 20:53

RIght now, when a frame is selected and ctrl+t or ctrl+v (having text in the clipboard) is pressed, MuseScore opens an error dialog promting to select a note or rest and try again.

[edit: updated for clarification]

Actions:
1. select a frame, press ctrl+T.
or
2. select a text item from another frame or the same frame, press ctrl+C, select a frame, press ctrl+V.

Expected results:
1. a new text element, in edit mode, appears in the frame.
or
2. the copied text is pasted in the frame.

Actual result: error message (select a note or rest and try again).

Workaround:
1. Select frame, right-click, hover add, click text.
or
2. Double-click the text element the user wants to copy, select all the text, press ctrl+C, select frame, right-click, hover add, click text, press ctrl+C. If the text had some custom formatting, apply again all the changes.

As you see, the process is quite long, especially for the second case.


Comments

Don't select the entire text item, put it in edit mode, select the text in the item, press ctrl+C to copy the text, then put the destination text in edit mode and press ctrl+V to paste it.

In reply to by mike320

Yes, that's feasible, but it could be done faster.
To add text to a frame, the user has to right click it, hover "Add" and click "Text". Why doesn't the shortcut ctrl+T work in this case?
On the other side, why isn't a new text element created when pressing ctrl+V with a text frame selected, as it is created when having a note or a rest selected?

In reply to by Asmatzaile

Because you're not just pasting a generic text, but the complete "staff text" element, which indeed requires a "staff element" to attach to. Just like you can't paste a tempo marking or a lyric directly.

I can see some merit in making MuseScore more lenient when pasting a text (sub-)type onto a frame to interpret it as "Take the text contents of this element and paste that into the frame as a generic text element".

In reply to by jeetee

Oh, I was asking for the ability to to copy a frame text and paste it into another frame. Today I was able to do this without problems, so I suppose I was doing something wrong yesterday.
And indeed, it would be nice if MS made those text-element changes you say.
Also, when a frame is selected, it would be nice to have the ctrl+T command insert a generic text element, instead of trying to insert staff text and failing to do so.

In reply to by jeetee

From a UX viewpoint, I think it makes sense for certain shortcuts to be context sensitive. Context sensitive interfaces reduce the number of commands required to be known to the user for a given level of productivity, and/or reduce the number of clicks or keystrokes required to carry out a given operation.

The MS user associates the command ctrl+T with adding text. When a frame is selected, the current behavior of the program renders that shortcut useless. I don't see the point in leaving it the way it is. Why assign and memorize a separate shortcut when ctrl+T would work well?

In reply to by mike320

I don't think I'm conveying the idea adequately.

When you select a note and press the UP key, the note's pitch moves one semitone up. When you select a text element and press the UP key, you don't get a message saying "please select a note and try again". Instead, another action is triggered, and the element is moved up on the page. That's a context-sensitive interface in action. The user expects different things from the same command on different contexts.

It's the same when you open a file in your explorer. You don't have a separate shortcut for every program. That would be a lot less efficient. Instead, you just double click the file, and, based on its extension, your computer decides which program to use. Again, that's context-sensitive interface.

In the same way, when I have a frame selected in MS and press ctrl+T, I don't expect staff text to be added to the frame. I already know that's impossible; as impossible as "transposing a text element up" when I press the UP key. What I expect as a user when I press ctrl+T with a frame selected, is a generic text element to be created inside the frame.

In reply to by Asmatzaile

You explained well but didn't understand me. There is no generic text in MuseScore. It all has a purpose and that includes text inside a frame. As someone said, there is a shortcut available for you to define for adding text in a frame. You cannot normally set it to ctrl+t because the program will give you an error, but someone more familiar with it can tell you how to edit the shortcuts file to add ctrl+t as the shortcut. It shouldn't cause you any problems.

In reply to by mike320

Oh, I see. So what I'm asking for is for the shortcut ctrl+T, which adds staff text to notes and silences, to change its behavior if a frame is selected and to add frame text instead. Could I edit the shortcuts file to implement this conditional behavior, or that's a thing one could only change by editing the source code?

In reply to by Asmatzaile

I don't think your first language is English and there is a slight difference in what we are saying. You don't want to just change ctrl+t to make it add frame text instead but you want to make it add frame text also. For it to do both, you must edit the shortcuts file which you can see in any text editor. This is not the same as the source code.

In reply to by mike320

Yep, you've guessed right, English is my third language. But I don't understand how I'd want to make ctrl+T add frame text also. I mean, if I have a note selected, I don't want ctrl+T to add frame text, but only staff text. On the other hand, if I have a frame selected, I don't want ctrl+T to add staff text, but only frame text.
I asked the source code thing because I was wondering if I could make the shortcuts file understand what I have selected -a frame or a note/silence- in order to apply the correct action to the shortcut.

In reply to by Asmatzaile

The reason I said it shouldn't cause any problems is that if you press ctrl+t with a note selected MuseScore should only give you staff text. If you have a frame selected (once it's defined) it should add text to the frame in the different context. In any other context you should get an error. Since I haven't tested this I won't make guarantees. If it does cause problems, the program will happily allow you to change the shortcut to nothing or something else that's not used without having to edit the shortcuts file again.

You must select a note or rest first in order for the text box to be anchored to something.

Select text-to-copy, [Ctrl]c,
Select a note or rest, [Ctrl]t, [Ctrl]v works as intended.

In reply to by underquark

One can already add text to a frame right-clicking it, hovering add and clicking "text". I don't know where the text anchors in this case, but when trying to move it, the standing pink point is at the upper left corner of the frame, so I suppose the text is anchored to the frame.
What I'm asking for is for the shortcut ctrl+T to work to do the same, as it does with notes and rests. Also, to make the process of copypasting text in frames easier. I'll update my original post to try to be clearer.

If I understand the basic gist of the discussion, it seems there is a valid request that Ctrl+T should work to add a frame text, if a frame is selected instead of a note or rest. This seems entirely logical, and in fact probably dead simple to implement. Could you submit that as a formal "Suggestion" to the issue tracker (see Support menu above)?

In reply to by Marc Sabatella

As mentioned above, it probably can’t be made to work that way, because the commands both operate in the same context: normal mode. The code that handles the add staff text command would need to be changed to check to see if a frame is selected, and call the add frame text command handler instead. It’s a little bit of hack, but nowhere near as bad as when that same basic hack is used allow the up arrow command in normal mode to either change pitch for notes or change position for text while in normal mode.

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