-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "ambiguity" with Russian keyboard layout #26774
Merged
DmitryArefiev
merged 2 commits into
musescore:master
from
cbjeukendrup:shortcuts_russian
Mar 7, 2025
Merged
Fix "ambiguity" with Russian keyboard layout #26774
DmitryArefiev
merged 2 commits into
musescore:master
from
cbjeukendrup:shortcuts_russian
Mar 7, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@cbjeukendrup This should be tested on macOS only? |
Tested on macOS13.6 Cmd+X, Cmd+C, Cmd+V, Cmd+Z, Cmd+W are working fine @cbjeukendrup But Cmd+A doesn't work in PR's build using RU layout (works in master) |
Eism
approved these changes
Mar 5, 2025
Resolves: musescore#25824 When using Russian keyboard layout, and when there is a `Z` shortcut and a `Ctrl+Z` shortcut, and you press `Ctrl+Z`, we add four shortcuts: - `Z` and `Я` - `Ctrl+Z` and `Ctrl+Я` When pressing `Ctrl+Z`, Qt thinks there are two possible keys: ``` 17:42:43.971 | DEBUG | main_thread | Qt | - QKeyCombination(ControlModifier, Key(1071)) / QKeySequence("Ctrl+Я") / ⌘Я 17:42:43.971 | DEBUG | main_thread | Qt | - QKeyCombination(NoModifier, Key_Z) / QKeySequence("Z") / Z ``` (output seen after `QLoggingCategory::setFilterRules("qt.gui.shortcutmap.debug=true\nqt.qpa.keymapper.debug=true\nqt.qpa.keymapper.keys.debug=true");`) The latter, `Z` with no modifier, makes no sense to me, but whatever; Qt thinks it must be. As a result, Qt thinks the shortcuts are ambiguous: it doesn't know whether to activate `Z` or `Ctrl+Я`. The solution is to avoid adding `Z` as a shortcut; it won't be necessary anyway, as `Я` suffices. Same story goes for other single-letter shortcuts.
Addresses musescore#26774 (comment). Apparently the issue with ambiguous keys doesn't apply to the A key. It is totally unclear why. The possibility that there are other keys to which this applies too, has not been ruled out.
2c860be
to
d322c34
Compare
@DmitryArefiev I pushed an update, hopefully it works now! And yes, absolutely only macOS is affected by this PR. |
@cbjeukendrup Now all good. Thanks! Tested #25824 on Mac13.7.2 - FIXED |
Jojo-Schmitz
pushed a commit
to Jojo-Schmitz/MuseScore
that referenced
this pull request
Mar 7, 2025
Addresses musescore#26774 (comment). Apparently the issue with ambiguous keys doesn't apply to the A key. It is totally unclear why. The possibility that there are other keys to which this applies too, has not been ruled out.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #25824
When using Russian keyboard layout, and there is a
Z
shortcut and aCtrl+Z
shortcut, we add four shortcuts:Z
andЯ
Ctrl+Z
andCtrl+Я
When pressing
Ctrl+Z
, Qt thinks there are two possible keys:(output seen after
QLoggingCategory::setFilterRules("qt.gui.shortcutmap.debug=true\nqt.qpa.keymapper.debug=true\nqt.qpa.keymapper.keys.debug=true");
)The latter,
Z
with no modifier, makes no sense to me, but whatever; Qt thinks it must be.As a result, Qt thinks the shortcuts are ambiguous: it doesn't know whether to activate
Z
orCtrl+Я
.The solution is to avoid adding
Z
as a shortcut; it won't be necessary anyway, asЯ
suffices.Same story goes for other single-letter shortcuts.
Should be tested very carefully, also with other keyboard layouts than Russian (for example, what effect will it have for AZERTY users...)