fixed #24177: Shortcuts , and . make a < and > instead
Resolves: #24177
The main idea of this PR is to transfer the dialog for editing shortcuts from character-based to key combinations. Now, whenever we enter a shortcut, we translate the entered combination to key combinations, map it to the English layout, and write it to a file. Then, when opening the app, we translate the combination to the current layout. After this, only English characters will remain in the shortcut files.
https://github.com/user-attachments/assets/1e056311-e185-4597-b253-524148bdd6de
When I set Alt+@ (Alt+Shift+2) as a keyboard shortcut, and then press it, I get an assertion failure:
In
ShortcutsController::resolveAction, sequence is empty; in ShortcutsInstanceModel::doActivate, m_shortcutMap only contains "Alt+Shift+2", while seq is "Shift+Alt+2".
Apart from that, there is one problem that this PR probably doesn't solve and that https://github.com/musescore/MuseScore/pull/25126 maybe does solve: not all keyboard layouts contain all keys. For example, an AZERTY keyboard has no . key, so Shift+. means nothing on such keyboard. Or, another example: on AZERTY, : is its own key, namely the same key as . would be on QWERTY. When you try to use : as a shortcut key, that gets now recorded as .. But . cannot be translated back to AZERTY, so you can't use the just-created keyboard shortcut.
@cbjeukendrup thank you for testing! fixed the crash
Is there a problem with AZERTY in the master?
@Eism I checked:
- setting
:as a custom shortcut with AZERTY works well in master - the default shortcuts
Shift+,andShift+.don't work with AZERTY in master
Rebase needed.
See also #27953
See also https://musescore.org/en/node/337994