summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-07-09 13:15:20 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-08-20 12:59:56 +0200
commit70473e7d3b7820ba171ee67bc0098906a2a59fe4 (patch)
tree71fb52630a732b58250fccfef1513ca1f17c2117 /src/shared
parent28c852df3825be05bea9e3d17475c73c409ee534 (diff)
Handle Key_Return explicitly instead of depending on the text
When Key_Return is sent from Qt VirtualKeyboard it will send it as \n and not \r which means it will be interpreted as an unknown key. So since we know it will be able to map it in this case, we explicitly account for it so it can be mapped to the right key. Change-Id: Id5d8d9653e78975203f80790b7a3d332f0e011fa Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/qwaylandxkb.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/qwaylandxkb.cpp b/src/shared/qwaylandxkb.cpp
index 3cfc4b074..2dff8a5b1 100644
--- a/src/shared/qwaylandxkb.cpp
+++ b/src/shared/qwaylandxkb.cpp
@@ -376,7 +376,7 @@ QVector<xkb_keysym_t> QWaylandXkb::toKeysym(QKeyEvent *event)
keysyms.append(XKB_KEY_KP_0 + (event->key() - Qt::Key_0));
else
keysyms.append(toKeysymFromTable(event->key()));
- } else if (!event->text().isEmpty()) {
+ } else if (!event->text().isEmpty() && event->key() != Qt::Key_Return) {
// From libxkbcommon keysym-utf.c:
// "We allow to represent any UCS character in the range U-00000000 to
// U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff."