summaryrefslogtreecommitdiffstats
path: root/src/core/web_event_factory.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-27 11:25:29 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-27 11:25:29 +0100
commit01d4c6440b52f2ce26ced45b6ad193e909db44af (patch)
treeadf466a63806aa8a9c504642f17a2466a945232a /src/core/web_event_factory.cpp
parent2d8d15047fdbf046cdee9fba103587c19808d7d2 (diff)
parentdf5d831bae99662fab43ed2628187113c18aac2c (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/core/renderer_host/web_channel_ipc_transport_host.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I47f2b893bc9f27cd9df641f76badc9e53b482ad4
Diffstat (limited to 'src/core/web_event_factory.cpp')
-rw-r--r--src/core/web_event_factory.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index ba04806d5..f4940f305 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -157,8 +157,11 @@ static Qt::KeyboardModifiers qtModifiersForEvent(const QInputEvent *ev)
//
// On Linux, the Control modifier transformation is applied [1]. For example,
// pressing Ctrl+@ generates the text "\u0000". We would like "@" instead.
+// Windows also translates some control key combinations into ASCII control
+// characters [2].
//
// [1]: https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Control_Modifier
+// [2]: https://docs.microsoft.com/en-us/windows/win32/learnwin32/keyboard-input#character-messages
//
// On macOS, if the Control modifier is used, then no text is generated at all.
// We need some text.
@@ -171,8 +174,10 @@ static QString qtTextForKeyEvent(const QKeyEvent *ev, int qtKey, Qt::KeyboardMod
{
QString text = ev->text();
- if ((qtModifiers & Qt::ControlModifier) && keyboardDriver() == KeyboardDriver::Xkb)
+ if ((qtModifiers & Qt::ControlModifier) &&
+ (keyboardDriver() == KeyboardDriver::Xkb || keyboardDriver() == KeyboardDriver::Windows)) {
text.clear();
+ }
return text;
}