From 54765577f1b89175f8b1fae842c9ffd2c96f4943 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 23 Aug 2016 16:45:10 +0200 Subject: Fix spurious chord trigger on first key press Change-Id: If5a28e670e8eef0a9b5a75dc3451ee584f22e72c Reviewed-by: Sean Harmer --- src/input/backend/inputchord.cpp | 1 + tests/auto/input/inputchord/tst_inputchord.cpp | 6 ++---- 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); -- cgit v1.2.3