This is the issue: ShiftToLayer
is a markup only useful in the keymap. It translates to a keycode, and that’s about it. The above code is essentially this:
void stl_DoubleFunk(uint8_t combo_index) {
(Key){.flags = SYNTHETIC | SWITCH_TO_KEYMAP,
.keyCode = DOUBLE_FUNK + LAYER_SWITCH_OFFSET};
}
…and this isn’t exactly useful in this context. You’ll need to use the Layer.on()
/Layer.off()
functions directly:
void stl_DoubleFunk(uint8_t combo_index) {
if (Layer.isOn(DOUBLE_FUNK)) {
Layer.off(DOUBLE_FUNK);
} else {
Layer.on(DOUBLE_FUNK);
}
}
Mind you, you can only toggle layers with MagicCombo
, you can’t do momentary layers as with ShiftToLayer
, due to technical reasons. If that’s what you want, we’ll have to find another solution