From d76e1d9cbdd62912e5129d2736da8e1ca80db2e4 Mon Sep 17 00:00:00 2001 From: Andrey Butirsky Date: Thu, 30 Mar 2023 11:07:04 +0000 Subject: qxkbcommon: Amend comment for Qt::Key upper-case transformation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should make it clear enough that the issue here is a quirk of Qt::Key and not something otherwise special about case-change affecting whether a character is in Latin-1 (for all that this is the root cause of the quirk in Qt::Key). Pick-to: 6.5 Change-Id: I80fa6b78a0d0c431401a3fea18edf6149de08b92 Reviewed-by: Andrey Butirsky Reviewed-by: Edward Welbourne Reviewed-by: Tor Arne Vestbø --- src/gui/platform/unix/qxkbcommon.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/platform') diff --git a/src/gui/platform/unix/qxkbcommon.cpp b/src/gui/platform/unix/qxkbcommon.cpp index cbc40ff118..d254aeecdc 100644 --- a/src/gui/platform/unix/qxkbcommon.cpp +++ b/src/gui/platform/unix/qxkbcommon.cpp @@ -510,13 +510,13 @@ static int keysymToQtKey_internal(xkb_keysym_t keysym, Qt::KeyboardModifiers mod // numeric keypad keys qtKey = Qt::Key_0 + (keysym - XKB_KEY_KP_0); } else if (QXkbCommon::isLatin1(keysym)) { - // Upper-case first, since Qt::Keys are defined in terms of their - // upper-case versions. + // Most Qt::Key values are determined by their upper-case version, + // where this is in the Latin-1 repertoire. So start with that: qtKey = QXkbCommon::qxkbcommon_xkb_keysym_to_upper(keysym); - // Upper-casing a Latin1 character might move it out of Latin1 range, - // for example U+00B5 MICRO SIGN, which upper-case equivalent is - // U+039C GREEK CAPITAL LETTER MU. If that's the case, then map the - // original lower-case character. + // However, Key_mu and Key_ydiaeresis are U+00B5 MICRO SIGN and + // U+00FF LATIN SMALL LETTER Y WITH DIAERESIS, both lower-case, + // with upper-case forms outside Latin-1, so use them as they are + // since they're the Qt::Key values. if (!QXkbCommon::isLatin1(qtKey)) qtKey = keysym; } else { -- cgit v1.2.3