aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorJoe Wasson <jwasson+github@gmail.com>2018-09-19 16:13:58 -0700
committerDrashna Jaelre <drashna@live.com>2018-09-19 16:13:58 -0700
commitc23233f41ab9221577fc83bbae0a230452a38231 (patch)
tree659d89fab1b5d8e27642a3de50ac66e33205df83 /users
parent71fe973190610bf155d864c71b8b326bc1b74eab (diff)
downloadqmk_firmware-c23233f41ab9221577fc83bbae0a230452a38231.tar.gz
qmk_firmware-c23233f41ab9221577fc83bbae0a230452a38231.zip
Keymap: Talljoe's keymap for oddball keyboards (#3910)
* Create layout for JD45 * Tweak layout to better support JD45 and add more tap dancing. * Add Maltron and tweak layout for 40% enter compatibility. * Switch back to `BL_TOGGLE` for backlight. * More tweaks * Rename talljoe_gherkin to talljoe-gherkin * Make NAV layer tab C_S_T also. * Add missing RESET key. * Add Talljoe layout for minivan. * MTI is not for me * Tweak keymap. * Add talljoe keymap to Atreus. * Minor tweaks. * Fix talljoe keymaps to work with new Zeal60 commit.
Diffstat (limited to 'users')
-rw-r--r--users/talljoe/config.h2
-rw-r--r--users/talljoe/talljoe.c53
-rw-r--r--users/talljoe/talljoe.h76
-rw-r--r--users/talljoe/tapdance.c148
4 files changed, 225 insertions, 54 deletions
diff --git a/users/talljoe/config.h b/users/talljoe/config.h
index 1cdbb5a41..0d06a0b12 100644
--- a/users/talljoe/config.h
+++ b/users/talljoe/config.h
@@ -1,7 +1,7 @@
1#ifndef USERSPACE_CONFIG_H 1#ifndef USERSPACE_CONFIG_H
2#define USERSPACE_CONFIG_H 2#define USERSPACE_CONFIG_H
3 3
4#define IGNORE_MOD_TAP_INTERRUPT 4#define PERMISSIVE_HOLD
5 5
6#define RESET_LAYER 15 6#define RESET_LAYER 15
7 7
diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c
index e9c69b016..7a343e776 100644
--- a/users/talljoe/talljoe.c
+++ b/users/talljoe/talljoe.c
@@ -5,10 +5,10 @@
5const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 5const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
6 [_BASE] = TEMPLATE_TKL( 6 [_BASE] = TEMPLATE_TKL(
7 KC_ESC, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, KC_SLCK, MO_ADJ , 7 KC_ESC, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PSCR, KC_SLCK, MO_ADJ ,
8 KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_INS , KC_HOME, KC_PGUP, 8 US_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , US_BSLS, KC_INS , KC_HOME, KC_PGUP,
9 KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T , KC_Y, KC_U, KC_I, KC_O, KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , KC_END , KC_PGDN, 9 US_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T , KC_Y, KC_U, KC_I, KC_O, KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , KC_END , KC_PGDN,
10 US_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT , 10 CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT ,
11 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP , 11 SH_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SH_RBRC, KC_UP ,
12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT), 12 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT),
13 [_WORKMAN] = TEMPLATE( 13 [_WORKMAN] = TEMPLATE(
14 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 14 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
@@ -34,41 +34,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34 _______, KC_A, KC_R, KC_S, KC_T, KC_D , KC_H, KC_N, KC_E, KC_I, KC_O , _______, _______, 34 _______, KC_A, KC_R, KC_S, KC_T, KC_D , KC_H, KC_N, KC_E, KC_I, KC_O , _______, _______,
35 _______, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, 35 _______, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______,
36 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), 36 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
37 37#if (SPACE_COUNT > 1)
38 // A tweaked version of the Maltron layout
39 [_MALTROFF] = TEMPLATE(
40 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
41 _______, KC_Q, KC_P, KC_Y, KC_G, KC_B , KC_J, KC_M, KC_U, KC_K, KC_L, _______, _______, _______,
42 _______, KC_A, KC_N, KC_I, KC_S, KC_F , KC_D, KC_T, KC_H, KC_O, KC_R , US_ENT , KC_BSPC,
43 _______, KC_Z, KC_X, KC_C, KC_V, US_QUOT, KC_SCLN, KC_W, KC_COMM, KC_DOT, KC_SLSH, _______, _______,
44 _______, _______, _______, MLT_E , _______, _______, _______, _______, _______, _______),
45#endif
38#ifdef ENABLE_GAME_LAYER 46#ifdef ENABLE_GAME_LAYER
39 [_GAME] = TEMPLATE( 47 [_GAME] = TEMPLATE(
40 KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_GRV, 48 KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_GRV,
41 KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, 49 KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC,
42 MO_NAV , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , 50 MO_NAV , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT ,
43 KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO_ADJ , 51 KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO_ADJ ,
44 KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ), 52 KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ),
45#endif 53#endif
46 [_NAV] = TEMPLATE( 54 [_NAV] = TEMPLATE_NAV(
47 KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 55 KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
48 KC_TAB , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_VOLU, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN2, KC_BTN3, KC_DEL , 56 US_TAB , KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN3, KC_BTN2, KC_DEL ,
49 US_CAPS, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_MUTE, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , KC_RCTL, TG_ADJ , 57 CTL_ESC, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_AMPR, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , US_QUOT, TG_ADJ ,
50 KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_END , KC_PGDN, KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP , 58 KC_LSFT, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, KC_ASTR, KC_CALC, US_GRV , KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP ,
51 KC_LCTL, KC_LGUI, KC_LALT, NV_SPC2, NV_SPC1, NV_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT ), 59 KC_LCTL, KC_LGUI, KC_LALT, NV_SPC2, NV_SPC1, NV_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT ),
52 [_NUM] = TEMPLATE( 60 [_NUM] = TEMPLATE_NUM(
53 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 61 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
54 KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, XXXXXXX, KC_DEL , 62 KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_VOLU, KC_CIRC, KC_7, KC_8, KC_9, KC_PMNS, XXXXXXX, XXXXXXX, KC_DEL ,
55 US_CAPS, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_PPLS, KC_PENT, XXXXXXX, 63 CTL_ESC, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_MUTE, KC_PENT, KC_4, KC_5, KC_6, KC_PPLS, XXXXXXX, KC_ENT ,
56 KC_LSFT, KC_EQL, KC_PLUS, KC_BSLS, KC_PIPE, KC_SCLN, XXXXXXX, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, XXXXXXX, 64 KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_PIPE, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, TG_NUM ,
57 KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ), 65 KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ),
58 // Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards) 66 // Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards)
59 [_ADJUST] = TEMPLATE( 67 [_ADJUST] = TEMPLATE_ADJUST(
60 MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(6) , FX(7) , FX(8) , FX(9) , FX(10) , BR_DEC , BR_INC , XXXXXXX, MO_RST , 68 MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(8) , FX(9) , FX(10) , FX(20) , FX(0) , BR_DEC , BR_INC , XXXXXXX, MO_RST ,
61 XXXXXXX, H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, KC_DEL , 69 MO_RST , H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, MO_RST ,
62 XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ , 70 XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ ,
63 TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX, 71 TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, LY_MALT, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX,
64 MO_RST , AG_NORM, AG_SWAP, XXXXXXX, BL_STEP, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME), 72 MO_RST , AG_SWAP, AG_NORM, XXXXXXX, BL_TOGG, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME),
65 // To Reset hit FN + ` + Esc 73 // To Reset hit FN + ` + Esc
66 [_RESET] = TEMPLATE( 74 [_RESET] = TEMPLATE_RESET,
67 RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET ,
68 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
69 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
70 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
71 RESET , XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX),
72}; 75};
73 76
74void matrix_scan_user(void) { 77void matrix_scan_user(void) {
diff --git a/users/talljoe/talljoe.h b/users/talljoe/talljoe.h
index 7c34cd41f..4436c0a04 100644
--- a/users/talljoe/talljoe.h
+++ b/users/talljoe/talljoe.h
@@ -8,7 +8,7 @@ enum userspace_custom_keycodes {
8 DFAULTS, 8 DFAULTS,
9 TOGGLE_BACKLIGHT, 9 TOGGLE_BACKLIGHT,
10 EFFECT, 10 EFFECT,
11 EFFECT_END = EFFECT + 10 11 EFFECT_END = EFFECT + 20
12}; 12};
13 13
14#ifndef RESET_LAYER 14#ifndef RESET_LAYER
@@ -21,6 +21,7 @@ enum layers {
21 _NORMAN, 21 _NORMAN,
22 _DVORAK, 22 _DVORAK,
23 _COLMAK, 23 _COLMAK,
24 _MALTROFF,
24 _GAME, 25 _GAME,
25 _NAV, 26 _NAV,
26 _NUM, 27 _NUM,
@@ -29,7 +30,9 @@ enum layers {
29}; 30};
30 31
31enum tap_dancers { 32enum tap_dancers {
32 TD_SEMICOLON 33 TD_SEMICOLON,
34 TD_GRAVE,
35 TD_QUOTE,
33}; 36};
34 37
35#define _______ KC_TRNS 38#define _______ KC_TRNS
@@ -39,6 +42,7 @@ enum tap_dancers {
39#define MO_ADJ MO(_ADJUST) 42#define MO_ADJ MO(_ADJUST)
40#define MO_RST MO(_RESET) 43#define MO_RST MO(_RESET)
41#define TG_ADJ TG(_ADJUST) 44#define TG_ADJ TG(_ADJUST)
45#define TG_NUM TG(_NUM)
42#ifdef ENABLE_GAME_LAYER 46#ifdef ENABLE_GAME_LAYER
43 #define TG_GAME TG(_GAME) 47 #define TG_GAME TG(_GAME)
44#else 48#else
@@ -49,16 +53,28 @@ enum tap_dancers {
49#define LY_NRMN DF(_NORMAN) 53#define LY_NRMN DF(_NORMAN)
50#define LY_DVRK DF(_DVORAK) 54#define LY_DVRK DF(_DVORAK)
51#define LY_CLMK DF(_COLMAK) 55#define LY_CLMK DF(_COLMAK)
56#if SPACE_COUNT >= 2
57 #define LY_MALT DF(_MALTROFF)
58#else
59 #define LY_MALT KC_NO
60#endif
52#define TG_NKRO MAGIC_TOGGLE_NKRO 61#define TG_NKRO MAGIC_TOGGLE_NKRO
53#define KC_PTT KC_F24 62#define KC_PTT KC_F24
54#define MS_MID KC_MS_BTN3 63#define MS_MID KC_MS_BTN3
55#define FX(x) (EFFECT + x) 64#define FX(x) (EFFECT + x)
56 65
57#define US_CAPS CTL_T(KC_ESC) 66#define CTL_ESC CTL_T(KC_ESC)
58#define US_QUOT RCTL_T(KC_QUOT) 67#define US_ENT RCTL_T(KC_ENT)
59#define US_MINS RCTL_T(KC_QUOT) 68#define US_MINS RCTL_T(KC_QUOT)
69#define US_BSLS LCA_T(KC_BSLS)
60#define US_SCLN TD(TD_SEMICOLON) 70#define US_SCLN TD(TD_SEMICOLON)
61#define US_ENT LT(_NUM, KC_ENT) 71#define US_GRV TD(TD_GRAVE)
72#define US_QUOT TD(TD_QUOTE)
73#define US_TAB C_S_T(KC_TAB)
74#define SH_LBRC LSFT_T(KC_LBRC)
75#define SH_RBRC RSFT_T(KC_RBRC)
76
77#define MLT_E LT(_NUM, KC_E)
62 78
63#ifndef SPACE_COUNT 79#ifndef SPACE_COUNT
64 #define SPACE_COUNT 1 80 #define SPACE_COUNT 1
@@ -75,17 +91,34 @@ enum tap_dancers {
75 #define NM_SPC1 _______ 91 #define NM_SPC1 _______
76 #define NM_SPC2 _______ 92 #define NM_SPC2 _______
77 #define NM_SPC3 _______ 93 #define NM_SPC3 _______
94#elif (SPACE_COUNT == 2)
95 #define KC_SPC1 LT(_NAV,KC_SPC)
96 #define KC_SPC2 LT(_NUM,KC_ENT)
97
98 #define NV_SPC1 KC_SPC
99 #define NV_SPC2 KC_ENT
100
101 #define NM_SPC1 KC_0
102 #define NM_SPC2 KC_SPC
103
104 #define KC_SPC3 XXXXXXX
105 #define NV_SPC3 XXXXXXX
106 #define NM_SPC3 XXXXXXX
78#elif (SPACE_COUNT == 3) 107#elif (SPACE_COUNT == 3)
79 #define KC_SPC1 KC_BSPC 108 #ifdef SWAP_HANDS_ENABLE
109 #define KC_SPC1 SH_T(KC_BSPC)
110 #else
111 #define KC_SPC1 KC_BSPC
112 #endif
80 #define KC_SPC2 LT(_NUM,KC_ENT) 113 #define KC_SPC2 LT(_NUM,KC_ENT)
81 #define KC_SPC3 LT(_NAV,KC_SPC) 114 #define KC_SPC3 LT(_NAV,KC_SPC)
82 115
83 #define NV_SPC1 KC_SPC 116 #define NV_SPC1 KC_SPC
84 #define NV_SPC2 C_S_T(KC_ENT) 117 #define NV_SPC2 KC_ENT
85 #define NV_SPC3 KC_SPC 118 #define NV_SPC3 KC_SPC
86 119
87 #define NM_SPC2 XXXXXXX
88 #define NM_SPC1 KC_SPC 120 #define NM_SPC1 KC_SPC
121 #define NM_SPC2 XXXXXXX
89 #define NM_SPC3 KC_0 122 #define NM_SPC3 KC_0
90#else 123#else
91 #error "Unsupported space count:" SPACE_COUNT 124 #error "Unsupported space count:" SPACE_COUNT
@@ -110,7 +143,7 @@ enum tap_dancers {
110 #define FN_MO2 KC_NO 143 #define FN_MO2 KC_NO
111#endif 144#endif
112 145
113#ifdef TEMPLATE_TKL 146#ifndef TEMPLATE
114 #define _X_ KC_NO 147 #define _X_ KC_NO
115 #define TEMPLATE( \ 148 #define TEMPLATE( \
116 KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KJ6, \ 149 KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KJ6, \
@@ -126,7 +159,8 @@ enum tap_dancers {
126 KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, _X_, \ 159 KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, _X_, \
127 KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, _X_, _X_, _X_ \ 160 KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, _X_, _X_, _X_ \
128 ) 161 )
129#else 162#endif
163#ifndef TEMPLATE_TKL
130 #define TEMPLATE_TKL( \ 164 #define TEMPLATE_TKL( \
131 KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ 165 KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
132 KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ 166 KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \
@@ -143,4 +177,26 @@ enum tap_dancers {
143 ) 177 )
144#endif 178#endif
145 179
180#ifndef TEMPLATE_ALT
181 #define TEMPLATE_ALT TEMPLATE
182#endif
183#ifndef TEMPLATE_NUM
184 #define TEMPLATE_NUM TEMPLATE_ALT
185#endif
186#ifndef TEMPLATE_NAV
187 #define TEMPLATE_NAV TEMPLATE_ALT
188#endif
189#ifndef TEMPLATE_ADJUST
190 #define TEMPLATE_ADJUST TEMPLATE_ALT
191#endif
192
193#ifndef TEMPLATE_RESET
194 #define TEMPLATE_RESET TEMPLATE_ALT( \
195 RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , \
196 RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , \
197 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
198 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
199 RESET , XXXXXXX, XXXXXXX, XXXXXXX, RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX)
200#endif
201
146#endif 202#endif
diff --git a/users/talljoe/tapdance.c b/users/talljoe/tapdance.c
index 3198fc67f..c4d6025f0 100644
--- a/users/talljoe/tapdance.c
+++ b/users/talljoe/tapdance.c
@@ -1,34 +1,146 @@
1//Tap Dance 1//Tap Dance
2#include "talljoe.h" 2#include "talljoe.h"
3 3
4// Send semin-colon + enter on two taps 4enum {
5void tap_dance_semicolon(qk_tap_dance_state_t *state, void *user_data) { 5 SINGLE_TAP = 1,
6 SINGLE_HOLD = 2,
7 DOUBLE_TAP = 3,
8 DOUBLE_HOLD = 4,
9 DOUBLE_SINGLE_TAP = 5, //send two single taps
10 TRIPLE_TAP = 6,
11 TRIPLE_HOLD = 7,
12 SPECIAL = 8
13};
14
15static struct {
16 int quote;
17 int semicolon;
18} tap_state = {0};
19
20int cur_dance (qk_tap_dance_state_t *state) {
21 if (state->count == 1) {
22 //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP
23 if (state->interrupted) {
24 // if (!state->pressed) return SINGLE_TAP;
25 //need "permissive hold" here.
26 // else return SINGLE_HOLD;
27 //If the interrupting key is released before the tap-dance key, then it is a single HOLD
28 //However, if the tap-dance key is released first, then it is a single TAP
29 //But how to get access to the state of the interrupting key????
30 return SINGLE_TAP;
31 }
32 else {
33 if (!state->pressed) return SINGLE_TAP;
34 else return SINGLE_HOLD;
35 }
36 }
37 //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
38 //with single tap.
39 else if (state->count == 2) {
40 if (state->interrupted) return DOUBLE_SINGLE_TAP;
41 else if (state->pressed) return DOUBLE_HOLD;
42 else return DOUBLE_TAP;
43 }
44 else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP;
45 else if (state->count == 3) return TRIPLE_HOLD;
46 else return SPECIAL;
47}
48
49int hold_cur_dance (qk_tap_dance_state_t *state) {
50 if (state->count == 1) {
51 if (state->interrupted) {
52 if (!state->pressed) return SINGLE_TAP;
53 else return SINGLE_HOLD;
54 }
55 else {
56 if (!state->pressed) return SINGLE_TAP;
57 else return SINGLE_HOLD;
58 }
59 }
60 //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
61 //with single tap.
62 else if (state->count == 2) {
63 if (state->pressed) return DOUBLE_HOLD;
64 else return DOUBLE_TAP;
65 }
66 else if (state->count == 3) {
67 if (!state->pressed) return TRIPLE_TAP;
68 else return TRIPLE_HOLD;
69 }
70 else return SPECIAL;
71}
72
73// Send semi-colon + enter on two taps
74void tap_dance_semicolon_finished(qk_tap_dance_state_t *state, void *user_data) {
75 tap_state.semicolon = hold_cur_dance(state);
76 switch (tap_state.semicolon) {
77 case SINGLE_TAP: case DOUBLE_HOLD: register_code(KC_SCLN); break;
78 case SINGLE_HOLD: layer_on(_NUM); break;
79 }
80}
81
82void tap_dance_semicolon_reset(qk_tap_dance_state_t *state, void *user_data) {
83 switch (tap_state.semicolon) {
84 case SINGLE_TAP: case DOUBLE_HOLD: unregister_code(KC_SCLN); break;
85 case DOUBLE_TAP: {
86 if (get_mods()) {
87 SEND_STRING(";;"); // send normal when mods are pressed
88 }
89 else {
90 SEND_STRING(";\n");
91 }
92 break;
93 }
94 case TRIPLE_TAP: {
95 SEND_STRING(";\n\n");
96 }
97 case SPECIAL: layer_invert(_NUM); break;
98 case SINGLE_HOLD: layer_off(_NUM); break;
99 }
100 tap_state.semicolon = 0;
101}
102
103// Send `. ~. ```
104void tap_dance_grave_finished(qk_tap_dance_state_t *state, void *user_data) {
6 switch(state->count) { 105 switch(state->count) {
7 case 1: 106 case 1:
8 register_code(KC_SCLN); 107 SEND_STRING("`");
9 unregister_code(KC_SCLN);
10 break; 108 break;
11 case 2: 109 case 2:
12 register_code(KC_SCLN); 110 SEND_STRING("~");
13 unregister_code(KC_SCLN); 111 break;
112 }
113}
14 114
15 uint8_t mods = get_mods(); 115void tap_dance_grave_each(qk_tap_dance_state_t *state, void *user_data) {
16 if (mods) { 116 if(state->count == 3) {
17 clear_mods(); 117 SEND_STRING("```");
18 } 118 } else if (state->count > 3) {
119 SEND_STRING("`");
120 }
121}
19 122
20 register_code(KC_ENT);
21 unregister_code(KC_ENT);
22 123
23 if (mods) { 124void tap_dance_quote_finished(qk_tap_dance_state_t *state, void *user_data) {
24 set_mods(mods); 125 tap_state.quote = hold_cur_dance(state);
25 } 126 switch (tap_state.quote) {
127 case SINGLE_TAP: case DOUBLE_HOLD: register_code(KC_QUOT); break;
128 case SINGLE_HOLD: layer_on(_NAV); break;
129 }
130}
26 131
27 reset_tap_dance(state); 132void tap_dance_quote_reset(qk_tap_dance_state_t *state, void *user_data) {
28 break; 133 switch (tap_state.quote) {
134 case SINGLE_TAP: case DOUBLE_HOLD: unregister_code(KC_QUOTE); break;
135 case DOUBLE_TAP: SEND_STRING("\""); break;
136 case TRIPLE_TAP: layer_invert(_NAV); break;
137 case SINGLE_HOLD: layer_off(_NAV); break;
29 } 138 }
139 tap_state.quote = 0;
30} 140}
31 141
32qk_tap_dance_action_t tap_dance_actions[] = { 142qk_tap_dance_action_t tap_dance_actions[] = {
33 [TD_SEMICOLON] = ACTION_TAP_DANCE_FN(tap_dance_semicolon), 143 [TD_SEMICOLON] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_semicolon_finished, tap_dance_semicolon_reset),
144 [TD_GRAVE] = ACTION_TAP_DANCE_FN_ADVANCED(tap_dance_grave_each, tap_dance_grave_finished, NULL),
145 [TD_QUOTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_quote_finished, tap_dance_quote_reset),
34}; 146};