Last active
January 7, 2022 19:06
-
-
Save drashna/ca6df0fd88126d83de40ded511ab1230 to your computer and use it in GitHub Desktop.
dance brackets
This file contains 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
#include QMK_KEYBOARD_H | |
#include "dancing_brackets.h" | |
void tap_dance_dancing_bracket_on_each_tap(qk_tap_dance_state_t *state, void *user_data) { | |
if (state->count > 3) { | |
// There can't be reached any other state here. Stop tap dance. | |
timer_clear(); | |
} | |
} | |
void tap_dance_dancing_bracket_finished(qk_tap_dance_state_t *state, void *user_data) { | |
dancing_bracket_config_t *config = (dancing_bracket_config_t *)user_data; | |
if (state->count & 0b01) { | |
tap_code16(config->open_char); | |
} | |
if (state->count & 0b01) | |
tap_code16(config->close_char); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment