MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
Following discussions in PR #24958, it would be useful to know how Qt is reporting keypresses on each platform. (Perhaps we should add a keylogger to the Diagnostic menu?)
For now, this PR just prints keys on the console. Download the artifact and run it on the command line to see how Qt reports keys on your system. On Windows it might be necessary to run it in Qt Creator or another debugger/IDE to see the console output.
Results with UK QWERTY PC keyboard on Windows
On this keyboard, + is entered with Shift=, thus combinations involving Shift= are conceptually using +.
On this platform, Qt's portable key names are equivalent to the native key names (at least in English).
Reasonable people can disagree over whether it's better to show physical or conceptual keys in Preferences > Shortcuts. The real question is, which of those things (physical or conceptual) can we reliably determine based on the information Qt is reporting?
With this particular OS (Windows), keyboard layout (UK QWERTY PC), and key (=), it seems that dropping Shift from Qt's reported keys does give a reasonable approximation of the conceptual keys (but we know that's not the case for all keys).
There doesn't seem to be a straightforward way to determine the physical keys pressed. It might be possible using native methods as demonstrated here. However, the output of these methods is platform-specific.
Following discussions in PR #24958, it would be useful to know how Qt is reporting keypresses on each platform. (Perhaps we should add a keylogger to the Diagnostic menu?)
For now, this PR just prints keys on the console. Download the artifact and run it on the command line to see how Qt reports keys on your system. On Windows it might be necessary to run it in Qt Creator or another debugger/IDE to see the console output.
Results with UK QWERTY PC keyboard on Windows
On this keyboard,
+
is entered with Shift =, thus combinations involving Shift = are conceptually using +.On this platform, Qt's portable key names are equivalent to the native key names (at least in English).
=
=
Alt+=
=
Ctrl+=
=
Alt+=
Dialogs:
Ctrl+Alt+=
=
Shift++
+
Alt+Shift++
+
Ctrl+Shift++
=
Ctrl+Alt+Shift++
=
Markdown
```Markdown Physical keys pressed | Conceptual keys | Qt portable/native keys | Qt text ---:|---:|---:|---: Ctrl Alt = | Ctrl Alt = | ⚠️ Main window: `Alt+=`Dialogs: `Ctrl+Alt+=` | `=` ```
Reasonable people can disagree over whether it's better to show physical or conceptual keys in Preferences > Shortcuts. The real question is, which of those things (physical or conceptual) can we reliably determine based on the information Qt is reporting?
With this particular OS (Windows), keyboard layout (UK QWERTY PC), and key (=), it seems that dropping Shift from Qt's reported keys does give a reasonable approximation of the conceptual keys (but we know that's not the case for all keys).
There doesn't seem to be a straightforward way to determine the physical keys pressed. It might be possible using native methods as demonstrated here. However, the output of these methods is platform-specific.