1// Copyright (C) 2014 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_QKEYBOARDDEVICE_H
5#define QT3DINPUT_INPUT_QKEYBOARDDEVICE_H
6
7#include <Qt3DInput/qkeyboardhandler.h>
8#include <Qt3DInput/qt3dinput_global.h>
9#include <Qt3DInput/qabstractphysicaldevice.h>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DInput {
14
15class QKeyboardDevicePrivate;
16
17class Q_3DINPUTSHARED_EXPORT QKeyboardDevice : public Qt3DInput::QAbstractPhysicalDevice
18{
19 Q_OBJECT
20 Q_PROPERTY(Qt3DInput::QKeyboardHandler *activeInput READ activeInput NOTIFY activeInputChanged)
21
22public:
23 explicit QKeyboardDevice(QNode *parent = nullptr);
24 ~QKeyboardDevice();
25
26 QKeyboardHandler *activeInput() const;
27
28 int axisCount() const final;
29 int buttonCount() const final;
30 QStringList axisNames() const final;
31 QStringList buttonNames() const final;
32 int axisIdentifier(const QString &name) const final;
33 int buttonIdentifier(const QString &name) const final;
34
35protected:
36 explicit QKeyboardDevice(QKeyboardDevicePrivate &dd, QNode *parent = nullptr);
37
38Q_SIGNALS:
39 void activeInputChanged(QKeyboardHandler *activeInput);
40
41private:
42 Q_DECLARE_PRIVATE(QKeyboardDevice)
43 void setActiveInput(QKeyboardHandler *activeInput);
44};
45
46} // namespace Qt3DInput
47
48QT_END_NAMESPACE
49
50#endif // QT3DINPUT_INPUT_QKEYBOARDDEVICE_H
51

source code of qt3d/src/input/frontend/qkeyboarddevice.h