From 2348892402f7c341508ba5a63e950eaa222f1443 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Thu, 26 Sep 2024 11:44:36 -0400 Subject: [PATCH 1/7] Fix space cadet and auto shift interaction https://github.com/qmk/qmk_firmware/issues/20978 --- quantum/quantum.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 011f9d73e4a..34dffb7410d 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -364,15 +364,15 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef LEADER_ENABLE process_leader(keycode, record) && #endif +#ifdef SPACE_CADET_ENABLE + process_space_cadet(keycode, record) && +#endif #ifdef AUTO_SHIFT_ENABLE process_auto_shift(keycode, record) && #endif #ifdef DYNAMIC_TAPPING_TERM_ENABLE process_dynamic_tapping_term(keycode, record) && #endif -#ifdef SPACE_CADET_ENABLE - process_space_cadet(keycode, record) && -#endif #ifdef MAGIC_ENABLE process_magic(keycode, record) && #endif From 397df6f87477e3182f3021b78cd323174ac0660d Mon Sep 17 00:00:00 2001 From: Andrew M Date: Fri, 27 Sep 2024 21:20:48 -0400 Subject: [PATCH 2/7] Update test_auto_shift.cpp --- tests/auto_shift/test_auto_shift.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index 1d80634b2fd..86f32135606 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -68,3 +68,31 @@ TEST_F(AutoShift, key_release_after_timeout) { run_one_scan_loop(); VERIFY_AND_CLEAR(driver); } + + +// test auto shift and space cadet interaction +// press shift, press key, release shift, release key +// the right interaction is we only get the shifted key +// the wrong interaction is we get a bracket and a shifted key +TEST_F(AutoShift, key_release_after_timeout) { + TestDriver driver; + InSequence s; + auto left_shift = KeymapKey(0, 0, 0, SC_LSPO); + auto key_a = KeymapKey(0, 1, 0, KC_A); + + set_keymap({regular_key}); + + /* Press regular key */ + EXPECT_NO_REPORT(driver); + left_shift.press(); + key_a.press(); + left_shift.release(); + key_a.release(); + VERIFY_AND_CLEAR(driver); + + /* Release regular key */ + EXPECT_REPORT(driver, (KC_LSFT, KC_A)); + EXPECT_EMPTY_REPORT(driver); + run_one_scan_loop(); + VERIFY_AND_CLEAR(driver); +} From 925f7be986cf21002dbf6a896de7aa776fc8ac1d Mon Sep 17 00:00:00 2001 From: Andrew M Date: Sat, 12 Oct 2024 22:25:40 -0400 Subject: [PATCH 3/7] Update tests/auto_shift/test_auto_shift.cpp Co-authored-by: Drashna Jaelre --- tests/auto_shift/test_auto_shift.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index 86f32135606..505a783237f 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -69,7 +69,6 @@ TEST_F(AutoShift, key_release_after_timeout) { VERIFY_AND_CLEAR(driver); } - // test auto shift and space cadet interaction // press shift, press key, release shift, release key // the right interaction is we only get the shifted key From f56ff19d9106f293a1ad36090277ac0d7c902053 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Sat, 12 Oct 2024 22:25:44 -0400 Subject: [PATCH 4/7] Update tests/auto_shift/test_auto_shift.cpp Co-authored-by: Drashna Jaelre --- tests/auto_shift/test_auto_shift.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index 505a783237f..d31bed7c9d1 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -77,7 +77,7 @@ TEST_F(AutoShift, key_release_after_timeout) { TestDriver driver; InSequence s; auto left_shift = KeymapKey(0, 0, 0, SC_LSPO); - auto key_a = KeymapKey(0, 1, 0, KC_A); + auto key_a = KeymapKey(0, 1, 0, KC_A); set_keymap({regular_key}); From 28dc7dc81200e371f7ea43962c1887ab36b407e1 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Sat, 12 Oct 2024 22:25:50 -0400 Subject: [PATCH 5/7] Update tests/auto_shift/test_auto_shift.cpp Co-authored-by: Drashna Jaelre --- tests/auto_shift/test_auto_shift.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index d31bed7c9d1..5fbf6746597 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -73,7 +73,7 @@ TEST_F(AutoShift, key_release_after_timeout) { // press shift, press key, release shift, release key // the right interaction is we only get the shifted key // the wrong interaction is we get a bracket and a shifted key -TEST_F(AutoShift, key_release_after_timeout) { +TEST_F(AutoShift, auto_shift_with_space_cadet) { TestDriver driver; InSequence s; auto left_shift = KeymapKey(0, 0, 0, SC_LSPO); From f6b3c3ba07fce10e947e8a6b4d58dcfe9be1f925 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Wed, 16 Oct 2024 09:22:08 -0400 Subject: [PATCH 6/7] Update tests/auto_shift/test_auto_shift.cpp Co-authored-by: Drashna Jaelre --- tests/auto_shift/test_auto_shift.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index 5fbf6746597..d1ccb6cbccb 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -79,7 +79,7 @@ TEST_F(AutoShift, auto_shift_with_space_cadet) { auto left_shift = KeymapKey(0, 0, 0, SC_LSPO); auto key_a = KeymapKey(0, 1, 0, KC_A); - set_keymap({regular_key}); + set_keymap({left_shift, key_a}); /* Press regular key */ EXPECT_NO_REPORT(driver); From 79c2afa39e294020d7973e458478abcb503d7f79 Mon Sep 17 00:00:00 2001 From: Andrew M Date: Sun, 20 Oct 2024 13:16:31 -0400 Subject: [PATCH 7/7] Update tests/auto_shift/test_auto_shift.cpp Co-authored-by: Drashna Jaelre --- tests/auto_shift/test_auto_shift.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto_shift/test_auto_shift.cpp b/tests/auto_shift/test_auto_shift.cpp index d1ccb6cbccb..2f4b1f1515d 100644 --- a/tests/auto_shift/test_auto_shift.cpp +++ b/tests/auto_shift/test_auto_shift.cpp @@ -68,7 +68,6 @@ TEST_F(AutoShift, key_release_after_timeout) { run_one_scan_loop(); VERIFY_AND_CLEAR(driver); } - // test auto shift and space cadet interaction // press shift, press key, release shift, release key // the right interaction is we only get the shifted key