diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-12-20 09:32:25 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-01-25 15:14:38 +0000 |
commit | 4501b9d88662e590e14dd932a43de9055cde012c (patch) | |
tree | b9259d152d4f3f089cabb6ee39cb224e37e4663b /src/core/web_event_factory.cpp | |
parent | eb5569186b126e7ffc507a14efd502fac32f7fb9 (diff) |
Fix confirming IME composition and newline insertion
Task-number: QTBUG-55766
Change-Id: I3be3b224dfef9ecc1ce39f4f20ec5c1d13c0fa69
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_event_factory.cpp')
-rw-r--r-- | src/core/web_event_factory.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 4f5023376..9681ad629 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1259,5 +1259,14 @@ content::NativeWebKeyboardEvent WebEventFactory::toWebKeyboardEvent(QKeyEvent *e const ushort* text = ev->text().utf16(); memcpy(&webKitEvent.text, text, std::min(sizeof(webKitEvent.text), size_t(ev->text().length() * 2))); memcpy(&webKitEvent.unmodifiedText, text, std::min(sizeof(webKitEvent.unmodifiedText), size_t(ev->text().length() * 2))); + + if (webKitEvent.windowsKeyCode == VK_RETURN) { + // This is the same behavior as GTK: + // We need to treat the enter key as a key press of character \r. This + // is apparently just how webkit handles it and what it expects. + webKitEvent.unmodifiedText[0] = '\r'; + webKitEvent.text[0] = webKitEvent.unmodifiedText[0]; + } + return webKitEvent; } |