Open anderso opened 3 months 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.
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;
}
...
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.
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
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.
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
Thanks! I did try the following after looking at your code:
void on_smtd_action(uint16_t keycode, smtd_action action, uint8_t tap_count) {
switch (keycode) {
SMTD_MT(CKC_N, KC_N, KC_LCTL)
}
}
enum combos {
AI_BSPC
};
const uint16_t PROGMEM ai_combo[] = {KC_A, KC_I, COMBO_END};
combo_t key_combos[] = {
[AI_BSPC] = COMBO_ACTION(ai_combo),
};
void process_combo_event(uint16_t combo_index, bool pressed) {
switch (combo_index) {
case AI_BSPC: {
keyrecord_t record = {.event = MAKE_KEYEVENT(0, 0, pressed)};
process_smtd(KC_BSPC, &record);
if (pressed) {
tap_code16(KC_BSPC);
}
return;
}
}
}
But holding N and then pressing A and I in quick succession still does not produce ctrl-backspace, if I wait a bit it works. I can for example hold N and S quickly for ctrl-S. Any ideas?
Just noticed, that I have the same issue too... I will fix it later, however you can try a quick fix here:
case AI_BSPC: {
if (pressed) {
keyrecord_t press = {.event = MAKE_KEYEVENT(0, 0, true)};
process_smtd(KC_BSPC, &press);
keyrecord_t release = {.event = MAKE_KEYEVENT(0, 0, false)};
process_smtd(KC_BSPC, &release);
tap_code16(KC_BSPC);
}
return;
}
I'm not 100% sure, but that might work for you
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.