qt5base-lts/src
Tor Arne Vestbø 422880c9db macOS: Enable Latin key combinations when Command (⌘) modifier is pressed
When the Command key is pressed AppKit seems to do key equivalent
matching using a Latin/Roman interpretation of the current keyboard
layout.

For example, for a Greek layout, pressing Option+Command+C produces a
key event with chars="ç" and unmodchars="ψ", but AppKit still treats
this as a match for a key equivalent of Option+Command+C.

We can't do the same by just applying the modifiers to our key map,
as that too contains "ψ" for the Option+Command combination. What we
can do instead is take advantage of the fact that the Command modifier
layer in all/most keyboard layouts contains a Latin layer. We then
combine that with the modifiers of the event to produce the resulting
"Latin" key combination.

If the unmodified key is outside of Latin1, we also treat that as a
valid key combination, even if AppKit natively does not. For example,
for a Greek layout, we still want to support Option+Command+ψ as a key
combination, as it's unlikely to clash with the Latin key combination
we added above.

However, if the unmodified key is within Latin1, we skip it, to avoid
these types of conflicts. For example, in the same Greek layout, pressing
the key next to Tab will produce a Latin ';' symbol, but we've already
treated that as 'q', thanks to the Command modifier, so we skip the
potential Command+; key combination. This is also in line with what
AppKit natively does.

Fixes: QTBUG-96371
Fixes: QTBUG-79493
Task-number: QTBUG-112736
Change-Id: I30d678c1c7860642d3eed29c7757133ff74c6521
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-10-17 18:51:17 +00:00
..
3rdparty Remove 'SecurityCritical' attribute for psl-data 2023-10-04 18:36:53 +00:00
android Android: Simplify Qt for Android hierarchy, less Java reflection! 2023-10-12 19:16:47 +03:00
assets Add XDG theme file for example icons 2023-06-26 17:32:10 +00:00
concurrent Doc: Fix warnings and linking issues 2023-10-09 17:24:07 +00:00
corelib JNI: fix error float argument to 'va_arg' is promotable 2023-10-17 21:51:16 +03:00
dbus Doc: Add missing return type to QDBusReply::value 2023-10-13 18:00:37 +02:00
entrypoint src: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-10 23:36:51 +01:00
gui macOS: Enable Latin key combinations when Command (⌘) modifier is pressed 2023-10-17 18:51:17 +00:00
network http2: When a reply is removed from the queue, only remove one 2023-10-16 19:28:26 +02:00
opengl Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
openglwidgets QOpenGLWidget: Call glClear in the default paintGL implementation 2023-09-04 11:46:29 +02:00
platformsupport Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
plugins QNetworkInfo[NetworkManager]: Avoid creating temporary QStrings 2023-10-16 17:41:21 +02:00
printsupport Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
sql QSqlDatabase: check if QCoreApplication::instance() exists 2023-10-12 06:16:46 +02:00
testlib SignalDumper: fix UB (data race on ignoreLevel) 2023-10-17 18:51:16 +00:00
tools windeployqt: Don't copy files from unneeded QML modules 2023-10-10 13:19:34 +02:00
widgets Fusion style/QProgressBar: fix High-DPI issues 2023-10-13 18:23:44 +02:00
xml Doc: Fix warnings and linking issues 2023-10-09 17:24:07 +00:00
CMakeLists.txt Add Qt icon library for examples 2023-04-22 18:14:38 +03:00