From 669379248f485b7f133e7396759f790851c638f2 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 11 Jan 2016 15:13:07 +0100 Subject: 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 (cherry picked from commit b0d02b3cfd39f6a8815cc07848ca865257cd2c9f) --- src/client/qwaylandinputdevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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, -- cgit v1.2.3