-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Shortcuts
A keyboard shortcut is a series of one or several keys that invoke to perform an UI Actions (see Interact workflow)
The same keyboard shortcut can perform different actions depending on the context in which we are now, for example, one combination of Ctrl+B
performs the action add a measure if something is selected in the notation or make the text bold if we are editing text.
The general idea is that we load a list of shortcuts from a file, look for shortcuts corresponding to sequence, and depending on UI Action available ( maintly depending on current UI Context (see UI Actions )), we perform the corresponding action (or do nothing if the current UI context does not correspond to the assigned action)
We want to keep the keyboard shortcut compatible with MuseScore 3.0. So, decisions on how to implement shortcuts in MuseScore 4.0 are mainly dictated by this requirement.
The shortcuts are declared in the shortcuts.xml
file.
(for MacOS a separate file with the shortcuts-Mac.xml
and for a separate one for the shortcuts_AZERTY.xml
layout)
For example:
<SC>
<key>text-b</key>
<seq>Ctrl+b</seq>
</SC>
<SC>
<key>text-word-left</key>
<seq>Ctrl+Left</seq>
</SC>
<SC>
<key>text-word-right</key>
<seq>Ctrl+Right</seq>
</SC>
key
- action name
seq
- keyboard shortcut
These files correspond to MuseScore 3.0 unchanged.
When we press the keyboard shortcuts, the method is called: void ShortcutsController::activate(const std::string& sequence)
.
The shortcut controller getting a list of shortcuts from the shortcut registry (loaded from a file) for the given sequence. For each shortcut found, we get an UI Action to be performed. For the getted UI Actions, we get their current state (availability), if the action is available, then we dispatch the action through the action dispatcher.
Testing
- Manual testing
- Automatic testing
Translation
Compilation
- Set up developer environment
- Install Qt and Qt Creator
- Get MuseScore's source code
- Install dependencies
- Compile on the command line
- Compile in Qt Creator
Beyond compiling
Misc. development
Architecture general
- Architecture overview
- AppShell
- Modularity
- Interact workflow
- Channels and Notifications
- Settings and Configuration
- Error handling
- Launcher and Interactive
- Keyboard Navigation
Audio
Engraving
- Style settings
- Working with style files
- Style parameter changes for 4.0
- Style parameter changes for 4.1
- Style parameter changes for 4.2
- Style parameter changes for 4.3
- Style parameter changes for 4.4
Extensions
- Extensions overview
- Manifest
- Forms
- Macros
- Api
- Legacy plugin API
Google Summer of Code
References