Fix "ambiguity" with Russian keyboard layout #26774
Open
+16
−14
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...)