stasmarkin / sm_td

SM Tap Dance user library for QMK
GNU General Public License v3.0
119 stars 4 forks source link

Combo compatibility #5

Open anderso opened 3 weeks ago

anderso commented 3 weeks ago

I am interested in trying this out but as I use a lot of combos on the home row, I'd like to know if that is at all possible with this solution? And if so, how? Or even if no consideration for this has been made, a mention of this in the docs would be nice.

stasmarkin commented 3 weeks ago

Hi @anderso ! Thanks for the suggestion, I will add another wiki page with interoperability with qmk features. Talking about combos, SMTD works well with QMK combo system. I also have HRM and many combos on the same keys. You don't have to do anything extra to make it work. Once you change your keymap with CKC keycodes, you just need to update combo configurations with those CKC_ keycodes. So, instead of

const uint16_t PROGMEM combo_AS[] = { KC_A, KC_S, COMBO_END }

you must create

const uint16_t PROGMEM combo_AS[] = { CKC_A, CKC_S, COMBO_END }

And so on. Just change the keycodes in each combo accordingly and you are good to go.

stasmarkin commented 3 weeks ago

If you want a combo to be a part of SM_TD (for example, you want to distinguish tap a combo and hold a combo), you will need to imlicitly pass it to SM_TD like that:

void process_combo_event(uint16_t combo_index, bool pressed) {
    switch (combo_index) {
        case DF: {
            keyrecord_t record = {.event = MAKE_KEYEVENT(0, 0, pressed)};
            process_smtd(CKC_DF_COMBO, &record);
            return;
        }
    ...
anderso commented 3 weeks ago

Awesome, thanks, l will definitely try this out then. Actually I may not need to change the combos at all since I use a separate combo reference layer.

stasmarkin commented 3 weeks ago

I have another repo with my personal settings, so you may find some useful snippets there. I have many combos in different configurations with SM_TD

https://github.com/stasmarkin/sm_voyager_keymap/blob/main/sm/sm_voyager_combo.h

anderso commented 1 week ago

The good news is that combos work. The bad news is that they don't interact well with modifiers. I have backspace on combo. I can't do ctrl + backspace without pausing between ctrl and hitting backspace. And if I do multiple modifiers, it seems I need to wait longer.

stasmarkin commented 3 days ago

Take a look at my CKC_DF_COMBO. Just call process_smtd() from process_combo_event(), so sm_td will know that you pressed another key and it will immediately interpret SMTD_MT as hold. If you need further assistance, please share your configuration, so I could give you an exact patch