qxkbcommon: Amend comment for Qt::Key upper-case transformation
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 <butirsky@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
298c950912
commit
d76e1d9cbd
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user