summary refs log tree commit diff
path: root/tests/test_common/test_fixture.cpp
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
committerNick Brassel <nick@tzarc.org>2022-08-28 14:23:01 +1000
commit0a3f7e48690bb2b7b008300a54554979a55be19a (patch)
tree7499d52f20040ed7d5a56496ecb81ed114f80719 /tests/test_common/test_fixture.cpp
parentfc0bf67f372c38f72c303cdec21b1d4afb5e8cb4 (diff)
parent9b5b0722555891ba94f240760ef3a6d4c870fd13 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'tests/test_common/test_fixture.cpp')
-rw-r--r--tests/test_common/test_fixture.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_common/test_fixture.cpp b/tests/test_common/test_fixture.cpp
index 5fc6964054..44694cd390 100644
--- a/tests/test_common/test_fixture.cpp
+++ b/tests/test_common/test_fixture.cpp
@@ -108,6 +108,22 @@ void TestFixture::tap_key(KeymapKey key, unsigned delay_ms) {
     run_one_scan_loop();
 }
 
+void TestFixture::tap_combo(const std::vector<KeymapKey>& chord_keys, unsigned delay_ms) {
+    for (KeymapKey key : chord_keys) { // Press each key.
+        key.press();
+        run_one_scan_loop();
+    }
+
+    if (delay_ms > 1) {
+        idle_for(delay_ms - 1);
+    }
+
+    for (KeymapKey key : chord_keys) { // Release each key.
+        key.release();
+        run_one_scan_loop();
+    }
+}
+
 void TestFixture::set_keymap(std::initializer_list<KeymapKey> keys) {
     this->keymap.clear();
     for (auto& key : keys) {