summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmscreen.cpp
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-01-24 10:18:34 +0100
committerMikolaj Boc <mikolaj.boc@qt.io>2023-02-07 18:59:59 +0100
commitd141d6894960dba7c62d67400a31a49a4abcdb08 (patch)
tree8711444671b98ec1f0d889dc9cfc9c0ef013efc3 /src/plugins/platforms/wasm/qwasmscreen.cpp
parent62be4ab5be41b09eea16e5675ed4a74c795e58d9 (diff)
Transfer the key handling logic to QWasmWindow
Also, use the embind approach as the rest of the events do, and introduce a KeyEvent class which simplifies and streamlines event support. The event translator has been given a more specific function of just handling the dead keys. Rest of the translation functionality is coded directly in KeyEvent for more encapsulation. Change-Id: I11b0262fc42fe920206ecc6de0d434b9d9ab9998 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp
index add4806e44a..cc7c0c43f01 100644
--- a/src/plugins/platforms/wasm/qwasmscreen.cpp
+++ b/src/plugins/platforms/wasm/qwasmscreen.cpp
@@ -2,11 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwasmscreen.h"
-#include "qwasmwindow.h"
-#include "qwasmeventtranslator.h"
+
#include "qwasmcompositor.h"
-#include "qwasmintegration.h"
#include "qwasmcssstyle.h"
+#include "qwasmintegration.h"
+#include "qwasmkeytranslator.h"
+#include "qwasmwindow.h"
#include <emscripten/bind.h>
#include <emscripten/val.h>
@@ -29,7 +30,7 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas)
: m_container(containerOrCanvas),
m_shadowContainer(emscripten::val::undefined()),
m_compositor(new QWasmCompositor(this)),
- m_eventTranslator(new QWasmEventTranslator())
+ m_deadKeySupport(std::make_unique<QWasmDeadKeySupport>())
{
auto document = m_container["ownerDocument"];
// Each screen is represented by a div container. All of the windows exist therein as
@@ -111,11 +112,6 @@ QWasmCompositor *QWasmScreen::compositor()
return m_compositor.get();
}
-QWasmEventTranslator *QWasmScreen::eventTranslator()
-{
- return m_eventTranslator.get();
-}
-
emscripten::val QWasmScreen::element() const
{
return m_shadowContainer;