on xenial help sign in
tweaks from reviewer's comments
commitb20a8944725e00f1e17970e21d88d949005d4034 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 13 Jan 2016, 19:22 (11 years ago) parent059d671
1 file changed+9−1
plugins/Utils/inputeventgenerator.h+9−1
plugins/Utils/inputeventgenerator.h+9−1
@@ -21,13 +21,21 @@
2121#include <QPointer>
2222#include <QDateTime>
2323
24+/**
25+ * \brief This class allows injecting Key events into the scene.
26+ */
2427class InputEventGenerator : public QQuickItem
2528{
2629 Q_OBJECT
2730public:
2831 InputEventGenerator(QQuickItem *parent = 0);
2932
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());
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+ */
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());
3139};
3240
3341#endif // INPUTEVENTGENERATOR_H