summaryrefslogtreecommitdiffstats
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-12 09:51:45 +0000
commit669379248f485b7f133e7396759f790851c638f2 (patch)
tree4f074c7a035d384df0744ccfcb32931b79bc3d9f
parent3698b116a1973146b76319673cdb6787f13f2de6 (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> (cherry picked from commit b0d02b3cfd39f6a8815cc07848ca865257cd2c9f)
-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,