aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md20
-rw-r--r--tmk_core/common/action.c2
2 files changed, 21 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6a6bbed40..d8dfd7c2b 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,26 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
98 98
99`DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. 99`DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does.
100 100
101### Prevent stuck modifiers
102
103Consider the following scenario:
104
1051. Layer 0 has a key defined as Shift.
1062. The same key is defined on layer 1 as the letter A.
1073. User presses Shift.
1084. User switches to layer 1 for whatever reason.
1095. User releases Shift, or rather the letter A.
1106. User switches back to layer 0.
111
112Shift was actually never released and is still considered pressed.
113
114If such situation bothers you add this to your `config.h`:
115
116 #define PREVENT_STUCK_MODIFIERS
117
118Warning: This option uses up 2 bytes of memory per key. For example on
119Planck it uses 2\*4\*12=96 bytes.
120
101### Remember: These are just aliases 121### Remember: These are just aliases
102 122
103These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action). 123These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action).
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index be06e12aa..26a5fad7a 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -61,7 +61,7 @@ void action_exec(keyevent_t event)
61 */ 61 */
62action_t store_or_get_action(bool pressed, keypos_t key) 62action_t store_or_get_action(bool pressed, keypos_t key)
63{ 63{
64#ifndef NO_ACTION_LAYER 64#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
65 static action_t pressed_actions[MATRIX_ROWS][MATRIX_COLS]; 65 static action_t pressed_actions[MATRIX_ROWS][MATRIX_COLS];
66 66
67 if (pressed) { 67 if (pressed) {