Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbjeukendrup
Copy link
Contributor

@cbjeukendrup cbjeukendrup commented Feb 26, 2025

Resolves: #25824

When using Russian keyboard layout, and there is a Z shortcut and a Ctrl+Z shortcut, 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.

Should be tested very carefully, also with other keyboard layouts than Russian (for example, what effect will it have for AZERTY users...)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System shortcuts (Cmd+X, Cmd+C, Cmd+V, Cmd+Z etc.) don't work when non-qwerty input (RU) enabled on macOS
2 participants