summaryrefslogtreecommitdiff
path: root/tests/repeat_key/test_repeat_key.cpp
diff options
context:
space:
mode:
authorPascal Getreuer <50221757+getreuer@users.noreply.github.com>2025-04-19 11:57:00 -0700
committerGitHub <noreply@github.com>2025-04-19 11:57:00 -0700
commitea85ace4a90baca401e49f35365a6a8f7d3802c4 (patch)
tree298d2c9e79e57d4664e5d30fde499ee215075669 /tests/repeat_key/test_repeat_key.cpp
parent88453acc6aa4c92fdcc90f706987114cc4b9a237 (diff)
Ignore the Layer Lock key in Repeat Key and Caps Word. (#25171)
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) {
751 testing::Mock::VerifyAndClearExpectations(&driver); 751 testing::Mock::VerifyAndClearExpectations(&driver);
752} 752}
753 753
754// Check that mods and Layer Lock are not remembered.
755TEST_F(RepeatKey, IgnoredKeys) {
756 TestDriver driver;
757 KeymapKey regular_key(0, 0, 0, KC_A);
758 KeymapKey key_repeat(0, 1, 0, QK_REP);
759 KeymapKey key_lsft(0, 2, 0, KC_LSFT);
760 KeymapKey key_lctl(0, 3, 0, KC_LCTL);
761 KeymapKey key_llck(0, 4, 0, QK_LAYER_LOCK);
762 set_keymap({regular_key, key_repeat, key_lsft, key_lctl, key_llck});
763
764 // Allow any number of empty reports.
765 EXPECT_EMPTY_REPORT(driver).Times(AnyNumber());
766 {
767 InSequence seq;
768 EXPECT_REPORT(driver, (KC_A));
769 EXPECT_REPORT(driver, (KC_LSFT));
770 EXPECT_REPORT(driver, (KC_LCTL));
771 EXPECT_REPORT(driver, (KC_A));
772 EXPECT_REPORT(driver, (KC_A));
773 }
774
775 tap_key(regular_key); // Taps the KC_A key.
776
777 // Tap Shift, Ctrl, and Layer Lock keys, which should not be remembered.
778 tap_keys(key_lsft, key_lctl, key_llck);
779 EXPECT_KEYCODE_EQ(get_last_keycode(), KC_A);
780
781 // Tapping the Repeat Key should still reproduce KC_A.
782 tap_keys(key_repeat, key_repeat);
783
784 testing::Mock::VerifyAndClearExpectations(&driver);
785}
786
754} // namespace 787} // namespace