Skip to content

Instantly share code, notes, and snippets.

@DavidRambo
Created July 5, 2022 21:30
Show Gist options
  • Save DavidRambo/6a056573fd82df80e92a87d637107cf6 to your computer and use it in GitHub Desktop.
Save DavidRambo/6a056573fd82df80e92a87d637107cf6 to your computer and use it in GitHub Desktop.
identical code works in one keyboard, not in another
enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE,
SET_RGB,
SFT_CAPS,
};
#define SftCap TD(SFT_CAPS)
// SftCap is in my keymap matrix
// Tapdance functions: 1 for Shift, 2 for Caps_Word.
void tap_caps_word(qk_tap_dance_state_t *state, void *user_data) {
if (state->count ==1) {
register_code(KC_LSFT);
} else if (state->count == 2) {
unregister_code(KC_LSFT);
caps_word_on();
}
}
void tap_caps_reset(qk_tap_dance_state_t *state, void *user_data) {
unregister_code(KC_LSFT);
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for Shift, twice for Caps Word
[SFT_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_caps_word, tap_caps_reset)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment