diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/quantum.c | 20 | ||||
-rw-r--r-- | quantum/quantum.h | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 49767819d..d7dbc49dc 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -120,6 +120,14 @@ __attribute__((weak)) bool process_record_kb(uint16_t keycode, keyrecord_t *reco __attribute__((weak)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__ ((weak)) +void post_process_record_kb(uint16_t keycode, keyrecord_t *record) { + post_process_record_user(keycode, record); +} + +__attribute__ ((weak)) +void post_process_record_user(uint16_t keycode, keyrecord_t *record) {} + void reset_keyboard(void) { clear_keyboard(); #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) @@ -172,9 +180,15 @@ uint16_t get_event_keycode(keyevent_t event) { return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key); } -/* Main keycode processing function. Hands off handling to other functions, - * then processes internal Quantum keycodes, then processes ACTIONs. - */ +/* Get keycode, and then call keyboard function */ +void post_process_record_quantum(keyrecord_t *record) { + uint16_t keycode = get_record_keycode(record); + post_process_record_kb(keycode, record); +} + +/* Core keycode function, hands off handling to other functions, + then processes internal quantum keycodes, and then processes + ACTIONs. */ bool process_record_quantum(keyrecord_t *record) { uint16_t keycode = get_record_keycode(record); diff --git a/quantum/quantum.h b/quantum/quantum.h index 191407fab..4b94ebcc0 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -257,6 +257,8 @@ uint16_t get_event_keycode(keyevent_t event); bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); +void post_process_record_kb(uint16_t keycode, keyrecord_t *record); +void post_process_record_user(uint16_t keycode, keyrecord_t *record); #ifndef BOOTMAGIC_LITE_COLUMN # define BOOTMAGIC_LITE_COLUMN 0 |