summaryrefslogtreecommitdiff
path: root/tmk_core/common/action.c
diff options
context:
space:
mode:
authorErez Zukerman <bulk@ezuk.org>2016-04-06 22:47:31 +0300
committerErez Zukerman <bulk@ezuk.org>2016-04-06 22:47:31 +0300
commit153a6fb0d3e9b54c4d6241c44ffdb9ce8a65de7f (patch)
treecd210829c02686007ff02784dad65accf0779cd9 /tmk_core/common/action.c
parent27ee47d0bd467e86e36feff8c66b3aea661f91b5 (diff)
parent567f256c5d4598adb4dcd63fa4e4a7b4df553b12 (diff)
Merge pull request #182 from Vifon/modifier-release-fix
Fix the layer-dependent modifiers handling
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r--tmk_core/common/action.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 9010896343..f9e6c17dc3 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -53,6 +53,22 @@ void action_exec(keyevent_t event)
#endif
}
+#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
+bool disable_action_cache = false;
+
+void process_action_nocache(keyrecord_t *record)
+{
+ disable_action_cache = true;
+ process_action(record);
+ disable_action_cache = false;
+}
+#else
+void process_action_nocache(keyrecord_t *record)
+{
+ process_action(record);
+}
+#endif
+
__attribute__ ((weak))
void process_action_kb(keyrecord_t *record) {}
@@ -67,7 +83,7 @@ void process_action(keyrecord_t *record)
process_action_kb(record);
- action_t action = layer_switch_get_action(event.key);
+ action_t action = store_or_get_action(event.pressed, event.key);
dprint("ACTION: "); debug_action(action);
#ifndef NO_ACTION_LAYER
dprint(" layer_state: "); layer_debug();