| 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 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | namespace Qt3DInput { |
| 14 | |
| 15 | class QKeyboardDevicePrivate; |
| 16 | |
| 17 | class Q_3DINPUTSHARED_EXPORT QKeyboardDevice : public Qt3DInput::QAbstractPhysicalDevice |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | Q_PROPERTY(Qt3DInput::QKeyboardHandler *activeInput READ activeInput NOTIFY activeInputChanged) |
| 21 | |
| 22 | public: |
| 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 | |
| 35 | protected: |
| 36 | explicit QKeyboardDevice(QKeyboardDevicePrivate &dd, QNode *parent = nullptr); |
| 37 | |
| 38 | Q_SIGNALS: |
| 39 | void activeInputChanged(QKeyboardHandler *activeInput); |
| 40 | |
| 41 | private: |
| 42 | Q_DECLARE_PRIVATE(QKeyboardDevice) |
| 43 | void setActiveInput(QKeyboardHandler *activeInput); |
| 44 | }; |
| 45 | |
| 46 | } // namespace Qt3DInput |
| 47 | |
| 48 | QT_END_NAMESPACE |
| 49 | |
| 50 | #endif // QT3DINPUT_INPUT_QKEYBOARDDEVICE_H |
| 51 | |