1// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DINPUT_INPUT_INPUTCHORD_H
5#define QT3DINPUT_INPUT_INPUTCHORD_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DCore/qnodeid.h>
19
20#include <Qt3DInput/private/abstractactioninput_p.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace Qt3DInput {
25
26namespace Input {
27
28class Q_AUTOTEST_EXPORT InputChord : public AbstractActionInput
29{
30public:
31 InputChord();
32 void cleanup();
33
34 inline QList<Qt3DCore::QNodeId> chords() const { return m_chords; }
35 inline qint64 timeout() const { return m_timeout; }
36 inline qint64 startTime() const { return m_startTime; }
37 void setStartTime(qint64 time);
38 void reset();
39 bool actionTriggered(Qt3DCore::QNodeId input);
40 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
41
42 bool process(InputHandler *inputHandler, qint64 currentTime) override;
43
44private:
45 QList<Qt3DCore::QNodeId> m_chords;
46 QList<Qt3DCore::QNodeId> m_inputsToTrigger;
47 qint64 m_timeout;
48 qint64 m_startTime;
49};
50
51} // namespace Input
52
53} // namespace Qt3DInput
54
55QT_END_NAMESPACE
56
57#endif // QT3DINPUT_INPUT_INPUTCHORD_H
58

source code of qt3d/src/input/backend/inputchord_p.h