1
0
Fork 0

Add Post Processing to process_record (#4892)

* Improve process_record system

Code based on @colinta's

* Rename and better handle functions

* Fix incorrect function call to process_record_user

* Add documentation for post_process_record

* Add both get_event_keycode and get_record_keycode functions

And add some comments about these functions

* Update code format

* Cleanup merge artifacts
This commit is contained in:
Drashna Jael're 2020-03-22 06:29:05 -07:00 committed by GitHub
parent e5d34fd084
commit 5117dff6a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 4 deletions

View file

@ -151,6 +151,8 @@ void process_record_nocache(keyrecord_t *record) { process_record(record); }
__attribute__((weak)) bool process_record_quantum(keyrecord_t *record) { return true; }
__attribute__((weak)) void post_process_record_quantum(keyrecord_t *record) {}
#ifndef NO_ACTION_TAPPING
/** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
*
@ -185,6 +187,11 @@ void process_record(keyrecord_t *record) {
if (!process_record_quantum(record)) return;
process_record_handler(record);
post_process_record_quantum(record);
}
void process_record_handler(keyrecord_t *record) {
action_t action = store_or_get_action(record->event.pressed, record->event.key);
dprint("ACTION: ");
debug_action(action);
@ -988,7 +995,6 @@ bool is_tap_action(action_t action) {
* FIXME: Needs documentation.
*/
void debug_event(keyevent_t event) { dprintf("%04X%c(%u)", (event.key.row << 8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); }
/** \brief Debug print (FIXME: Needs better description)
*
* FIXME: Needs documentation.