summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-08-23 16:45:10 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-08-24 19:33:26 +0000
commit54765577f1b89175f8b1fae842c9ffd2c96f4943 (patch)
tree19702073f65a621d147f846534598476bb462a37
parent335052336eb0e1816f24a4f120551ee2b23ac1aa (diff)
Fix spurious chord trigger on first key press
Change-Id: If5a28e670e8eef0a9b5a75dc3451ee584f22e72c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/input/backend/inputchord.cpp1
-rw-r--r--tests/auto/input/inputchord/tst_inputchord.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/input/backend/inputchord.cpp b/src/input/backend/inputchord.cpp
index e9ce8315f..cbac127b4 100644
--- a/src/input/backend/inputchord.cpp
+++ b/src/input/backend/inputchord.cpp
@@ -66,6 +66,7 @@ void InputChord::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &c
const QInputChordData &data = typedChange->data;
m_chords = data.chordIds;
m_timeout = data.timeout;
+ m_inputsToTrigger = m_chords;
}
void InputChord::cleanup()
diff --git a/tests/auto/input/inputchord/tst_inputchord.cpp b/tests/auto/input/inputchord/tst_inputchord.cpp
index 7fa93451c..1e2dc417a 100644
--- a/tests/auto/input/inputchord/tst_inputchord.cpp
+++ b/tests/auto/input/inputchord/tst_inputchord.cpp
@@ -180,8 +180,7 @@ private Q_SLOTS:
deviceBackend->setButtonPressed(Qt::Key_Q, true);
// THEN
- QCOMPARE(backendInputChord.process(&handler, 1000000100), true); // Yes, that's a bug
- QCOMPARE(backendInputChord.process(&handler, 1000000150), false);
+ QCOMPARE(backendInputChord.process(&handler, 1000000100), false);
// WHEN
deviceBackend->setButtonPressed(Qt::Key_A, true);
@@ -261,8 +260,7 @@ private Q_SLOTS:
deviceBackend->setButtonPressed(Qt::Key_Q, true);
// THEN
- QCOMPARE(backendInputChord.process(&handler, 1000000000), true); // Yes, that's a bug
- QCOMPARE(backendInputChord.process(&handler, 1000000050), false);
+ QCOMPARE(backendInputChord.process(&handler, 1000000000), false);
// WHEN
deviceBackend->setButtonPressed(Qt::Key_W, true);