[Mac OS X] Insert measure keyboard shortcut doesn't exist

• Feb 12, 2015 - 03:34
S5 - Suggestion

There are two issues I'd like to highlight here. One is that, as described at http://musescore.org/en/node/36106#insert, some operations make use of an Ins key. Trouble is, as far as Mac users are concerned, there is no such thing. Interestingly, the Add menu avoids the issue by not giving any shortcut (see first attached screenshot), but in the Preferences it says that that shortcut is assigned to the Ins key (see second screenshot).

Based on the use of the letter B for Append operations (Cmd+B for "Append One Measure" and Shift+Option+B for "Append Measures…"), I changed to Ctrl+B and Shift+Ctrl-B for Insert operations. The problem is that the documentation would get confused because PC keyboards use Ctrl in the same place as Macs use Cmd, so I'm not recommending this, just saying it's what I decided on for my own use. (Then again, I got by just fine without any shortcut at all for years with earlier versions of MuseScore.)

The second issue is the matter of the function keys. MuseScore 1.3 doesn't rely on them; why does 2.0 have to? (Don't answer that. I know: you want to have a shortcut for everything to improve accessibility, and you were running out of keys.) The fact is that on the Mac keyboard all the function keys except F5 and F6 are permanently assigned to specific system-wide actions. You can see in this picture of a Mac keyboard by the little icons on the function keys what those system-wide actions are.

I know with all these things you want to have shortcuts for, it must be insanely frustrating to be told that you can't use a whole set of keys. I do have some suggestions for better shortcuts, if anyone is interested.

Attachment Size
Add menu.png 43.13 KB
Shortcuts.png 25.68 KB


I would suggest M for Mixer and Cmd+Option+P for Play Panel, as before;

Cmd+Option+N for Navigator, as before (tentatively—this would mean displacing or sharing the odd new shortcut for "Add Tenuto");

Option+P for Palette and Shift+Option+P for Master Palette;

And, above all, Cmd+I for Inspector and Shift+Cmd+N for Start Center. F6 for Selection Filter, naturally, works fine.

The impossibly difficult task, though, is getting a unified set of shortcuts for all keyboard setups, which I assume is desirable for purposes of documentation. I don't know what to suggest about that.

Title [Mac OS X] Keyboard shurtcuts that don't exist/are already used by system [Mac OS X] Keyboard shortcuts that don't exist/are already used by system

It should be noted that, for the primary issue (the function keys), I discovered that they work if prefaced with [fn] (e.g., [fn]+[F10] to display the Mixer), and most of the Handbook has since been updated to reflect this.

The main differences in Mac OS X and PC keyboards are as follows.
1/ Mac OS X has placed the Option key (labeled option/ ⌥) in the place where lies the “alt” key in PC keyboards.
2/ Mac OS X has placed the Command key (labeled “⌘” or “cmd”) in the place where lies the windows logo key in PC keyboards. Under Mac, the Command key is used as a modifier key to invoke shortcuts. It is similar to MS Window's use of the Ctrl key.

In museScore keyboard shortcuts, Ctrl key in PC keyboard shortcuts has been replaced with the Command key in the corresponding Mac keyboard shortcuts with the exception of few situations.
E.g: For system text entry both PC and Mac shortcuts use the same set of keys, Ctrl+Shift+T.

Therefore, most of the time the Ctrl key in Mac remains unused and available for new shortcuts. Hence in situations where we need to create additional shortcuts for Mac keyboards due to missing keys like the “ins” key in PC keyboards, we can use the Ctrl key in Mac.
E.g : For insert operation we can use Ctrl+I

We can decide on the set of shortcuts to be used by checking for the operating system. This can be done in qt. In Qt the following OS macros are defined for compile time options
// pre Qt5 Qt/X11 = Q_WS_X11 is defined.
Qt/Windows = Q_WS_WIN is defined.
Qt/Mac OS X = Q_WS_MACX is defined
// For Qt5 onwards Qt/X11 = Q_OS_X11 is defined.
Qt/Windows = Q_OS_WIN is defined.
Qt/Mac OS X = Q_OS_MACX is defined

We can access these and gain the operating system at compile time using #ifdef.

As per the second issue mentioned, some Mac keyboards and shortcuts use special keys in the top row, which include icons for volume, display brightness, and other functions. In that case when the icon key alone is pressed it will be a call for the corresponding function. But by pressing it with the Fn key allows to use it as an F1, F2, F3, or other standard function key. As it is already been commented, this is present in the MuseScore handbook.

For system text entry both PC and Mac shortcuts use the same set of keys, Ctrl+Shift+T.
Actually, the shortcut for System Text on Mac is Cmd+Shift+T. The ctrl <==> cmd thing is handle by Qt, not by MuseScore.

Therefore, most of the time the Ctrl key in Mac remains unused and available for new shortcuts
Nope. See https://developer.apple.com/library/mac/documentation/UserExperience/Co…

"As much as possible, avoid using the Control key. Because the Control key is already used by some of the universal access features—as well as in Cocoa text fields where Emacs-style key bindings are often used—it should be used as a modifier key only when necessary."

A lot of the original bug report was based on ignorance on my part. It was mostly about my mistaken belief that using the function keys meant those shortcuts wouldn't work (I also mistakenly believed [F5] and [F6] were exceptions—on backlit keyboards, they control the keyboards' brightness). The only thing I'm aware of that's still missing is the Insert Measure shortcut.

As a side note, @WASam, do you think that might be relevant for #59986: [Mac] Ctrl+Tab to switch between scores does not work?

Title [Mac OS X] Keyboard shortcuts that don't exist/are already used by system [Mac OS X] Insert measure keyboard shortcut doesn't exist

Is it really the case there is no Insert command on your Mac? Fn+Return, or Cmd++ or something like that? On my Chromebook, which also lacks a dedicated insert key, it is Search+".". A brief Google search suggeasts that different models of Macs have different shortcuts for insert, but as far as I can tell they all have it.

No, there is no insert key on mac, and there is no insert/edit mode, insert mode is always on. If Windows is running on a mac via bootcamp, and an external keyboard is used, it seems that Fn + Return acts as the insert key.

Most of the difference between mac and windows (Ctrl <-> Cmd) are handled by Qt and not by us. (Notable exception are all the features that doesn't rely on shortcuts.xml like Alt+Space for space in lyrics). We don't currently have a way to load a different default shortcuts.xml for different OS or locale, so it's not possible to assign Fn + Return as default until this is solved. Thus http://musescore.org/en/developers-handbook/google-summer-code/ideas-20… which involve coding the loading of shortcuts.xml depending on language/OS, provide good defaults depending on OS/language and eventually, make sure that as many things are governed by shortcuts.xml and not adhoc implementation (see keyb.cpp)