]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Expose the pressed_actions_cache global variable
authorWojciech Siewierski <wojciech.siewierski@onet.pl>
Tue, 15 Mar 2016 15:51:50 +0000 (16:51 +0100)
committerWojciech Siewierski <wojciech.siewierski@onet.pl>
Tue, 15 Mar 2016 15:51:50 +0000 (16:51 +0100)
tmk_core/common/action.c
tmk_core/common/action.h

index 0a3822a06c086fdd32120c26bc0a7ba30f52a5c0..fc09383ee0fc424b7524b973c4f13a6bfb381a84 100644 (file)
@@ -55,6 +55,7 @@ void action_exec(keyevent_t event)
 
 #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
 bool disable_action_cache = false;
+action_t pressed_actions_cache[MATRIX_ROWS][MATRIX_COLS];
 
 void process_action_nocache(keyrecord_t *record)
 {
@@ -78,16 +79,14 @@ void process_action_nocache(keyrecord_t *record)
 action_t store_or_get_action(bool pressed, keypos_t key)
 {
 #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
-    static action_t pressed_actions[MATRIX_ROWS][MATRIX_COLS];
-
     if (disable_action_cache) {
         return layer_switch_get_action(key);
     }
 
     if (pressed) {
-        pressed_actions[key.row][key.col] = layer_switch_get_action(key);
+        pressed_actions_cache[key.row][key.col] = layer_switch_get_action(key);
     }
-    return pressed_actions[key.row][key.col];
+    return pressed_actions_cache[key.row][key.col];
 #else
     return layer_switch_get_action(key);
 #endif
index 533e5d1a011d62c4196c750179dcfa63b81fae7b..7a60f320e7a61d1d5ef5c80b525b8e45d913d8f2 100644 (file)
@@ -61,6 +61,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
 /* Utilities for actions.  */
 #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
 extern bool disable_action_cache;
+extern action_t pressed_actions_cache[MATRIX_ROWS][MATRIX_COLS];
 #endif
 void process_action_nocache(keyrecord_t *record);
 void process_action(keyrecord_t *record);