Skip to content

Commit

Permalink
Don't clear keys on layer change unless STRICT_LAYER_RELEASE is enabl…
Browse files Browse the repository at this point in the history
…ed (qmk#18577)

* Don't clear mousekeys unless clearing keys

* Revert "Don't clear mousekeys unless clearing keys"

This reverts commit 29a0c06.

* Just don't clear anything on layer set

* Fix lint

* Enable test?
  • Loading branch information
drashna authored Nov 12, 2022
1 parent 0922285 commit 1caedd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions quantum/action_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion tests/basic/test_action_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1caedd1

Please sign in to comment.