New combo configuration options #15083
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Here's a couple of new configuration features for combos.
COMBO_MUST_PRESS_IN_ORDERto force combos to only activate if the keys are pressed in the same order as they are defined in the combo's key array.Per combo configuration can be modified by defining
COMBO_MUST_PRESS_IN_ORDER_PER_COMBOand definingbool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)function in which you choose which combos require the correct key order.This feature even allows multiple combos from the same keys. For example on qwerty layout,
JKcan produce/andKJcan produce\. Just define two combos using the same keys but put the keycodes in reverse order for the other one.COMBO_SHOULD_TRIGGERand its companying functionbool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)enable disallowing combos to be activated when you choose so. Forexample on certain layers, or when a timer is running.
Types of Changes
Checklist