summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmkeytranslator.h
blob: 11a89e619301eac595f3f2e54246cbc2b2d94fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef QWASMKEYTRANSLATOR_H
#define QWASMKEYTRANSLATOR_H

#include <QtCore/qnamespace.h>
#include <QtCore/qtypes.h>

#include <optional>

QT_BEGIN_NAMESPACE

struct KeyEvent;

namespace QWasmKeyTranslator {
std::optional<Qt::Key> mapWebKeyTextToQtKey(const char *toFind);
}

class QWasmDeadKeySupport
{
public:
    explicit QWasmDeadKeySupport();
    ~QWasmDeadKeySupport();

    void applyDeadKeyTranslations(KeyEvent *event);

private:
    Qt::Key m_activeDeadKey = Qt::Key_unknown;
    Qt::Key m_keyModifiedByDeadKeyOnPress = Qt::Key_unknown;
};

QT_END_NAMESPACE
#endif // QWASMKEYTRANSLATOR_H