aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorJonas Avellana <14019120+ninjonas@users.noreply.github.com>2020-03-13 17:56:21 -0600
committerGitHub <noreply@github.com>2020-03-13 16:56:21 -0700
commit0fdd37ee19d07d6f15217074dd3291fda4c4cb2f (patch)
tree595a398a2977755695c1903cdf71b6fcf2ce03aa /users
parent40e8d60ecd68c1c43e1fc911e993626943930fd0 (diff)
downloadqmk_firmware-0fdd37ee19d07d6f15217074dd3291fda4c4cb2f.tar.gz
qmk_firmware-0fdd37ee19d07d6f15217074dd3291fda4c4cb2f.zip
[Keymap] ninjonas keymap updates (#8373)
* [keymap(ninjonas)] ninjonas keymap updates * [refactor] switching encoder rotation logic. recent pull seems to have flipped encoder stuff * [keymap(lily58)] added chrome change profile key on RAISE Co-authored-by: Jonas Avellana <jonas.avellana@workday.com>
Diffstat (limited to 'users')
-rw-r--r--users/ninjonas/README.md25
-rw-r--r--users/ninjonas/combos.c55
-rw-r--r--users/ninjonas/config.h11
-rw-r--r--users/ninjonas/encoder.c104
-rw-r--r--users/ninjonas/ninjonas.h23
-rw-r--r--users/ninjonas/process_records.c14
-rw-r--r--users/ninjonas/process_records.h1
-rw-r--r--users/ninjonas/rules.mk5
-rw-r--r--users/ninjonas/tap_dances.c66
-rw-r--r--users/ninjonas/tap_dances.h14
10 files changed, 242 insertions, 76 deletions
diff --git a/users/ninjonas/README.md b/users/ninjonas/README.md
index f537373bc..f6c2f3235 100644
--- a/users/ninjonas/README.md
+++ b/users/ninjonas/README.md
@@ -23,8 +23,6 @@ See: https://docs.qmk.fm/#/feature_userspace
23|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q | 23|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q |
24|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard | 24|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard |
25|K_MDSH | MacOS shortcut to get em-dash `–` | 25|K_MDSH | MacOS shortcut to get em-dash `–` |
26|K_RAPP | MacOS shortcut to switch apps to the right |
27|K_LAPP | MacOS shortcut to switch apps to the left |
28|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles | 26|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles |
29 27
30### [Layers](ninjonas.h) 28### [Layers](ninjonas.h)
@@ -32,17 +30,12 @@ See: https://docs.qmk.fm/#/feature_userspace
32|---|---| 30|---|---|
33|LT_LOW | Tap for ENTER, hold for RAISE | 31|LT_LOW | Tap for ENTER, hold for RAISE |
34|LT_RAI | Tap for SPACE, hold for LOWER | 32|LT_RAI | Tap for SPACE, hold for LOWER |
35|LT_LOW + LT_RAI | Hold for ADJUST |
36|LM_LOW | Dedicated key to momentarily toggle to use LOWER layer |
37|LM_RAI | Dedicated key to momentarily toggle to use RAISE layer |
38|LG_LOW | Press to toggle LOWER layer |
39|LG_RAI | Press to toggle RAISE layer |
40 33
41### [Mod-Taps](ninjonas.h) 34### [Mod-Taps](ninjonas.h)
42|Code | Description | 35|Code | Description |
43|---|---| 36|---|---|
44|MT_DEL | Tap for Delete, hold for Cmd + ALT + SHIFT | 37|MT_DEL | Tap for Delete, hold for ALT + SHIFT |
45|MT_EQL | Tap for =, hold for ALT + SHIFT | 38|MT_EQL | Tap for =, SHIFT |
46 39
47### [Layout Blocks](ninjonas.h) 40### [Layout Blocks](ninjonas.h)
48Predefined keyboard layout templates to speed up configuring split keyboards 41Predefined keyboard layout templates to speed up configuring split keyboards
@@ -72,7 +65,6 @@ Predefined keyboard layout templates to speed up configuring split keyboards
72|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) | 65|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
73|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory | 66|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
74|M_TERM | Launches Spotlight and calls Terminal | 67|M_TERM | Launches Spotlight and calls Terminal |
75|M_COPA | Single key copy/paste |
76|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) | 68|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |
77 69
78### [Tap-Dance](tap_dances.h) 70### [Tap-Dance](tap_dances.h)
@@ -84,11 +76,18 @@ Predefined keyboard layout templates to speed up configuring split keyboards
84|T_TAB | Tap once for TAB, double for CTRL + TAB | 76|T_TAB | Tap once for TAB, double for CTRL + TAB |
85|T_GRV | Tap once for GRV, double for Cmd + GRV | 77|T_GRV | Tap once for GRV, double for Cmd + GRV |
86|T_GUI | Tap once for Cmd, double to open spotlight | 78|T_GUI | Tap once for Cmd, double to open spotlight |
87|T_W | Tap for W, double tap for Cmd + W | 79|T_CPAP | Tap for Cmd + V, hold for Cmd + C, double tap to open [Line](https://line.me/en/) app, triple tap for itunes. |
88|T_Q | Tap for Q, double tap for Cmd + Q |
89|T_CPNU | Tap for Cmd + V, hold for Cmd + C, double tap for NUMPAD layer |
90|T_Y | Tap for Y, double tap for NUMPAD layer | 80|T_Y | Tap for Y, double tap for NUMPAD layer |
91 81
82### [Combos](combos.h)
83|Code | Description |
84|---|---|
85|EQ_QUIT | Press E + Q will trigger Cmd + Q |
86|RW_CLOSE | Press R + W will trigger Cmd + W|
87|ET_TAB | Press E + T will trigger Cmd + T|
88|ZC_COPY | Press Z + C will trigger Cmd + C|
89|XV_PASTE | Press X + V will trigger Cmd + V|
90
92### Secrets 91### Secrets
93There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used. 92There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
94 93
diff --git a/users/ninjonas/combos.c b/users/ninjonas/combos.c
new file mode 100644
index 000000000..9453ba84d
--- /dev/null
+++ b/users/ninjonas/combos.c
@@ -0,0 +1,55 @@
1#include "ninjonas.h"
2
3#ifdef COMBO_ENABLE
4enum combo_events {
5 EQ_QUIT,
6 RW_CLOSE,
7 QT_TAB,
8 ZC_COPY,
9 XV_PASTE
10};
11
12const uint16_t PROGMEM quit_combo[] = {KC_E, KC_Q, COMBO_END};
13const uint16_t PROGMEM close_combo[] = {KC_R, KC_W, COMBO_END};
14const uint16_t PROGMEM tab_combo[] = {KC_Q, KC_T, COMBO_END};
15const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
16const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};
17
18combo_t key_combos[COMBO_COUNT] = {
19 [EQ_QUIT] = COMBO_ACTION(quit_combo),
20 [RW_CLOSE] = COMBO_ACTION(close_combo),
21 [QT_TAB] = COMBO_ACTION(tab_combo),
22 [ZC_COPY] = COMBO_ACTION(copy_combo),
23 [XV_PASTE] = COMBO_ACTION(paste_combo),
24};
25
26void process_combo_event(uint8_t combo_index, bool pressed) {
27 switch(combo_index) {
28 case EQ_QUIT:
29 if (pressed) {
30 tap_code16(LGUI(KC_Q));
31 }
32 break;
33 case RW_CLOSE:
34 if (pressed) {
35 tap_code16(LGUI(KC_W));
36 }
37 break;
38 case QT_TAB:
39 if (pressed) {
40 tap_code16(LGUI(KC_T));
41 }
42 break;
43 case ZC_COPY:
44 if (pressed) {
45 tap_code16(LGUI(KC_C));
46 }
47 break;
48 case XV_PASTE:
49 if (pressed) {
50 tap_code16(LGUI(KC_V));
51 }
52 break;
53 }
54}
55#endif \ No newline at end of file
diff --git a/users/ninjonas/config.h b/users/ninjonas/config.h
index ae2370c5a..025dbb541 100644
--- a/users/ninjonas/config.h
+++ b/users/ninjonas/config.h
@@ -1,6 +1,6 @@
1#ifdef TAPPING_TERM 1#ifdef TAPPING_TERM
2 #undef TAPPING_TERM 2 #undef TAPPING_TERM
3 #define TAPPING_TERM 300 3 #define TAPPING_TERM 200
4#endif 4#endif
5 5
6// Mouse Settings: Smoothing out mouse movement on keypress 6// Mouse Settings: Smoothing out mouse movement on keypress
@@ -11,4 +11,11 @@
11#define MOUSEKEY_DELAY 0 11#define MOUSEKEY_DELAY 0
12#define MOUSEKEY_TIME_TO_MAX 60 12#define MOUSEKEY_TIME_TO_MAX 60
13#define MOUSEKEY_MAX_SPEED 7 13#define MOUSEKEY_MAX_SPEED 7
14#define MOUSEKEY_WHEEL_DELAY 0 \ No newline at end of file 14#define MOUSEKEY_WHEEL_DELAY 0
15
16#ifdef COMBO_ENABLE
17 #undef COMBO_COUNT
18 #undef COMBO_TERM
19 #define COMBO_COUNT 5
20 #define COMBO_TERM 60
21#endif \ No newline at end of file
diff --git a/users/ninjonas/encoder.c b/users/ninjonas/encoder.c
new file mode 100644
index 000000000..3d56ff89e
--- /dev/null
+++ b/users/ninjonas/encoder.c
@@ -0,0 +1,104 @@
1/* Copyright 2020 ninjonas
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "ninjonas.h"
17
18#ifdef ENCODER_ENABLE
19void left_encoder_cw(void) {
20 switch (get_highest_layer(layer_state)) {
21 case _LOWER:
22 tap_code16(LGUI(KC_TAB));
23 break;
24 case _RAISE:
25 tap_code(KC_PGDN);
26 break;
27 case _ADJUST:
28 rgblight_decrease_hue();
29 break;
30 default:
31 tap_code(KC_BRID);
32 break;
33 }
34}
35void left_encoder_acw(void) {
36 switch (get_highest_layer(layer_state)) {
37 case _LOWER:
38 tap_code16(SGUI(KC_TAB));
39 break;
40 case _RAISE:
41 tap_code(KC_PGUP);
42 break;
43 case _ADJUST:
44 rgblight_increase_hue();
45 break;
46 default:
47 tap_code(KC_BRIU);
48 break;
49 }
50}
51void right_encoder_cw(void) {
52 switch (get_highest_layer(layer_state)) {
53 case _LOWER:
54 tap_code(KC_DOWN);
55 break;
56 case _RAISE:
57 tap_code16(LCTL(LSFT(KC_TAB)));
58 break;
59 case _ADJUST:
60 rgblight_decrease_val();
61 break;
62 default:
63 tap_code(KC_VOLD);
64 break;
65 }
66}
67void right_encoder_acw(void) {
68 switch (get_highest_layer(layer_state)) {
69 case _LOWER:
70 tap_code(KC_UP);
71 break;
72 case _RAISE:
73 tap_code16(LCTL(KC_TAB));
74 break;
75 case _ADJUST:
76 rgblight_increase_val();
77 break;
78 default:
79 tap_code(KC_VOLU);
80 break;
81 }
82}
83
84void encoder_update_user(uint8_t index, bool clockwise) {
85 encoder_rotated_timer = timer_read();
86 if (index == 0) {
87 left_encoder_rotated = true;
88 if (clockwise) {
89 left_encoder_cw();
90 } else {
91 left_encoder_acw();
92 }
93 }
94 else if (index == 1) {
95 right_encoder_rotated = true;
96 if (clockwise) {
97 right_encoder_cw();
98 } else {
99 right_encoder_acw();
100 }
101 }
102}
103
104#endif \ No newline at end of file
diff --git a/users/ninjonas/ninjonas.h b/users/ninjonas/ninjonas.h
index 6772957e2..94b4712a6 100644
--- a/users/ninjonas/ninjonas.h
+++ b/users/ninjonas/ninjonas.h
@@ -27,6 +27,12 @@
27 #include "split_util.h" 27 #include "split_util.h"
28#endif 28#endif
29 29
30#ifdef ENCODER_ENABLE
31bool left_encoder_rotated;
32bool right_encoder_rotated;
33uint16_t encoder_rotated_timer;
34#endif
35
30#define _QWERTY 0 36#define _QWERTY 0
31#define _DVORAK 1 37#define _DVORAK 1
32#define _COLEMAK 2 38#define _COLEMAK 2
@@ -40,24 +46,17 @@
40#define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard 46#define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard
41#define K_CPRF LGUI(LSFT(KC_M)) // Cmd + Shift + M. Used for switching Google Chrome profiles 47#define K_CPRF LGUI(LSFT(KC_M)) // Cmd + Shift + M. Used for switching Google Chrome profiles
42#define K_MDSH LSFT(LALT(KC_MINS)) 48#define K_MDSH LSFT(LALT(KC_MINS))
43#define K_LAPP SGUI(KC_TAB) // Cmd + Shift + Tab
44#define K_RAPP LGUI(KC_TAB) // Cmd + Tab
45 49
46// Layer Keys 50// Layer Keys
47#define LM_LOW MO(_LOWER)
48#define LM_RAI MO(_RAISE)
49#define LG_LOW TG(_LOWER)
50#define LG_RAI TG(_RAISE)
51#define LG_NUM TG(_NUMPAD)
52#define LT_LOW LT(_LOWER, KC_ENT) 51#define LT_LOW LT(_LOWER, KC_ENT)
53#define LT_RAI LT(_RAISE, KC_SPC) 52#define LT_RAI LT(_RAISE, KC_SPC)
54 53
55// Mod-Tap Keys 54// Mod-Tap Keys
56#define MT_DEL MT(MOD_LGUI | MOD_LALT | MOD_LSFT, KC_DEL) 55#define MT_DEL MT(MOD_LALT | MOD_LSFT, KC_DEL)
57#define MT_EQL MT(MOD_LALT | MOD_LSFT, KC_EQL) 56#define MT_EQL MT(MOD_RSFT, KC_EQL)
58 57
59// Layout blocks 58// Layout blocks
60#define _____________________QWERTY_L1______________________ T_TAB, T_Q, KC_W, KC_E, KC_R, KC_T 59#define _____________________QWERTY_L1______________________ T_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
61#define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G 60#define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G
62#define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B 61#define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
63 62
@@ -130,7 +129,7 @@
130#define __________________________________ _______, _______, _______, _______ 129#define __________________________________ _______, _______, _______, _______
131 130
132#define _____________MOD_LEFT_____________ KC_LALT, T_GUI, KC_LCTL, LT_RAI 131#define _____________MOD_LEFT_____________ KC_LALT, T_GUI, KC_LCTL, LT_RAI
133#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPNU 132#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPAP
134 133
135#define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE 134#define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE
136#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP 135#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP
@@ -141,7 +140,7 @@
141 #define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL 140 #define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL
142#else 141#else
143 #define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL 142 #define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL
144 #define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPNU 143 #define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPAP
145#endif 144#endif
146 145
147// Layout wrappers 146// Layout wrappers
diff --git a/users/ninjonas/process_records.c b/users/ninjonas/process_records.c
index b4a5e35d1..a3b841791 100644
--- a/users/ninjonas/process_records.c
+++ b/users/ninjonas/process_records.c
@@ -1,7 +1,5 @@
1#include "ninjonas.h" 1#include "ninjonas.h"
2 2
3uint16_t copy_paste_timer;
4
5__attribute__((weak)) 3__attribute__((weak))
6bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } 4bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
7 5
@@ -92,18 +90,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
92 } 90 }
93 break; 91 break;
94 92
95 // Single key copy/paste
96 case M_COPA:
97 if (record->event.pressed) {
98 copy_paste_timer = timer_read();
99 } else {
100 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) {
101 tap_code16(LGUI(KC_C)); // Hold Cmd + C
102 } else {
103 tap_code16(LGUI(KC_V)); // Tap Cmd + V
104 }
105 }
106
107 // BEGIN: Layer macros 93 // BEGIN: Layer macros
108 case QWERTY: 94 case QWERTY:
109 if (record->event.pressed) { 95 if (record->event.pressed) {
diff --git a/users/ninjonas/process_records.h b/users/ninjonas/process_records.h
index 34886531a..2e69ca216 100644
--- a/users/ninjonas/process_records.h
+++ b/users/ninjonas/process_records.h
@@ -15,7 +15,6 @@ enum custom_keycodes {
15 M_VRSN, 15 M_VRSN,
16 M_CODE, 16 M_CODE,
17 M_TERM, 17 M_TERM,
18 M_COPA,
19 // Secret Macros 18 // Secret Macros
20 M_XXX1, 19 M_XXX1,
21 M_XXX2, 20 M_XXX2,
diff --git a/users/ninjonas/rules.mk b/users/ninjonas/rules.mk
index 7b77e153d..a5cd0fdd9 100644
--- a/users/ninjonas/rules.mk
+++ b/users/ninjonas/rules.mk
@@ -2,11 +2,14 @@ BOOTMAGIC_ENABLE = no # Disable Boot Magic (https://beta.docs.qmk.fm/featu
2MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 2MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4TAP_DANCE_ENABLE = yes # Enable Tap Dance. 4TAP_DANCE_ENABLE = yes # Enable Tap Dance.
5COMBO_ENABLE = yes # Enable Combos
5 6
6SRC += ninjonas.c \ 7SRC += ninjonas.c \
7 process_records.c \ 8 process_records.c \
8 tap_dances.c \ 9 tap_dances.c \
9 oled.c 10 oled.c \
11 encoder.c \
12 combos.c
10 13
11ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") 14ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
12 SRC += secrets.c 15 SRC += secrets.c
diff --git a/users/ninjonas/tap_dances.c b/users/ninjonas/tap_dances.c
index ece95887a..63e4d3ba4 100644
--- a/users/ninjonas/tap_dances.c
+++ b/users/ninjonas/tap_dances.c
@@ -2,28 +2,41 @@
2 2
3//// BEGIN: Advanced Tap Dances 3//// BEGIN: Advanced Tap Dances
4int cur_dance (qk_tap_dance_state_t *state) { 4int cur_dance (qk_tap_dance_state_t *state) {
5 if (state->count == 1) { 5 if (state->count == 1) {
6 if (!state->pressed) { 6 if (state->interrupted || !state->pressed) return SINGLE_TAP;
7 return SINGLE_TAP; 7 //key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'.
8 } else { 8 else return SINGLE_HOLD;
9 return SINGLE_HOLD;
10 }
11 } else if (state->count == 2) {
12 return DOUBLE_TAP;
13 } 9 }
14 else return 8; 10 else if (state->count == 2) {
11 /*
12 * DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
13 * action when hitting 'pp'. Suggested use case for this return value is when you want to send two
14 * keystrokes of the key, and not the 'double tap' action/macro.
15 */
16 if (state->interrupted) return DOUBLE_SINGLE_TAP;
17 else if (state->pressed) return DOUBLE_HOLD;
18 else return DOUBLE_TAP;
19 }
20 //Assumes no one is trying to type the same letter three times (at least not quickly).
21 //If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add
22 //an exception here to return a 'TRIPLE_SINGLE_TAP', and define that enum just like 'DOUBLE_SINGLE_TAP'
23 if (state->count == 3) {
24 if (state->interrupted || !state->pressed) return TRIPLE_TAP;
25 else return TRIPLE_HOLD;
26 }
27 else return 8; //magic number. At some point this method will expand to work for more presses
15} 28}
16 29
17// BEGIN: Copy, Paste, NUMPAD 30// BEGIN: Copy, Paste, Apps
18// https://beta.docs.qmk.fm/features/feature_tap_dance#example-6-using-tap-dance-for-momentary-layer-switch-and-layer-toggle-keys 31// https://beta.docs.qmk.fm/features/feature_tap_dance#example-6-using-tap-dance-for-momentary-layer-switch-and-layer-toggle-keys
19static tap copy_paste_numpad_tap_state = { 32static tap copy_paste_app_tap_state = {
20 .is_press_action = true, 33 .is_press_action = true,
21 .state = 0 34 .state = 0
22}; 35};
23 36
24void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) { 37void copy_paste_app_finished (qk_tap_dance_state_t *state, void *user_data) {
25 copy_paste_numpad_tap_state.state = cur_dance(state); 38 copy_paste_app_tap_state.state = cur_dance(state);
26 switch (copy_paste_numpad_tap_state.state) { 39 switch (copy_paste_app_tap_state.state) {
27 case SINGLE_TAP: 40 case SINGLE_TAP:
28 tap_code16(LGUI(KC_V)); // Tap Cmd + V 41 tap_code16(LGUI(KC_V)); // Tap Cmd + V
29 break; 42 break;
@@ -31,19 +44,22 @@ void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) {
31 tap_code16(LGUI(KC_C)); // Hold Cmd + C 44 tap_code16(LGUI(KC_C)); // Hold Cmd + C
32 break; 45 break;
33 case DOUBLE_TAP: 46 case DOUBLE_TAP:
34 if (layer_state_is(_NUMPAD)) { 47 SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
35 layer_off(_NUMPAD); 48 wait_ms(250);
36 } else { 49 SEND_STRING("line\n");
37 layer_on(_NUMPAD); 50 break;
38 } 51 case TRIPLE_TAP:
52 SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
53 wait_ms(250);
54 SEND_STRING("itunes\n");
39 break; 55 break;
40 } 56 }
41} 57}
42 58
43void copy_paste_numpad_reset (qk_tap_dance_state_t *state, void *user_data) { 59void copy_paste_app_reset (qk_tap_dance_state_t *state, void *user_data) {
44 copy_paste_numpad_tap_state.state = 0; 60 copy_paste_app_tap_state.state = 0;
45} 61}
46// END: Copy, Paste, NUMPAD 62// END: Copy, Paste, Apps
47 63
48// BEGIN: Y, NUMPAD 64// BEGIN: Y, NUMPAD
49static tap y_numpad_tap_state = { 65static tap y_numpad_tap_state = {
@@ -89,10 +105,8 @@ qk_tap_dance_action_t tap_dance_actions[] = {
89 [TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)), 105 [TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
90 [TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)), 106 [TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
91 [TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)), 107 [TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)),
92 [TD_W_CTRLW] = ACTION_TAP_DANCE_DOUBLE(KC_W, LGUI(KC_W)),
93 [TD_Q_GUIQ] = ACTION_TAP_DANCE_DOUBLE(KC_Q, LGUI(KC_Q)),
94 108
95 // Advanced Tap Dances 109 // Advanced Tap Dances
96 [TD_COPY_PASTE_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, copy_paste_numpad_finished, copy_paste_numpad_reset), 110 [TD_COPY_PASTE_APP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, copy_paste_app_finished, copy_paste_app_reset, 300),
97 [TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, y_numpad_finished, y_numpad_reset), 111 [TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, y_numpad_finished, y_numpad_reset, 300),
98}; \ No newline at end of file 112}; \ No newline at end of file
diff --git a/users/ninjonas/tap_dances.h b/users/ninjonas/tap_dances.h
index f2f39108d..11f77e717 100644
--- a/users/ninjonas/tap_dances.h
+++ b/users/ninjonas/tap_dances.h
@@ -9,7 +9,11 @@ typedef struct {
9enum tapdance_types{ 9enum tapdance_types{
10 SINGLE_TAP = 1, 10 SINGLE_TAP = 1,
11 SINGLE_HOLD = 2, 11 SINGLE_HOLD = 2,
12 DOUBLE_TAP = 3 12 DOUBLE_TAP = 3,
13 DOUBLE_HOLD = 4,
14 DOUBLE_SINGLE_TAP = 5, //send two single taps
15 TRIPLE_TAP = 6,
16 TRIPLE_HOLD = 7
13}; 17};
14 18
15enum custom_tapdances{ 19enum custom_tapdances{
@@ -19,9 +23,7 @@ enum custom_tapdances{
19 TD_TAB_CTRLTAB, 23 TD_TAB_CTRLTAB,
20 TD_GRV_CTRLGRV, 24 TD_GRV_CTRLGRV,
21 TD_GUI_GUISPC, 25 TD_GUI_GUISPC,
22 TD_W_CTRLW, 26 TD_COPY_PASTE_APP,
23 TD_Q_GUIQ,
24 TD_COPY_PASTE_NUMPAD,
25 TD_Y_NUMPAD, 27 TD_Y_NUMPAD,
26}; 28};
27 29
@@ -31,7 +33,5 @@ enum custom_tapdances{
31#define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB 33#define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB
32#define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for Cmd + GRV 34#define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for Cmd + GRV
33#define T_GUI TD(TD_GUI_GUISPC) // Tap for Cmd, double tap for Cmd + Space 35#define T_GUI TD(TD_GUI_GUISPC) // Tap for Cmd, double tap for Cmd + Space
34#define T_W TD(TD_W_CTRLW) // Tap for W, double tap for Cmd + W 36#define T_CPAP TD(TD_COPY_PASTE_APP) // Tap for paste, hold for copy, double tap for Line App
35#define T_Q TD(TD_Q_GUIQ) // Tap for Q, double tap for Cmd + Q
36#define T_CPNU TD(TD_COPY_PASTE_NUMPAD) // Tap for paste, hold for copy, double tap for NUMPAD
37#define T_Y TD(TD_Y_NUMPAD) // Tap for Y, double tap for NUMPAD \ No newline at end of file 37#define T_Y TD(TD_Y_NUMPAD) // Tap for Y, double tap for NUMPAD \ No newline at end of file