From 3ecd61aea90cc4b283ffe9409cc10f5fd3476ecf Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Wed, 5 Oct 2016 17:49:12 +0200
Subject: [PATCH] Generate domKey for printable characters

This fixes the key event when spacebar is pressed (for example above a
checkbox).

Task-number: QTBUG-56283
Change-Id: I76bcc9a66abcef3a9e5ac10cfa53d60fce4c9179
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/web_event_factory.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index e4525ef94..4f5023376 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -647,6 +647,9 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
  */
 static ui::DomKey getDomKeyFromQKeyEvent(QKeyEvent *ev)
 {
+    if (!ev->text().isEmpty())
+        return ui::DomKey::FromCharacter(ev->text().toUcs4().first());
+
     switch (ev->key()) {
     case Qt::Key_Backspace:
         return ui::DomKey::BACKSPACE;
-- 
GitLab