Sequence-Transform is a user library for QMK that enables a rich declarative ruleset for transforming a sequence of keypresses into any output you would like.
Utf8 seq tokens and wordbreak symbols are now added to generated header (with an #ifdef ST_TESTER so QMK doesn't complain about unused variables).
Rule sequences and transforms are now both saved as triecode arrays to generated test header.
Changes to the code:
Moved all triecode/keycode/ascii conversion functions into triecodes.h/c. Each has a narrow and specific job, and there is now no confusing duplication of code.
Tester now uses key_stack (of triecodes) for simulated output. Triecodes are now compared directly instead of comparing after lossy string conversions. Test functions no longer have to know/care if they should ignore a leading space in the transform.
Added new tester only functions to key_buffer/key_stack/triecodes wrapped in #ifdef ST_TESTER blocks so they don't get compiled into the firmware.
Tester -s mode now shows input/output buffers with utf8 symbols.
Updated copyright headers on all source files.
Bug fixed: st_perform was being called for key down and key up.
I fixed it by moving the if (!record->event.pressed) test to right before we're about to work with the final keycode, since the body of st_process_check could potentially convert the incoming keycode into KC_BSPC.
(While fixing this, I moved code into functions to make the main process_sequence_transform function more readable.)
Changes to the script:
generate_sequence_symbol_map
.#ifdef ST_TESTER
so QMK doesn't complain about unused variables).Changes to the code:
triecodes.h/c
. Each has a narrow and specific job, and there is now no confusing duplication of code.key_buffer/key_stack/triecodes
wrapped in#ifdef ST_TESTER
blocks so they don't get compiled into the firmware.Bug fixed:
st_perform
was being called for key down and key up. I fixed it by moving theif (!record->event.pressed)
test to right before we're about to work with thefinal
keycode, since the body ofst_process_check
could potentially convert the incoming keycode intoKC_BSPC
. (While fixing this, I moved code into functions to make the mainprocess_sequence_transform
function more readable.)