summaryrefslogtreecommitdiff
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, 16 insertions, 7 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 0587f215fe..091cf298f7 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -114,6 +114,14 @@ __attribute__((weak)) void tap_code16(uint16_t code) {
tap_code16_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY);
}
+__attribute__((weak)) bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record) {
+ return pre_process_record_user(keycode, record);
+}
+
+__attribute__((weak)) bool pre_process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
__attribute__((weak)) bool process_action_kb(keyrecord_t *record) {
return true;
}
@@ -168,7 +176,7 @@ void soft_reset_keyboard(void) {
/* Convert record into usable keycode via the contained event. */
uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) {
-#ifdef COMBO_ENABLE
+#if defined(COMBO_ENABLE) || defined(REPEAT_KEY_ENABLE)
if (record->keycode) {
return record->keycode;
}
@@ -202,14 +210,12 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
/* Get keycode, and then process pre tapping functionality */
bool pre_process_record_quantum(keyrecord_t *record) {
- if (!(
+ uint16_t keycode = get_record_keycode(record, true);
+ return pre_process_record_kb(keycode, record) &&
#ifdef COMBO_ENABLE
- process_combo(get_record_keycode(record, true), record) &&
+ process_combo(keycode, record) &&
#endif
- true)) {
- return false;
- }
- return true; // continue processing
+ true;
}
/* Get keycode, and then call keyboard function */
@@ -267,6 +273,9 @@ bool process_record_quantum(keyrecord_t *record) {
// Must run asap to ensure all keypresses are recorded.
process_dynamic_macro(keycode, record) &&
#endif
+#ifdef REPEAT_KEY_ENABLE
+ process_last_key(keycode, record) && process_repeat_key(keycode, record) &&
+#endif
#if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY)
process_clicky(keycode, record) &&
#endif