summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-08-17 21:16:49 -0400
committerGitHub <noreply@github.com>2016-08-17 21:16:49 -0400
commit39a95897bcb5f7b1a9b05c8ade416e7c9566857a (patch)
tree0ba6f7d6cdebdb7c2e8f7a1528667c711753829f
parentf4f80a0e3ac24f573ce72fea88e291e94108b9d8 (diff)
parent644c8c79271db8cf1bd934b9a80a0215585e46e7 (diff)
Merge pull request #647 from Vifon/process_record_nocache-fix
Fix the process_record_nocache function
-rw-r--r--quantum/quantum.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index a4c5c2ddbc..cb1ba04ffb 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -46,18 +46,20 @@ bool process_record_quantum(keyrecord_t *record) {
uint16_t keycode;
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
- uint8_t layer;
+ /* TODO: Use store_or_get_action() or a similar function. */
+ if (!disable_action_cache) {
+ uint8_t layer;
- if (record->event.pressed) {
- layer = layer_switch_get_layer(key);
- update_source_layers_cache(key, layer);
- } else {
- layer = read_source_layers_cache(key);
- }
- keycode = keymap_key_to_keycode(layer, key);
- #else
- keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key);
+ if (record->event.pressed) {
+ layer = layer_switch_get_layer(key);
+ update_source_layers_cache(key, layer);
+ } else {
+ layer = read_source_layers_cache(key);
+ }
+ keycode = keymap_key_to_keycode(layer, key);
+ } else
#endif
+ keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key);
// This is how you use actions here
// if (keycode == KC_LEAD) {