aboutsummaryrefslogtreecommitdiff
path: root/quantum/action_tapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/action_tapping.c')
-rw-r--r--quantum/action_tapping.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c
index 09514aa7f..36839f9fa 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -5,7 +5,6 @@
5#include "action_tapping.h" 5#include "action_tapping.h"
6#include "keycode.h" 6#include "keycode.h"
7#include "timer.h" 7#include "timer.h"
8#include "keymap_common.h"
9 8
10#ifdef DEBUG_ACTION 9#ifdef DEBUG_ACTION
11# include "debug.h" 10# include "debug.h"
@@ -59,40 +58,6 @@ static void waiting_buffer_scan_tap(void);
59static void debug_tapping_key(void); 58static void debug_tapping_key(void);
60static void debug_waiting_buffer(void); 59static void debug_waiting_buffer(void);
61 60
62/* Convert record into usable keycode via the contained event. */
63uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) {
64#ifdef COMBO_ENABLE
65 if (record->keycode) { return record->keycode; }
66#endif
67 return get_event_keycode(record->event, update_layer_cache);
68}
69
70/* Convert event into usable keycode. Checks the layer cache to ensure that it
71 * retains the correct keycode after a layer change, if the key is still pressed.
72 * "update_layer_cache" is to ensure that it only updates the layer cache when
73 * appropriate, otherwise, it will update it and cause layer tap (and other keys)
74 * from triggering properly.
75 */
76uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
77 const keypos_t key = event.key;
78
79#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
80 /* TODO: Use store_or_get_action() or a similar function. */
81 if (!disable_action_cache) {
82 uint8_t layer;
83
84 if (event.pressed && update_layer_cache) {
85 layer = layer_switch_get_layer(key);
86 update_source_layers_cache(key, layer);
87 } else {
88 layer = read_source_layers_cache(key);
89 }
90 return keymap_key_to_keycode(layer, key);
91 }
92#endif
93 return keymap_key_to_keycode(layer_switch_get_layer(key), key);
94}
95
96/** \brief Action Tapping Process 61/** \brief Action Tapping Process
97 * 62 *
98 * FIXME: Needs doc 63 * FIXME: Needs doc