on xenial help sign in
tweaks from reviewer's comments
b20a894Michael Zanetti
plugins/Utils/inputeventgenerator.h+9−1
@@ -21,13 +21,21 @@
21#include <QPointer>
21#include <QPointer>
22#include <QDateTime>
22#include <QDateTime>
23
23
24+/**
25+ * \brief This class allows injecting Key events into the scene.
26+ */
24class InputEventGenerator : public QQuickItem
27class InputEventGenerator : public QQuickItem
25{
28{
26 Q_OBJECT
29 Q_OBJECT
27public:
30public:
28 InputEventGenerator(QQuickItem *parent = 0);
31 InputEventGenerator(QQuickItem *parent = 0);
29
32
33+ /**
34+ * Generate and post and event to the scene. Note that the event will not be dispatched directly to the "receiver" but
35+ * instead to the window where the item is located. With that, the whole scene will receive the keypress and it will
36+ * be dispatched through the regular event/focus queue.
37+ */
30− Q_INVOKABLE void generateEvent(QQuickItem *receiver, Qt::Key key, bool pressed, Qt::KeyboardModifiers modifier = Qt::NoModifier, quint64 timestamp = QDateTime::currentMSecsSinceEpoch(), quint32 nativeScanCode = 0, const QString &text = QString());
38+ Q_INVOKABLE void generateEvent(QQuickItem *receiver, Qt::Key key, bool pressed, Qt::KeyboardModifiers modifiers = Qt::NoModifier, quint64 timestamp = QDateTime::currentMSecsSinceEpoch(), quint32 nativeScanCode = 0, const QString &text = QString());
31};
39};
32
40
33#endif // INPUTEVENTGENERATOR_H
41#endif // INPUTEVENTGENERATOR_H