aboutsummaryrefslogtreecommitdiffstats
path: root/tests/repeat_key/test_repeat_key.cpp
diff options
context:
space:
mode:
authorNick Brassel2025-05-26 13:41:49 +0200
committerNick Brassel2025-05-26 13:41:49 +0200
commit75a037d2f0f9c54bad8e2f68ae82134559c92f22 (patch)
tree2b264de0e7a724c30cca511a9bac7ad29705d1a2 /tests/repeat_key/test_repeat_key.cpp
parent28720c4d343a9c5e9f5a62dbd583dbf536a2e61e (diff)
parent3703699757b6ce938ff412aca0a8b064927c0cdb (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'tests/repeat_key/test_repeat_key.cpp')
-rw-r--r--tests/repeat_key/test_repeat_key.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/repeat_key/test_repeat_key.cpp b/tests/repeat_key/test_repeat_key.cpp
index eee44fc104..ed5d618761 100644
--- a/tests/repeat_key/test_repeat_key.cpp
+++ b/tests/repeat_key/test_repeat_key.cpp
@@ -751,4 +751,37 @@ TEST_F(RepeatKey, RepeatKeyInvoke) {
testing::Mock::VerifyAndClearExpectations(&driver);
}
+// Check that mods and Layer Lock are not remembered.
+TEST_F(RepeatKey, IgnoredKeys) {
+ TestDriver driver;
+ KeymapKey regular_key(0, 0, 0, KC_A);
+ KeymapKey key_repeat(0, 1, 0, QK_REP);
+ KeymapKey key_lsft(0, 2, 0, KC_LSFT);
+ KeymapKey key_lctl(0, 3, 0, KC_LCTL);
+ KeymapKey key_llck(0, 4, 0, QK_LAYER_LOCK);
+ set_keymap({regular_key, key_repeat, key_lsft, key_lctl, key_llck});
+
+ // Allow any number of empty reports.
+ EXPECT_EMPTY_REPORT(driver).Times(AnyNumber());
+ {
+ InSequence seq;
+ EXPECT_REPORT(driver, (KC_A));
+ EXPECT_REPORT(driver, (KC_LSFT));
+ EXPECT_REPORT(driver, (KC_LCTL));
+ EXPECT_REPORT(driver, (KC_A));
+ EXPECT_REPORT(driver, (KC_A));
+ }
+
+ tap_key(regular_key); // Taps the KC_A key.
+
+ // Tap Shift, Ctrl, and Layer Lock keys, which should not be remembered.
+ tap_keys(key_lsft, key_lctl, key_llck);
+ EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A);
+
+ // Tapping the Repeat Key should still reproduce KC_A.
+ tap_keys(key_repeat, key_repeat);
+
+ testing::Mock::VerifyAndClearExpectations(&driver);
+}
+
} // namespace