summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/platform/unix/qxkbcommon.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/platform/unix/qxkbcommon.cpp b/src/gui/platform/unix/qxkbcommon.cpp
index 3db84097c7..f53864cba1 100644
--- a/src/gui/platform/unix/qxkbcommon.cpp
+++ b/src/gui/platform/unix/qxkbcommon.cpp
@@ -545,7 +545,15 @@ 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.
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.
+ if (!QXkbCommon::isLatin1(qtKey))
+ qtKey = keysym;
} else {
// check if we have a direct mapping
xkb2qt_t searchKey{keysym, 0};