aboutsummaryrefslogtreecommitdiff
path: root/quantum/action_tapping.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-08-25 01:16:59 +0100
committerGitHub <noreply@github.com>2021-08-25 01:16:59 +0100
commita84de5e22be25e2059dfee732f5cca3ec0953a35 (patch)
tree31202fc9dcf0ff56ead905b234ed0ab364ca7de7 /quantum/action_tapping.c
parent3855713ca0a9513c51fe70e61032d7ea89fa7e87 (diff)
downloadqmk_firmware-a84de5e22be25e2059dfee732f5cca3ec0953a35.tar.gz
qmk_firmware-a84de5e22be25e2059dfee732f5cca3ec0953a35.zip
Revert 14083 && 14144 (#14150)
* Revert "Short term bodge for firmware size bloat (#14144)" This reverts commit a8d65473461c337fb1e168d907bfb8c3ac8fdbd0. * Revert "Tidy up quantum.c now some of tmk_core has been merged (#14083)" This reverts commit c4dbf4bf0118dd785802861beb247433b5b7411d.
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