aboutsummaryrefslogtreecommitdiff
path: root/users/kuchosauronad0/tap_dances.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/kuchosauronad0/tap_dances.c')
-rw-r--r--users/kuchosauronad0/tap_dances.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/users/kuchosauronad0/tap_dances.c b/users/kuchosauronad0/tap_dances.c
new file mode 100644
index 000000000..4ebb5dc73
--- /dev/null
+++ b/users/kuchosauronad0/tap_dances.c
@@ -0,0 +1,57 @@
1#include "tap_dances.h"
2void td_parenthesis (qk_tap_dance_state_t *state, void *user_data) {
3 if (state->count == 1) {
4 SEND_STRING ("\(");
5 reset_tap_dance (state);
6 }
7 else if (state->count == 2) {
8 SEND_STRING("()" SS_TAP(X_LEFT));
9 //tap_code(KC_2);
10 //tap_code(KC_3);
11 //tap_code(KC_LEFT);
12 reset_tap_dance (state);
13 }
14 else if (state->count == 3) {
15 SEND_STRING("[]" SS_TAP(X_LEFT));
16 reset_tap_dance (state);
17 }
18 else if (state->count == 4) {
19 SEND_STRING("{}" SS_TAP(X_LEFT));
20 reset_tap_dance (state);
21 }
22 else if (state->count >= 5) {
23 SEND_STRING("<>" SS_TAP(X_LEFT));
24 reset_tap_dance (state);
25 }
26}
27
28void safe_reset(qk_tap_dance_state_t *state, void *user_data) {
29 if (state->count >= 3) {
30 // Reset the keyboard if you tap the key more than three times
31 reset_keyboard();
32 reset_tap_dance(state);
33 }
34}
35
36qk_tap_dance_action_t tap_dance_actions[] = {
37 [TD_RESET] = ACTION_TAP_DANCE_FN(safe_reset),
38 [TD_NUM1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_4),
39 [TD_NUM2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_5),
40 [TD_NUM3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_6),
41 [TD_QT1] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, MC_QT1),
42 [TD_QT2] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_QUOT), MC_QT2),
43 [TD_QT3] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, MC_QT3),
44
45 [TD_TMX] = ACTION_TAP_DANCE_DOUBLE(KC_T, TM_X),
46 [TD_EOL] = ACTION_TAP_DANCE_DOUBLE(KC_E, MC_EOL), // end of line
47 [TD_BOL] = ACTION_TAP_DANCE_DOUBLE(KC_A, MC_BOL), // beginning of line
48 [TD_NW] = ACTION_TAP_DANCE_DOUBLE(KC_F, MC_NW), // next word
49 [TD_PW] = ACTION_TAP_DANCE_DOUBLE(KC_B, MC_PW), // pevious word
50 [TD_DW] = ACTION_TAP_DANCE_DOUBLE(KC_W, MC_DW), // pevious word
51
52 [TD_SPC] = ACTION_TAP_DANCE_FN(td_parenthesis), // \(, (), [], {}, <>
53 [TD_PAR] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, MC_PAR), // ()
54 [TD_SQR] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, MC_SQR), // []
55 [TD_CUR] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_LCBR), MC_CUR),// {}
56 [TD_ABR] = ACTION_TAP_DANCE_DOUBLE(LSFT(KC_COMM), MC_ABR),//
57};