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.
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
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.