Skip to content

Instantly share code, notes, and snippets.

@andrewcchen
Last active October 23, 2016 04:53
Show Gist options
  • Save andrewcchen/df13049c76f66d163d3433dd22414509 to your computer and use it in GitHub Desktop.
Save andrewcchen/df13049c76f66d163d3433dd22414509 to your computer and use it in GitHub Desktop.
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 3a3c401..35ffc7d 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -66,6 +66,12 @@ void process_action(keyrecord_t *record)
if (IS_NOEVENT(event)) { return; }
action_t action = layer_switch_get_action(event.key);
+ static action_t action_on_press[MATRIX_ROWS][MATRIX_COLS];
+ if (event.pressed) {
+ action_on_press[event.key.row][event.key.col] = action;
+ } else {
+ action = action_on_press[event.key.row][event.key.col];
+ }
dprint("ACTION: "); debug_action(action);
#ifndef NO_ACTION_LAYER
dprint(" layer_state: "); layer_debug();
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index 6b5a7fd..963703c 100644
--- a/tmk_core/common/action_layer.c
+++ b/tmk_core/common/action_layer.c
@@ -24,7 +24,6 @@ static void default_layer_state_set(uint32_t state)
default_layer_state = state;
hook_default_layer_change(default_layer_state);
default_layer_debug(); debug("\n");
- clear_keyboard_but_mods(); // To avoid stuck keys
}
void default_layer_debug(void)
@@ -66,7 +65,6 @@ static void layer_state_set(uint32_t state)
layer_state = state;
hook_layer_change(layer_state);
layer_debug(); dprintln();
- clear_keyboard_but_mods(); // To avoid stuck keys
}
void layer_clear(void)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment