summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-11-11 18:11:50 -0800
committerGitHub <noreply@github.com>2022-11-12 02:11:50 +0000
commit1caedd10c45adef49724f5aa0967e23286f4dd38 (patch)
tree5a7c10ac0be1ec4e4fb1b8307173add18e78b577
parent092228571c40a31d88940055b4d2fa749f135314 (diff)
Don't clear keys on layer change unless STRICT_LAYER_RELEASE is enabled (#18577)
* Don't clear mousekeys unless clearing keys * Revert "Don't clear mousekeys unless clearing keys" This reverts commit 29a0c06b547d72b80d416a8b6fab478c77fbd247. * Just don't clear anything on layer set * Fix lint * Enable test?
-rw-r--r--quantum/action_layer.c8
-rw-r--r--tests/basic/test_action_layer.cpp1
2 files changed, 4 insertions, 5 deletions
diff --git a/quantum/action_layer.c b/quantum/action_layer.c
index 8ef337a690..31cfdfe13a 100644
--- a/quantum/action_layer.c
+++ b/quantum/action_layer.c
@@ -45,9 +45,9 @@ static void default_layer_state_set(layer_state_t state) {
default_layer_state = state;
default_layer_debug();
debug("\n");
-#ifdef STRICT_LAYER_RELEASE
+#if defined(STRICT_LAYER_RELEASE)
clear_keyboard_but_mods(); // To avoid stuck keys
-#else
+#elif defined(SEMI_STRICT_LAYER_RELEASE)
clear_keyboard_but_mods_and_keys(); // Don't reset held keys
#endif
}
@@ -125,9 +125,9 @@ void layer_state_set(layer_state_t state) {
layer_state = state;
layer_debug();
dprintln();
-# ifdef STRICT_LAYER_RELEASE
+# if defined(STRICT_LAYER_RELEASE)
clear_keyboard_but_mods(); // To avoid stuck keys
-# else
+# elif defined(SEMI_STRICT_LAYER_RELEASE)
clear_keyboard_but_mods_and_keys(); // Don't reset held keys
# endif
}
diff --git a/tests/basic/test_action_layer.cpp b/tests/basic/test_action_layer.cpp
index fa339a3375..d0a28d42c0 100644
--- a/tests/basic/test_action_layer.cpp
+++ b/tests/basic/test_action_layer.cpp
@@ -360,7 +360,6 @@ TEST_F(ActionLayer, LayerTapToggleWithToggleWithKeypress) {
}
TEST_F(ActionLayer, LayerTapReleasedBeforeKeypressReleaseWithModifiers) {
- GTEST_SKIP() << "TODO: Modifiers are erroneously discarded on layer changes, although a key that introduced the modifier is still held.";
TestDriver driver;
InSequence s;