Created
October 27, 2018 02:23
-
-
Save ridingintraffic/06ff8efe85d7d8381212142f23cf7fff to your computer and use it in GitHub Desktop.
tap dance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keymap.c | |
.... | |
/* tap dance time */ | |
void tdexample1(qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count >= 2) { | |
SEND_STRING(EXAMPLESTRING1); | |
reset_tap_dance (state); | |
} | |
} | |
void tdexample2(qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count >= 2) { | |
SEND_STRING(EXAMPLESTRING2); | |
reset_tap_dance (state); | |
} | |
} | |
void tdexample3(qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count >= 2) { | |
SEND_STRING(EXAMPLESTRING3); | |
reset_tap_dance (state); | |
} | |
} | |
void tdexample4(qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count >= 2) { | |
SEND_STRING(EXAMPLESTRING4); | |
reset_tap_dance (state); | |
} | |
} | |
qk_tap_dance_action_t tap_dance_actions[] = { | |
[TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1), | |
[TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2), | |
[TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3), | |
[TD_EXAMPLE4] = ACTION_TAP_DANCE_FN(tdexample4) | |
}; | |
... | |
config.h | |
... | |
#define EXAMPLESTRING1 "tapdance_1" | |
#define EXAMPLESTRING2 "tapdance_2" | |
#define EXAMPLESTRING3 "tapdance_3" | |
#define EXAMPLESTRING4 "tapdance_4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment