summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2016-01-11 15:13:07 +0100
committerPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2016-01-11 15:44:23 +0000
commitb0d02b3cfd39f6a8815cc07848ca865257cd2c9f (patch)
treeab069025539259e6543c5ff9ea437e6ebf610974 /src
parentf51de354b14d5a25d7e32debe0d56b9fbed67a4f (diff)
Fix the control key
Let Ctrl+A cause a key event with text Ctrl+A (0x01), like we do on the other platforms. Previously we would use 'A', which would confuse some applications. Task-number: QTBUG-50398 Change-Id: Ie3def4bd9c96e538b2572b88fae029d347e08814 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandinputdevice.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 9ac678c93..567620ba5 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -645,6 +645,13 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
qtkey = QWaylandXkb::keysymToQtKey(sym, modifiers, text);
+
+ // Map control + letter to proper text
+ if (utf32 >= 'A' && utf32 <= '~' && (modifiers & Qt::ControlModifier)) {
+ utf32 &= ~0x60;
+ text = QString::fromUcs4(&utf32, 1);
+ }
+
QWindowSystemInterface::handleExtendedKeyEvent(window->window(),
time, type, qtkey,
modifiers,