summaryrefslogtreecommitdiffstats
path: root/quantum/quantum.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 3329c1146b..d173388714 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -143,7 +143,13 @@ void reset_keyboard(void) {
}
/* Convert record into usable keycode via the contained event. */
-uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) { return get_event_keycode(record->event, update_layer_cache); }
+uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) {
+#ifdef COMBO_ENABLE
+ if (record->keycode) { return record->keycode; }
+#endif
+ return get_event_keycode(record->event, update_layer_cache);
+}
+
/* Convert event into usable keycode. Checks the layer cache to ensure that it
* retains the correct keycode after a layer change, if the key is still pressed.
@@ -169,6 +175,18 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key);
}
+/* Get keycode, and then process pre tapping functionality */
+bool pre_process_record_quantum(keyrecord_t *record) {
+ if (!(
+#ifdef COMBO_ENABLE
+ process_combo(get_record_keycode(record, true), record) &&
+#endif
+ true)) {
+ return false;
+ }
+ return true; // continue processing
+}
+
/* Get keycode, and then call keyboard function */
void post_process_record_quantum(keyrecord_t *record) {
uint16_t keycode = get_record_keycode(record, false);
@@ -254,9 +272,6 @@ bool process_record_quantum(keyrecord_t *record) {
#ifdef LEADER_ENABLE
process_leader(keycode, record) &&
#endif
-#ifdef COMBO_ENABLE
- process_combo(keycode, record) &&
-#endif
#ifdef PRINTING_ENABLE
process_printer(keycode, record) &&
#endif