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_QKEYBOARDHANDLER_H
5#define QT3DINPUT_INPUT_QKEYBOARDHANDLER_H
6
7#include <Qt3DInput/qt3dinput_global.h>
8#include <Qt3DInput/qkeyevent.h>
9#include <Qt3DCore/qcomponent.h>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DInput {
14
15class QKeyboardDevice;
16class QKeyboardHandlerPrivate;
17
18class Q_3DINPUTSHARED_EXPORT QKeyboardHandler : public Qt3DCore::QComponent
19{
20 Q_OBJECT
21 Q_PROPERTY(Qt3DInput::QKeyboardDevice *sourceDevice READ sourceDevice WRITE setSourceDevice NOTIFY sourceDeviceChanged)
22 Q_PROPERTY(bool focus READ focus WRITE setFocus NOTIFY focusChanged)
23 Q_MOC_INCLUDE("Qt3DInput/qkeyboarddevice.h")
24public:
25 explicit QKeyboardHandler(QNode *parent = nullptr);
26 ~QKeyboardHandler();
27
28 Qt3DInput::QKeyboardDevice *sourceDevice() const;
29 bool focus() const;
30
31public Q_SLOTS:
32 void setSourceDevice(Qt3DInput::QKeyboardDevice *keyboardDevice);
33 void setFocus(bool focus);
34
35Q_SIGNALS:
36 void sourceDeviceChanged(QKeyboardDevice *keyboardDevice);
37 void focusChanged(bool focus);
38
39 void digit0Pressed(Qt3DInput::QKeyEvent *event);
40 void digit1Pressed(Qt3DInput::QKeyEvent *event);
41 void digit2Pressed(Qt3DInput::QKeyEvent *event);
42 void digit3Pressed(Qt3DInput::QKeyEvent *event);
43 void digit4Pressed(Qt3DInput::QKeyEvent *event);
44 void digit5Pressed(Qt3DInput::QKeyEvent *event);
45 void digit6Pressed(Qt3DInput::QKeyEvent *event);
46 void digit7Pressed(Qt3DInput::QKeyEvent *event);
47 void digit8Pressed(Qt3DInput::QKeyEvent *event);
48 void digit9Pressed(Qt3DInput::QKeyEvent *event);
49
50 void leftPressed(Qt3DInput::QKeyEvent *event);
51 void rightPressed(Qt3DInput::QKeyEvent *event);
52 void upPressed(Qt3DInput::QKeyEvent *event);
53 void downPressed(Qt3DInput::QKeyEvent *event);
54 void tabPressed(Qt3DInput::QKeyEvent *event);
55 void backtabPressed(Qt3DInput::QKeyEvent *event);
56
57 void asteriskPressed(Qt3DInput::QKeyEvent *event);
58 void numberSignPressed(Qt3DInput::QKeyEvent *event);
59 void escapePressed(Qt3DInput::QKeyEvent *event);
60 void returnPressed(Qt3DInput::QKeyEvent *event);
61 void enterPressed(Qt3DInput::QKeyEvent *event);
62 void deletePressed(Qt3DInput::QKeyEvent *event);
63 void spacePressed(Qt3DInput::QKeyEvent *event);
64 void backPressed(Qt3DInput::QKeyEvent *event);
65 void cancelPressed(Qt3DInput::QKeyEvent *event);
66 void selectPressed(Qt3DInput::QKeyEvent *event);
67 void yesPressed(Qt3DInput::QKeyEvent *event);
68 void noPressed(Qt3DInput::QKeyEvent *event);
69 void context1Pressed(Qt3DInput::QKeyEvent *event);
70 void context2Pressed(Qt3DInput::QKeyEvent *event);
71 void context3Pressed(Qt3DInput::QKeyEvent *event);
72 void context4Pressed(Qt3DInput::QKeyEvent *event);
73 void callPressed(Qt3DInput::QKeyEvent *event);
74 void hangupPressed(Qt3DInput::QKeyEvent *event);
75 void flipPressed(Qt3DInput::QKeyEvent *event);
76 void menuPressed(Qt3DInput::QKeyEvent *event);
77 void volumeUpPressed(Qt3DInput::QKeyEvent *event);
78 void volumeDownPressed(Qt3DInput::QKeyEvent *event);
79
80 void pressed(Qt3DInput::QKeyEvent *event);
81 void released(Qt3DInput::QKeyEvent *event);
82
83private:
84 Q_DECLARE_PRIVATE(QKeyboardHandler)
85};
86
87} // namespace Qt3DInput
88
89QT_END_NAMESPACE
90
91#endif // QT3DINPUT_INPUT_QKEYBOARDHANDLER_H
92

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