diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-01-24 10:18:34 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-02-07 18:59:59 +0100 |
commit | d141d6894960dba7c62d67400a31a49a4abcdb08 (patch) | |
tree | 8711444671b98ec1f0d889dc9cfc9c0ef013efc3 /src/plugins/platforms/wasm/qwasmeventtranslator.h | |
parent | 62be4ab5be41b09eea16e5675ed4a74c795e58d9 (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/qwasmeventtranslator.h')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmeventtranslator.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.h b/src/plugins/platforms/wasm/qwasmeventtranslator.h deleted file mode 100644 index 23299c294f..0000000000 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#ifndef QWASMEVENTTRANSLATOR_H -#define QWASMEVENTTRANSLATOR_H - -#include <QtCore/qobject.h> -#include <QtCore/qrect.h> -#include <QtCore/qpoint.h> -#include <emscripten/html5.h> -#include "qwasmwindow.h" -#include <QtGui/qinputdevice.h> -#include <QHash> -#include <QCursor> -#include "qwasmevent.h" -#include "qwasmplatform.h" - -QT_BEGIN_NAMESPACE - -class QWindow; - -class QWasmEventTranslator : public QObject -{ - Q_OBJECT - -public: - struct TranslatedEvent - { - QEvent::Type type; - Qt::Key key; - QString text; - }; - explicit QWasmEventTranslator(); - ~QWasmEventTranslator(); - - TranslatedEvent translateKeyEvent(int emEventType, const EmscriptenKeyboardEvent *keyEvent); - -private: - static quint64 getTimestamp(); - - Qt::Key m_emDeadKey = Qt::Key_unknown; - Qt::Key m_keyModifiedByDeadKeyOnPress = Qt::Key_unknown; -}; - -QT_END_NAMESPACE -#endif // QWASMEVENTTRANSLATOR_H |