diff options
Diffstat (limited to 'keyboards/butterstick/keymaps')
-rw-r--r-- | keyboards/butterstick/keymaps/default/keymap.c | 183 | ||||
-rw-r--r-- | keyboards/butterstick/keymaps/dennytom/README.md | 11 | ||||
-rw-r--r-- | keyboards/butterstick/keymaps/dennytom/keymap.c | 1418 | ||||
-rw-r--r-- | keyboards/butterstick/keymaps/dennytom/keymap_def.json | 309 | ||||
-rw-r--r-- | keyboards/butterstick/keymaps/dennytom/rules.mk | 8 |
5 files changed, 1929 insertions, 0 deletions
diff --git a/keyboards/butterstick/keymaps/default/keymap.c b/keyboards/butterstick/keymaps/default/keymap.c new file mode 100644 index 000000000..749e9ba07 --- /dev/null +++ b/keyboards/butterstick/keymaps/default/keymap.c | |||
@@ -0,0 +1,183 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | #include "sten.h" | ||
4 | /* | ||
5 | * Key names are inherited from steno machines | ||
6 | * .-----------------------------------------------------. | ||
7 | * | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD | | ||
8 | * |-----------------------------------------------------| | ||
9 | * | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ | | ||
10 | * '-----------------------------------------------------' | ||
11 | */ | ||
12 | |||
13 | // Function prefixes | ||
14 | #define MEDIA (LSD | LK | LW | LR) | ||
15 | #define FUNCT (LSD | LK | LP | LH) | ||
16 | #define MOVE (LSU | LFT | LP | LH) | ||
17 | #define SYMB (RD | RZ) | ||
18 | #define NUMA (LW | LR) | ||
19 | #define NUMB (RR | RB) | ||
20 | |||
21 | // QMK Layer Numbers | ||
22 | #define BASE 0 | ||
23 | #define GAME 1 | ||
24 | |||
25 | // Do not change QMK Layer 0! This is your main keyboard. | ||
26 | // Make your QMK modifications to the later layers, to add | ||
27 | // keys/customize on the first layer modify processQwerty(): | ||
28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
29 | [BASE] = LAYOUT_butter( | ||
30 | STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, | ||
31 | STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR | ||
32 | ), | ||
33 | // I don't game don't roast me thanks | ||
34 | [GAME] = LAYOUT_butter( | ||
35 | KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT, | ||
36 | KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE) | ||
37 | ) | ||
38 | }; | ||
39 | |||
40 | // Note: You can only use basic keycodes here! | ||
41 | // P() is just a wrapper to make your life easier, any C code can be executed. | ||
42 | // Only the longest matched chord is run! | ||
43 | // | ||
44 | // http://docs.gboards.ca | ||
45 | uint32_t processQwerty(bool lookup) { | ||
46 | // SECRET AGENT CHORDS | ||
47 | P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__)); | ||
48 | P( LR | ST2| RR | RB, SEND(KC_BSPC)); | ||
49 | P( LSD | RZ, SEND(KC_SPC)); | ||
50 | |||
51 | // Dual chords | ||
52 | P( LP | LH, CLICK_MOUSE(KC_MS_BTN2)); | ||
53 | P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1)); | ||
54 | P( LSU | LFT, SEND(KC_ESC)); | ||
55 | P( LSD | LK, SEND(KC_LSFT)); | ||
56 | P( RZ | RS, SEND(KC_LSFT)); | ||
57 | P( ST2 | RR, SEND(KC_SPC)); | ||
58 | P( RP | RL, SEND(KC_LGUI)); | ||
59 | P( RT | RD, SEND(KC_LCTL)); | ||
60 | P( RL | RT, SEND(KC_LALT)); | ||
61 | P( LSU | LSD | LFT | LK, SEND(KC_LCTL)); | ||
62 | P( RS | RT | RD | RZ, SEND(KC_ENT)); | ||
63 | |||
64 | // Function Layer | ||
65 | P( FUNCT | RF, SEND(KC_F1)); | ||
66 | P( FUNCT | RP, SEND(KC_F2)); | ||
67 | P( FUNCT | RL, SEND(KC_F3)); | ||
68 | P( FUNCT | RT, SEND(KC_F4)); | ||
69 | P( FUNCT | RF | RR, SEND(KC_F5)); | ||
70 | P( FUNCT | RP | RB, SEND(KC_F6)); | ||
71 | P( FUNCT | RL | RG, SEND(KC_F7)); | ||
72 | P( FUNCT | RT | RS, SEND(KC_F8)); | ||
73 | P( FUNCT | RR, SEND(KC_F9)); | ||
74 | P( FUNCT | RB, SEND(KC_F10)); | ||
75 | P( FUNCT | RG, SEND(KC_F11)); | ||
76 | P( FUNCT | RS, SEND(KC_F12)); | ||
77 | |||
78 | // Movement Layer | ||
79 | P( MOVE | RF, SEND(KC_LEFT)); | ||
80 | P( MOVE | RP, SEND(KC_DOWN)); | ||
81 | P( MOVE | RL, SEND(KC_UP)); | ||
82 | P( MOVE | RT, SEND(KC_RIGHT)); | ||
83 | P( MOVE | ST1, SEND(KC_PGUP)); | ||
84 | P( MOVE | ST2, SEND(KC_PGDN)); | ||
85 | |||
86 | // Media Layer | ||
87 | P( MEDIA | RF, SEND(KC_MPRV)); | ||
88 | P( MEDIA | RP, SEND(KC_MPLY)); | ||
89 | P( MEDIA | RL, SEND(KC_MPLY)); | ||
90 | P( MEDIA | RT, SEND(KC_MNXT)); | ||
91 | P( MEDIA | RG, SEND(KC_VOLU)); | ||
92 | P( MEDIA | RB, SEND(KC_VOLD)); | ||
93 | P( MEDIA | RS, SEND(KC_MUTE)); | ||
94 | |||
95 | // Number Row, Right | ||
96 | P( NUMB | LSU, SEND(KC_1)); | ||
97 | P( NUMB | LFT, SEND(KC_2)); | ||
98 | P( NUMB | LP, SEND(KC_3)); | ||
99 | P( NUMB | LH, SEND(KC_4)); | ||
100 | P( NUMB | ST1, SEND(KC_5)); | ||
101 | P( NUMB | RF, SEND(KC_6)); | ||
102 | P( NUMB | RP, SEND(KC_7)); | ||
103 | P( NUMB | RL, SEND(KC_8)); | ||
104 | P( NUMB | RT, SEND(KC_9)); | ||
105 | P( NUMB | RD, SEND(KC_0)); | ||
106 | |||
107 | // Number Row, Left | ||
108 | P( NUMA | LSU, SEND(KC_1)); | ||
109 | P( NUMA | LFT, SEND(KC_2)); | ||
110 | P( NUMA | LP, SEND(KC_3)); | ||
111 | P( NUMA | LH, SEND(KC_4)); | ||
112 | P( NUMA | ST1, SEND(KC_5)); | ||
113 | P( NUMA | RF, SEND(KC_6)); | ||
114 | P( NUMA | RP, SEND(KC_7)); | ||
115 | P( NUMA | RL, SEND(KC_8)); | ||
116 | P( NUMA | RT, SEND(KC_9)); | ||
117 | P( NUMA | RD, SEND(KC_0)); | ||
118 | |||
119 | |||
120 | // Symbols and Numbers | ||
121 | P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // ( | ||
122 | P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // ) | ||
123 | P( SYMB | ST1 | ST2, SEND(KC_GRV)); // ` | ||
124 | P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // # | ||
125 | P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $ | ||
126 | P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // ! | ||
127 | P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // % | ||
128 | P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @ | ||
129 | P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^ | ||
130 | P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // { | ||
131 | P( SYMB | LW, SEND(KC_LBRC)); | ||
132 | P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // } | ||
133 | P( SYMB | LR, SEND(KC_RBRC)); | ||
134 | P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // | | ||
135 | P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~ | ||
136 | P( SYMB | RP | RB, SEND(KC_QUOT)); | ||
137 | P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // " | ||
138 | P( SYMB | RF, SEND(KC_KP_PLUS)); | ||
139 | P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // & | ||
140 | P( SYMB | RP, SEND(KC_MINS)); | ||
141 | P( SYMB | RB, SEND(KC_EQL)); | ||
142 | P( SYMB | RL, SEND(KC_SLSH)); | ||
143 | P( SYMB | RG, SEND(KC_COMM)); | ||
144 | P( SYMB | RT, SEND(KC_PAST)); | ||
145 | P( SYMB | RS, SEND(KC_DOT)); | ||
146 | |||
147 | // Letters | ||
148 | P( LSU | LSD, SEND(KC_A)); | ||
149 | P( LFT | LK, SEND(KC_S)); | ||
150 | P( LP | LW, SEND(KC_D)); | ||
151 | P( LH | LR, SEND(KC_F)); | ||
152 | P( ST1 | ST2, SEND(KC_G)); | ||
153 | P( RF | RR, SEND(KC_H)); | ||
154 | P( RT | RS, SEND(KC_L)); | ||
155 | P( RD | RZ, SEND(KC_SCLN)); | ||
156 | P( RG | RL, SEND(KC_K)); | ||
157 | P( RP | RB, SEND(KC_J)); | ||
158 | P( LSU, SEND(KC_Q)); | ||
159 | P( LSD, SEND(KC_Z)); | ||
160 | P( LFT, SEND(KC_W)); | ||
161 | P( LK, SEND(KC_X)); | ||
162 | P( LP, SEND(KC_E)); | ||
163 | P( LW, SEND(KC_C)); | ||
164 | P( LH, SEND(KC_R)); | ||
165 | P( LR, SEND(KC_V)); | ||
166 | P( ST1, SEND(KC_T)); | ||
167 | P( ST2, SEND(KC_B)); | ||
168 | P( RF, SEND(KC_Y)); | ||
169 | P( RR, SEND(KC_N)); | ||
170 | P( RP, SEND(KC_U)); | ||
171 | P( RB, SEND(KC_M)); | ||
172 | P( RL, SEND(KC_I)); | ||
173 | P( RG, SEND(KC_COMM)); | ||
174 | P( RT, SEND(KC_O)); | ||
175 | P( RS, SEND(KC_DOT)); | ||
176 | P( RD, SEND(KC_P)); | ||
177 | P( RZ, SEND(KC_SLSH)); | ||
178 | |||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | // Don't fuck with this, thanks. | ||
183 | size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); | ||
diff --git a/keyboards/butterstick/keymaps/dennytom/README.md b/keyboards/butterstick/keymaps/dennytom/README.md new file mode 100644 index 000000000..a75bcc750 --- /dev/null +++ b/keyboards/butterstick/keymaps/dennytom/README.md | |||
@@ -0,0 +1,11 @@ | |||
1 | # # Dennytom's Butterstick Layout | ||
2 | |||
3 | This keymap is using a custom chording engine. Head out to my (DennyTom) user space to find the source files and details. | ||
4 | |||
5 | To make a real keymap from the JSON file, run | ||
6 | |||
7 | ```sh | ||
8 | python3 parser.py keymap_def.json keymap.c | ||
9 | ``` | ||
10 | |||
11 | Somehow it fits the whole keyboard on 20 keys. For longer typing sessions, use the ASET NIOP mode. \ No newline at end of file | ||
diff --git a/keyboards/butterstick/keymaps/dennytom/keymap.c b/keyboards/butterstick/keymaps/dennytom/keymap.c new file mode 100644 index 000000000..bfe0aa215 --- /dev/null +++ b/keyboards/butterstick/keymaps/dennytom/keymap.c | |||
@@ -0,0 +1,1418 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | #define CHORD_TIMEOUT 100 | ||
4 | #define DANCE_TIMEOUT 200 | ||
5 | #define LEADER_TIMEOUT 750 | ||
6 | #define TAP_TIMEOUT 50 | ||
7 | #define LONG_PRESS_MULTIPLIER 3 | ||
8 | #define DYNAMIC_MACRO_MAX_LENGTH 20 | ||
9 | #define COMMAND_MAX_LENGTH 5 | ||
10 | #define LEADER_MAX_LENGTH 5 | ||
11 | #define HASH_TYPE uint32_t | ||
12 | #define NUMBER_OF_KEYS 20 | ||
13 | #define DEFAULT_PSEUDOLAYER QWERTY | ||
14 | |||
15 | #define H_TOP1 ((HASH_TYPE) 1 << 0) | ||
16 | #define H_TOP2 ((HASH_TYPE) 1 << 1) | ||
17 | #define H_TOP3 ((HASH_TYPE) 1 << 2) | ||
18 | #define H_TOP4 ((HASH_TYPE) 1 << 3) | ||
19 | #define H_TOP5 ((HASH_TYPE) 1 << 4) | ||
20 | #define H_TOP6 ((HASH_TYPE) 1 << 5) | ||
21 | #define H_TOP7 ((HASH_TYPE) 1 << 6) | ||
22 | #define H_TOP8 ((HASH_TYPE) 1 << 7) | ||
23 | #define H_TOP9 ((HASH_TYPE) 1 << 8) | ||
24 | #define H_TOP0 ((HASH_TYPE) 1 << 9) | ||
25 | #define H_BOT1 ((HASH_TYPE) 1 << 10) | ||
26 | #define H_BOT2 ((HASH_TYPE) 1 << 11) | ||
27 | #define H_BOT3 ((HASH_TYPE) 1 << 12) | ||
28 | #define H_BOT4 ((HASH_TYPE) 1 << 13) | ||
29 | #define H_BOT5 ((HASH_TYPE) 1 << 14) | ||
30 | #define H_BOT6 ((HASH_TYPE) 1 << 15) | ||
31 | #define H_BOT7 ((HASH_TYPE) 1 << 16) | ||
32 | #define H_BOT8 ((HASH_TYPE) 1 << 17) | ||
33 | #define H_BOT9 ((HASH_TYPE) 1 << 18) | ||
34 | #define H_BOT0 ((HASH_TYPE) 1 << 19) | ||
35 | |||
36 | enum internal_keycodes { | ||
37 | TOP1 = SAFE_RANGE, | ||
38 | TOP2, TOP3, TOP4, TOP5, TOP6, TOP7, TOP8, TOP9, TOP0, BOT1, BOT2, BOT3, BOT4, BOT5, BOT6, BOT7, BOT8, BOT9, BOT0, | ||
39 | FIRST_INTERNAL_KEYCODE = TOP1, | ||
40 | LAST_INTERNAL_KEYCODE = BOT0 | ||
41 | }; | ||
42 | |||
43 | enum pseudolayers { | ||
44 | ALWAYS_ON, QWERTY, NUM, MOV, MOUSE, ASETNIOP, ASETNIOP_123, ASETNIOP_FN | ||
45 | }; | ||
46 | |||
47 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
48 | [0] = LAYOUT_butter(TOP1, TOP2, TOP3, TOP4, TOP5, TOP6, TOP7, TOP8, TOP9, TOP0, BOT1, BOT2, BOT3, BOT4, BOT5, BOT6, BOT7, BOT8, BOT9, BOT0), | ||
49 | }; | ||
50 | size_t keymapsCount = 1; | ||
51 | |||
52 | uint8_t keycodes_buffer_array[] = { | ||
53 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
54 | }; | ||
55 | |||
56 | uint8_t command_buffer[] = { | ||
57 | 0, 0, 0, 0, 0 | ||
58 | }; | ||
59 | |||
60 | uint16_t leader_buffer[] = { | ||
61 | 0, 0, 0, 0, 0 | ||
62 | }; | ||
63 | |||
64 | uint8_t dynamic_macro_buffer[] = { | ||
65 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
66 | }; | ||
67 | |||
68 | enum chord_states { | ||
69 | IDLE, | ||
70 | READY, | ||
71 | ACTIVATED, | ||
72 | DEACTIVATED, | ||
73 | PRESS_FROM_ACTIVE, | ||
74 | FINISHED_FROM_ACTIVE, | ||
75 | IDLE_IN_DANCE, | ||
76 | READY_IN_DANCE, | ||
77 | FINISHED, | ||
78 | LOCKED, | ||
79 | READY_LOCKED, | ||
80 | RESTART, | ||
81 | IN_ONE_SHOT | ||
82 | }; | ||
83 | |||
84 | struct Chord { | ||
85 | uint32_t keycodes_hash; | ||
86 | uint8_t pseudolayer; | ||
87 | uint8_t* state; | ||
88 | uint8_t* counter; | ||
89 | uint16_t value1; | ||
90 | uint8_t value2; | ||
91 | void (*function) (const struct Chord*); | ||
92 | }; | ||
93 | |||
94 | uint8_t current_pseudolayer = DEFAULT_PSEUDOLAYER; | ||
95 | bool lock_next = false; | ||
96 | uint16_t chord_timer = 0; | ||
97 | uint16_t dance_timer = 0; | ||
98 | bool autoshift_mode = true; | ||
99 | uint8_t keycode_index = 0; | ||
100 | uint8_t command_mode = 0; | ||
101 | uint8_t command_ind = 0; | ||
102 | bool in_leader_mode = false; | ||
103 | uint8_t leader_ind = 0; | ||
104 | uint16_t leader_timer = 0; | ||
105 | uint8_t dynamic_macro_mode = false; | ||
106 | uint8_t dynamic_macro_ind = 0; | ||
107 | bool a_key_went_through = false; | ||
108 | struct Chord* last_chord = NULL; | ||
109 | |||
110 | bool handle_US_ANSI_shifted_keys(int16_t keycode, bool in) { | ||
111 | bool is_US_ANSI_shifted = true; | ||
112 | |||
113 | int16_t regular_keycode = KC_NO; | ||
114 | switch (keycode) { | ||
115 | case KC_TILDE: | ||
116 | regular_keycode = KC_GRAVE; | ||
117 | break; | ||
118 | case KC_EXCLAIM: | ||
119 | regular_keycode = KC_1; | ||
120 | break; | ||
121 | case KC_AT: | ||
122 | regular_keycode = KC_2; | ||
123 | break; | ||
124 | case KC_HASH: | ||
125 | regular_keycode = KC_3; | ||
126 | break; | ||
127 | case KC_DOLLAR: | ||
128 | regular_keycode = KC_4; | ||
129 | break; | ||
130 | case KC_PERCENT: | ||
131 | regular_keycode = KC_5; | ||
132 | break; | ||
133 | case KC_CIRCUMFLEX: | ||
134 | regular_keycode = KC_6; | ||
135 | break; | ||
136 | case KC_AMPERSAND: | ||
137 | regular_keycode = KC_7; | ||
138 | break; | ||
139 | case KC_ASTERISK: | ||
140 | regular_keycode = KC_8; | ||
141 | break; | ||
142 | case KC_LEFT_PAREN: | ||
143 | regular_keycode = KC_9; | ||
144 | break; | ||
145 | case KC_RIGHT_PAREN: | ||
146 | regular_keycode = KC_0; | ||
147 | break; | ||
148 | case KC_UNDERSCORE: | ||
149 | regular_keycode = KC_MINUS; | ||
150 | break; | ||
151 | case KC_PLUS: | ||
152 | regular_keycode = KC_EQUAL; | ||
153 | break; | ||
154 | case KC_LEFT_CURLY_BRACE: | ||
155 | regular_keycode = KC_LBRACKET; | ||
156 | break; | ||
157 | case KC_RIGHT_CURLY_BRACE: | ||
158 | regular_keycode = KC_RBRACKET; | ||
159 | break; | ||
160 | case KC_PIPE: | ||
161 | regular_keycode = KC_BSLASH; | ||
162 | break; | ||
163 | case KC_COLON: | ||
164 | regular_keycode = KC_SCOLON; | ||
165 | break; | ||
166 | case KC_DOUBLE_QUOTE: | ||
167 | regular_keycode = KC_QUOTE; | ||
168 | break; | ||
169 | case KC_LEFT_ANGLE_BRACKET: | ||
170 | regular_keycode = KC_COMMA; | ||
171 | break; | ||
172 | case KC_RIGHT_ANGLE_BRACKET: | ||
173 | regular_keycode = KC_DOT; | ||
174 | break; | ||
175 | case KC_QUESTION: | ||
176 | regular_keycode = KC_SLASH; | ||
177 | break; | ||
178 | default: | ||
179 | is_US_ANSI_shifted = false; | ||
180 | } | ||
181 | if (is_US_ANSI_shifted) { | ||
182 | if (in) { | ||
183 | register_code(KC_LSFT); | ||
184 | register_code(regular_keycode); | ||
185 | } else { | ||
186 | unregister_code(regular_keycode); | ||
187 | unregister_code(KC_LSFT); | ||
188 | } | ||
189 | } | ||
190 | return is_US_ANSI_shifted; | ||
191 | } | ||
192 | |||
193 | void key_in(int16_t keycode) { | ||
194 | if (command_mode == 1 && command_ind < COMMAND_MAX_LENGTH) { | ||
195 | command_buffer[command_ind] = keycode; | ||
196 | command_ind++; | ||
197 | a_key_went_through = true; | ||
198 | } else if (in_leader_mode && leader_ind < LEADER_MAX_LENGTH) { | ||
199 | leader_buffer[leader_ind] = keycode; | ||
200 | leader_ind++; | ||
201 | a_key_went_through = true; | ||
202 | } else if (dynamic_macro_mode && dynamic_macro_ind < DYNAMIC_MACRO_MAX_LENGTH) { | ||
203 | dynamic_macro_buffer[dynamic_macro_ind] = keycode; | ||
204 | dynamic_macro_ind++; | ||
205 | a_key_went_through = true; | ||
206 | } else { | ||
207 | if (!handle_US_ANSI_shifted_keys(keycode, true)) { | ||
208 | register_code(keycode); | ||
209 | } | ||
210 | send_keyboard_report(); | ||
211 | a_key_went_through = true; | ||
212 | } | ||
213 | } | ||
214 | |||
215 | void key_out(int16_t keycode) { | ||
216 | if (command_mode == 0) { | ||
217 | if (!handle_US_ANSI_shifted_keys(keycode, false)) { | ||
218 | if (command_mode == 0 && in_leader_mode == false && dynamic_macro_mode == false) { | ||
219 | unregister_code(keycode); | ||
220 | } | ||
221 | } | ||
222 | send_keyboard_report(); | ||
223 | } | ||
224 | } | ||
225 | |||
226 | void tap_key(int16_t keycode) { | ||
227 | key_in(keycode); | ||
228 | wait_ms(TAP_TIMEOUT); | ||
229 | key_out(keycode); | ||
230 | } | ||
231 | void single_dance(const struct Chord* self) { | ||
232 | switch (*self->state) { | ||
233 | case ACTIVATED: | ||
234 | key_in(self->value1); | ||
235 | break; | ||
236 | case DEACTIVATED: | ||
237 | key_out(self->value1); | ||
238 | *self->state = IDLE; | ||
239 | break; | ||
240 | case RESTART: | ||
241 | key_out(self->value1); | ||
242 | break; | ||
243 | default: | ||
244 | break; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | void key_layer_dance(const struct Chord* self) { | ||
249 | switch (*self->state) { | ||
250 | case ACTIVATED: | ||
251 | current_pseudolayer = self->value2; | ||
252 | a_key_went_through = false; | ||
253 | break; | ||
254 | case DEACTIVATED: | ||
255 | case RESTART: | ||
256 | if (!a_key_went_through) { | ||
257 | tap_key(self->value1); | ||
258 | } | ||
259 | current_pseudolayer = self->pseudolayer; | ||
260 | *self->state = IDLE; // does not have effect if the state was RESTART | ||
261 | break; | ||
262 | default: | ||
263 | break; | ||
264 | } | ||
265 | } | ||
266 | |||
267 | void key_mod_dance(const struct Chord* self) { | ||
268 | switch (*self->state) { | ||
269 | case ACTIVATED: | ||
270 | key_in(self->value2); | ||
271 | a_key_went_through = false; | ||
272 | break; | ||
273 | case DEACTIVATED: | ||
274 | case RESTART: | ||
275 | key_out(self->value2); | ||
276 | if (!a_key_went_through) { | ||
277 | tap_key(self->value1); | ||
278 | } | ||
279 | *self->state = IDLE; // does not have effect if the state was RESTART | ||
280 | break; | ||
281 | default: | ||
282 | break; | ||
283 | } | ||
284 | } | ||
285 | |||
286 | void key_key_dance(const struct Chord* self) { | ||
287 | switch (*self->state) { | ||
288 | case ACTIVATED: | ||
289 | break; | ||
290 | case DEACTIVATED: | ||
291 | tap_key(self->value1); | ||
292 | *self->state = IDLE; | ||
293 | break; | ||
294 | case FINISHED: | ||
295 | case PRESS_FROM_ACTIVE: | ||
296 | key_in(self->value2); | ||
297 | break; | ||
298 | case RESTART: | ||
299 | key_out(self->value2); | ||
300 | break; | ||
301 | default: | ||
302 | break; | ||
303 | } | ||
304 | } | ||
305 | |||
306 | void autoshift_dance_impl(const struct Chord* self) { | ||
307 | switch (*self->state) { | ||
308 | case ACTIVATED: | ||
309 | *self->counter = 0; | ||
310 | break; | ||
311 | case DEACTIVATED: | ||
312 | case RESTART: | ||
313 | tap_key(self->value1); | ||
314 | *self->state = IDLE; | ||
315 | break; | ||
316 | case FINISHED_FROM_ACTIVE: | ||
317 | if (*self->counter == (LONG_PRESS_MULTIPLIER - 2)) { | ||
318 | key_in(KC_LSFT); | ||
319 | tap_key(self->value1); | ||
320 | key_out(KC_LSFT); | ||
321 | *self->state = IDLE; | ||
322 | // the skip to IDLE is usually just a lag optimization, | ||
323 | // in this case it has a logic function, on a short | ||
324 | // press (still longer than a tap) the key does not get shifted | ||
325 | } else { | ||
326 | *self->counter += 1; | ||
327 | *self->state = PRESS_FROM_ACTIVE; | ||
328 | dance_timer = timer_read(); | ||
329 | } | ||
330 | break; | ||
331 | default: | ||
332 | break; | ||
333 | } | ||
334 | } | ||
335 | |||
336 | void autoshift_dance(const struct Chord* self) { | ||
337 | if (autoshift_mode) { | ||
338 | autoshift_dance_impl(self); | ||
339 | } else { | ||
340 | single_dance(self); | ||
341 | } | ||
342 | } | ||
343 | |||
344 | void autoshift_toggle(const struct Chord* self){ | ||
345 | if (*self->state == ACTIVATED) { | ||
346 | autoshift_mode = !autoshift_mode; | ||
347 | *self->state = IDLE; | ||
348 | } | ||
349 | } | ||
350 | |||
351 | void temp_pseudolayer(const struct Chord* self) { | ||
352 | switch (*self->state) { | ||
353 | case ACTIVATED: | ||
354 | current_pseudolayer = self->value1; | ||
355 | break; | ||
356 | case DEACTIVATED: | ||
357 | current_pseudolayer = self->pseudolayer; | ||
358 | *self->state = IDLE; | ||
359 | break; | ||
360 | case RESTART: | ||
361 | current_pseudolayer = self->pseudolayer; | ||
362 | break; | ||
363 | default: | ||
364 | break; | ||
365 | } | ||
366 | } | ||
367 | |||
368 | void perm_pseudolayer(const struct Chord* self) { | ||
369 | if (*self->state == ACTIVATED) { | ||
370 | current_pseudolayer = self->value1; | ||
371 | *self->state = IDLE; | ||
372 | } | ||
373 | } | ||
374 | |||
375 | void switch_layer(const struct Chord* self) { | ||
376 | if (*self->state == ACTIVATED) { | ||
377 | layer_move(self->value1); | ||
378 | *self->state = IDLE; | ||
379 | } | ||
380 | } | ||
381 | |||
382 | void lock(const struct Chord* self) { | ||
383 | if (*self->state == ACTIVATED) { | ||
384 | lock_next = true; | ||
385 | *self->state = IDLE; | ||
386 | } | ||
387 | } | ||
388 | |||
389 | void one_shot_key(const struct Chord* self) { | ||
390 | switch (*self->state) { | ||
391 | case ACTIVATED: | ||
392 | break; | ||
393 | case DEACTIVATED: | ||
394 | key_in(self->value1); | ||
395 | *self->state = IN_ONE_SHOT; | ||
396 | break; | ||
397 | case FINISHED: | ||
398 | case PRESS_FROM_ACTIVE: | ||
399 | key_in(self->value1); | ||
400 | a_key_went_through = false; | ||
401 | break; | ||
402 | case RESTART: | ||
403 | if (a_key_went_through) { | ||
404 | key_out(self->value1); | ||
405 | } else { | ||
406 | *self->state = IN_ONE_SHOT; | ||
407 | } | ||
408 | default: | ||
409 | break; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | void one_shot_layer(const struct Chord* self) { | ||
414 | switch (*self->state) { | ||
415 | case ACTIVATED: | ||
416 | break; | ||
417 | case DEACTIVATED: | ||
418 | current_pseudolayer = self->value1; | ||
419 | *self->state = IN_ONE_SHOT; | ||
420 | break; | ||
421 | case FINISHED: | ||
422 | case PRESS_FROM_ACTIVE: | ||
423 | current_pseudolayer = self->value1; | ||
424 | a_key_went_through = false; | ||
425 | break; | ||
426 | case RESTART: | ||
427 | if (a_key_went_through) { | ||
428 | current_pseudolayer = self->pseudolayer; | ||
429 | } else { | ||
430 | *self->state = IN_ONE_SHOT; | ||
431 | } | ||
432 | default: | ||
433 | break; | ||
434 | } | ||
435 | } | ||
436 | |||
437 | void command(const struct Chord* self) { | ||
438 | if (*self->state == ACTIVATED) { | ||
439 | command_mode++; | ||
440 | *self->state = IDLE; | ||
441 | } | ||
442 | } | ||
443 | |||
444 | bool identical(uint16_t* buffer1, uint16_t* buffer2) { | ||
445 | bool same = true; | ||
446 | for (int i = 0; i < LEADER_MAX_LENGTH; i++) { | ||
447 | same = same && (buffer1[i] == buffer2[i]); | ||
448 | } | ||
449 | return same; | ||
450 | } | ||
451 | |||
452 | void leader(const struct Chord* self) { | ||
453 | if (*self->state == ACTIVATED) { | ||
454 | in_leader_mode = true; | ||
455 | *self->state = IDLE; | ||
456 | } | ||
457 | } | ||
458 | |||
459 | void dynamic_macro_record(const struct Chord* self) { | ||
460 | if (*self->state == ACTIVATED) { | ||
461 | for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { | ||
462 | dynamic_macro_buffer[i] = 0; | ||
463 | } | ||
464 | dynamic_macro_mode = true; | ||
465 | *self->state = IDLE; | ||
466 | } | ||
467 | } | ||
468 | |||
469 | void dynamic_macro_next(const struct Chord* self) { | ||
470 | if (*self->state == ACTIVATED) { | ||
471 | if (dynamic_macro_mode && dynamic_macro_ind < DYNAMIC_MACRO_MAX_LENGTH) { | ||
472 | dynamic_macro_buffer[dynamic_macro_ind] = 0; | ||
473 | dynamic_macro_ind++; | ||
474 | } | ||
475 | *self->state = IDLE; | ||
476 | } | ||
477 | } | ||
478 | |||
479 | void dynamic_macro_end(const struct Chord* self) { | ||
480 | if (*self->state == ACTIVATED) { | ||
481 | if (dynamic_macro_mode) { | ||
482 | dynamic_macro_mode = false; | ||
483 | } | ||
484 | *self->state = IDLE; | ||
485 | } | ||
486 | } | ||
487 | |||
488 | void dynamic_macro_play(const struct Chord* self) { | ||
489 | if (*self->state == ACTIVATED) { | ||
490 | int ind_start = 0; | ||
491 | while (ind_start < DYNAMIC_MACRO_MAX_LENGTH) { | ||
492 | for (int i = ind_start; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { | ||
493 | if (dynamic_macro_buffer[i] == 0) { | ||
494 | break; | ||
495 | } | ||
496 | register_code(dynamic_macro_buffer[i]); | ||
497 | } | ||
498 | send_keyboard_report(); | ||
499 | wait_ms(TAP_TIMEOUT); | ||
500 | for (int i = ind_start; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { | ||
501 | if (dynamic_macro_buffer[i] == 0) { | ||
502 | ind_start = i + 1; | ||
503 | break; | ||
504 | } | ||
505 | unregister_code(dynamic_macro_buffer[i]); | ||
506 | } | ||
507 | send_keyboard_report(); | ||
508 | } | ||
509 | *self->state = IDLE; | ||
510 | } | ||
511 | } | ||
512 | |||
513 | void clear(const struct Chord* self); | ||
514 | |||
515 | void reset_keyboard_kb(void){ | ||
516 | #ifdef WATCHDOG_ENABLE | ||
517 | MCUSR = 0; | ||
518 | wdt_disable(); | ||
519 | wdt_reset(); | ||
520 | #endif | ||
521 | reset_keyboard(); | ||
522 | } | ||
523 | |||
524 | void reset(const struct Chord* self) { | ||
525 | if (*self->state == ACTIVATED) { | ||
526 | reset_keyboard_kb(); | ||
527 | } | ||
528 | } | ||
529 | |||
530 | uint8_t state_0 = IDLE; | ||
531 | const struct Chord chord_0 PROGMEM = {H_TOP1 + H_TOP2 + H_BOT1 + H_BOT2, ALWAYS_ON, &state_0, NULL, 0, 0, lock}; | ||
532 | uint8_t state_1 = IDLE; | ||
533 | const struct Chord chord_1 PROGMEM = {H_TOP2 + H_TOP3 + H_BOT2 + H_BOT3, ALWAYS_ON, &state_1, NULL, 0, 0, autoshift_toggle}; | ||
534 | uint8_t state_2 = IDLE; | ||
535 | const struct Chord chord_2 PROGMEM = {H_TOP5 + H_TOP6 + H_BOT5 + H_BOT6, ALWAYS_ON, &state_2, NULL, 0, 0, command}; | ||
536 | uint8_t state_3 = IDLE; | ||
537 | const struct Chord chord_3 PROGMEM = {H_TOP1 + H_TOP2 + H_TOP9 + H_TOP0 + H_BOT1 + H_BOT2 + H_BOT9 + H_BOT0, ALWAYS_ON, &state_3, NULL, 0, 0, clear}; | ||
538 | uint8_t state_4 = IDLE; | ||
539 | uint8_t counter_4 = 0; | ||
540 | const struct Chord chord_4 PROGMEM = {H_TOP1, QWERTY, &state_4, &counter_4, KC_Q, 0, autoshift_dance}; | ||
541 | uint8_t state_5 = IDLE; | ||
542 | uint8_t counter_5 = 0; | ||
543 | const struct Chord chord_5 PROGMEM = {H_TOP2, QWERTY, &state_5, &counter_5, KC_W, 0, autoshift_dance}; | ||
544 | uint8_t state_6 = IDLE; | ||
545 | uint8_t counter_6 = 0; | ||
546 | const struct Chord chord_6 PROGMEM = {H_TOP3, QWERTY, &state_6, &counter_6, KC_E, 0, autoshift_dance}; | ||
547 | uint8_t state_7 = IDLE; | ||
548 | uint8_t counter_7 = 0; | ||
549 | const struct Chord chord_7 PROGMEM = {H_TOP4, QWERTY, &state_7, &counter_7, KC_R, 0, autoshift_dance}; | ||
550 | uint8_t state_8 = IDLE; | ||
551 | uint8_t counter_8 = 0; | ||
552 | const struct Chord chord_8 PROGMEM = {H_TOP5, QWERTY, &state_8, &counter_8, KC_T, 0, autoshift_dance}; | ||
553 | uint8_t state_9 = IDLE; | ||
554 | uint8_t counter_9 = 0; | ||
555 | const struct Chord chord_9 PROGMEM = {H_TOP6, QWERTY, &state_9, &counter_9, KC_Y, 0, autoshift_dance}; | ||
556 | uint8_t state_10 = IDLE; | ||
557 | uint8_t counter_10 = 0; | ||
558 | const struct Chord chord_10 PROGMEM = {H_TOP7, QWERTY, &state_10, &counter_10, KC_U, 0, autoshift_dance}; | ||
559 | uint8_t state_11 = IDLE; | ||
560 | uint8_t counter_11 = 0; | ||
561 | const struct Chord chord_11 PROGMEM = {H_TOP8, QWERTY, &state_11, &counter_11, KC_I, 0, autoshift_dance}; | ||
562 | uint8_t state_12 = IDLE; | ||
563 | uint8_t counter_12 = 0; | ||
564 | const struct Chord chord_12 PROGMEM = {H_TOP9, QWERTY, &state_12, &counter_12, KC_O, 0, autoshift_dance}; | ||
565 | uint8_t state_13 = IDLE; | ||
566 | uint8_t counter_13 = 0; | ||
567 | const struct Chord chord_13 PROGMEM = {H_TOP0, QWERTY, &state_13, &counter_13, KC_P, 0, autoshift_dance}; | ||
568 | uint8_t state_14 = IDLE; | ||
569 | uint8_t counter_14 = 0; | ||
570 | const struct Chord chord_14 PROGMEM = {H_TOP1 + H_BOT1, QWERTY, &state_14, &counter_14, KC_A, 0, autoshift_dance}; | ||
571 | uint8_t state_15 = IDLE; | ||
572 | uint8_t counter_15 = 0; | ||
573 | const struct Chord chord_15 PROGMEM = {H_TOP2 + H_BOT2, QWERTY, &state_15, &counter_15, KC_S, 0, autoshift_dance}; | ||
574 | uint8_t state_16 = IDLE; | ||
575 | uint8_t counter_16 = 0; | ||
576 | const struct Chord chord_16 PROGMEM = {H_TOP3 + H_BOT3, QWERTY, &state_16, &counter_16, KC_D, 0, autoshift_dance}; | ||
577 | uint8_t state_17 = IDLE; | ||
578 | uint8_t counter_17 = 0; | ||
579 | const struct Chord chord_17 PROGMEM = {H_TOP4 + H_BOT4, QWERTY, &state_17, &counter_17, KC_F, 0, autoshift_dance}; | ||
580 | uint8_t state_18 = IDLE; | ||
581 | uint8_t counter_18 = 0; | ||
582 | const struct Chord chord_18 PROGMEM = {H_TOP5 + H_BOT5, QWERTY, &state_18, &counter_18, KC_G, 0, autoshift_dance}; | ||
583 | uint8_t state_19 = IDLE; | ||
584 | uint8_t counter_19 = 0; | ||
585 | const struct Chord chord_19 PROGMEM = {H_TOP6 + H_BOT6, QWERTY, &state_19, &counter_19, KC_H, 0, autoshift_dance}; | ||
586 | uint8_t state_20 = IDLE; | ||
587 | uint8_t counter_20 = 0; | ||
588 | const struct Chord chord_20 PROGMEM = {H_TOP7 + H_BOT7, QWERTY, &state_20, &counter_20, KC_J, 0, autoshift_dance}; | ||
589 | uint8_t state_21 = IDLE; | ||
590 | uint8_t counter_21 = 0; | ||
591 | const struct Chord chord_21 PROGMEM = {H_TOP8 + H_BOT8, QWERTY, &state_21, &counter_21, KC_K, 0, autoshift_dance}; | ||
592 | uint8_t state_22 = IDLE; | ||
593 | uint8_t counter_22 = 0; | ||
594 | const struct Chord chord_22 PROGMEM = {H_TOP9 + H_BOT9, QWERTY, &state_22, &counter_22, KC_L, 0, autoshift_dance}; | ||
595 | uint8_t state_23 = IDLE; | ||
596 | uint8_t counter_23 = 0; | ||
597 | const struct Chord chord_23 PROGMEM = {H_TOP0 + H_BOT0, QWERTY, &state_23, &counter_23, KC_SCOLON, 0, autoshift_dance}; | ||
598 | uint8_t state_24 = IDLE; | ||
599 | uint8_t counter_24 = 0; | ||
600 | const struct Chord chord_24 PROGMEM = {H_BOT1, QWERTY, &state_24, &counter_24, KC_Z, 0, autoshift_dance}; | ||
601 | uint8_t state_25 = IDLE; | ||
602 | uint8_t counter_25 = 0; | ||
603 | const struct Chord chord_25 PROGMEM = {H_BOT2, QWERTY, &state_25, &counter_25, KC_X, 0, autoshift_dance}; | ||
604 | uint8_t state_26 = IDLE; | ||
605 | uint8_t counter_26 = 0; | ||
606 | const struct Chord chord_26 PROGMEM = {H_BOT3, QWERTY, &state_26, &counter_26, KC_C, 0, autoshift_dance}; | ||
607 | uint8_t state_27 = IDLE; | ||
608 | uint8_t counter_27 = 0; | ||
609 | const struct Chord chord_27 PROGMEM = {H_BOT4, QWERTY, &state_27, &counter_27, KC_V, 0, autoshift_dance}; | ||
610 | uint8_t state_28 = IDLE; | ||
611 | uint8_t counter_28 = 0; | ||
612 | const struct Chord chord_28 PROGMEM = {H_BOT5, QWERTY, &state_28, &counter_28, KC_B, 0, autoshift_dance}; | ||
613 | uint8_t state_29 = IDLE; | ||
614 | uint8_t counter_29 = 0; | ||
615 | const struct Chord chord_29 PROGMEM = {H_BOT6, QWERTY, &state_29, &counter_29, KC_N, 0, autoshift_dance}; | ||
616 | uint8_t state_30 = IDLE; | ||
617 | uint8_t counter_30 = 0; | ||
618 | const struct Chord chord_30 PROGMEM = {H_BOT7, QWERTY, &state_30, &counter_30, KC_M, 0, autoshift_dance}; | ||
619 | uint8_t state_31 = IDLE; | ||
620 | uint8_t counter_31 = 0; | ||
621 | const struct Chord chord_31 PROGMEM = {H_BOT8, QWERTY, &state_31, &counter_31, KC_COMMA, 0, autoshift_dance}; | ||
622 | uint8_t state_32 = IDLE; | ||
623 | uint8_t counter_32 = 0; | ||
624 | const struct Chord chord_32 PROGMEM = {H_BOT9, QWERTY, &state_32, &counter_32, KC_DOT, 0, autoshift_dance}; | ||
625 | uint8_t state_33 = IDLE; | ||
626 | uint8_t counter_33 = 0; | ||
627 | const struct Chord chord_33 PROGMEM = {H_BOT0, QWERTY, &state_33, &counter_33, KC_SLASH, 0, autoshift_dance}; | ||
628 | uint8_t state_34 = IDLE; | ||
629 | const struct Chord chord_34 PROGMEM = {H_TOP1 + H_TOP2, QWERTY, &state_34, NULL, KC_ESC, 0, single_dance}; | ||
630 | uint8_t state_35 = IDLE; | ||
631 | const struct Chord chord_35 PROGMEM = {H_TOP2 + H_TOP3, QWERTY, &state_35, NULL, MOV, 0, temp_pseudolayer}; | ||
632 | uint8_t state_36 = IDLE; | ||
633 | const struct Chord chord_36 PROGMEM = {H_TOP3 + H_TOP4, QWERTY, &state_36, NULL, KC_TAB, 0, single_dance}; | ||
634 | uint8_t state_37 = IDLE; | ||
635 | const struct Chord chord_37 PROGMEM = {H_TOP5 + H_TOP6, QWERTY, &state_37, NULL, KC_RGUI, 0, one_shot_key}; | ||
636 | uint8_t state_38 = IDLE; | ||
637 | const struct Chord chord_38 PROGMEM = {H_TOP7 + H_TOP8, QWERTY, &state_38, NULL, KC_INS, 0, single_dance}; | ||
638 | uint8_t state_39 = IDLE; | ||
639 | const struct Chord chord_39 PROGMEM = {H_TOP8 + H_TOP9, QWERTY, &state_39, NULL, KC_DEL, 0, single_dance}; | ||
640 | uint8_t state_40 = IDLE; | ||
641 | const struct Chord chord_40 PROGMEM = {H_TOP9 + H_TOP0, QWERTY, &state_40, NULL, KC_BSPC, 0, single_dance}; | ||
642 | uint8_t state_41 = IDLE; | ||
643 | const struct Chord chord_41 PROGMEM = {H_TOP9 + H_TOP0 + H_BOT9 + H_BOT0, QWERTY, &state_41, NULL, KC_ENTER, 0, single_dance}; | ||
644 | uint8_t state_42 = IDLE; | ||
645 | const struct Chord chord_42 PROGMEM = {H_BOT1 + H_BOT2, QWERTY, &state_42, NULL, KC_LSFT, 0, one_shot_key}; | ||
646 | uint8_t state_43 = IDLE; | ||
647 | const struct Chord chord_43 PROGMEM = {H_BOT2 + H_BOT3, QWERTY, &state_43, NULL, KC_LCTL, 0, one_shot_key}; | ||
648 | uint8_t state_44 = IDLE; | ||
649 | const struct Chord chord_44 PROGMEM = {H_BOT3 + H_BOT4, QWERTY, &state_44, NULL, KC_LALT, 0, one_shot_key}; | ||
650 | uint8_t state_45 = IDLE; | ||
651 | const struct Chord chord_45 PROGMEM = {H_BOT4 + H_BOT5, QWERTY, &state_45, NULL, NUM, 0, one_shot_layer}; | ||
652 | uint8_t state_46 = IDLE; | ||
653 | const struct Chord chord_46 PROGMEM = {H_BOT5 + H_BOT6, QWERTY, &state_46, NULL, KC_LGUI, 0, one_shot_key}; | ||
654 | uint8_t state_47 = IDLE; | ||
655 | const struct Chord chord_47 PROGMEM = {H_BOT6 + H_BOT7, QWERTY, &state_47, NULL, NUM, 0, one_shot_layer}; | ||
656 | uint8_t state_48 = IDLE; | ||
657 | const struct Chord chord_48 PROGMEM = {H_BOT7 + H_BOT8, QWERTY, &state_48, NULL, KC_RALT, 0, one_shot_key}; | ||
658 | uint8_t state_49 = IDLE; | ||
659 | const struct Chord chord_49 PROGMEM = {H_BOT8 + H_BOT9, QWERTY, &state_49, NULL, KC_RCTL, 0, one_shot_key}; | ||
660 | uint8_t state_50 = IDLE; | ||
661 | const struct Chord chord_50 PROGMEM = {H_BOT9 + H_BOT0, QWERTY, &state_50, NULL, KC_RSFT, 0, one_shot_key}; | ||
662 | uint8_t state_51 = IDLE; | ||
663 | const struct Chord chord_51 PROGMEM = {H_BOT1 + H_BOT0, QWERTY, &state_51, NULL, KC_SPACE, 0, single_dance}; | ||
664 | uint8_t state_52 = IDLE; | ||
665 | const struct Chord chord_52 PROGMEM = {H_TOP1 + H_TOP2 + H_TOP3 + H_TOP4, QWERTY, &state_52, NULL, MOUSE, 0, temp_pseudolayer}; | ||
666 | uint8_t state_53 = IDLE; | ||
667 | const struct Chord chord_53 PROGMEM = {H_TOP1 + H_TOP2 + H_TOP3 + H_TOP4, QWERTY, &state_53, NULL, ASETNIOP, 0, perm_pseudolayer}; | ||
668 | uint8_t state_54 = IDLE; | ||
669 | uint8_t counter_54 = 0; | ||
670 | const struct Chord chord_54 PROGMEM = {H_TOP1, NUM, &state_54, &counter_54, KC_1, 0, autoshift_dance}; | ||
671 | uint8_t state_55 = IDLE; | ||
672 | uint8_t counter_55 = 0; | ||
673 | const struct Chord chord_55 PROGMEM = {H_TOP2, NUM, &state_55, &counter_55, KC_2, 0, autoshift_dance}; | ||
674 | uint8_t state_56 = IDLE; | ||
675 | uint8_t counter_56 = 0; | ||
676 | const struct Chord chord_56 PROGMEM = {H_TOP3, NUM, &state_56, &counter_56, KC_3, 0, autoshift_dance}; | ||
677 | uint8_t state_57 = IDLE; | ||
678 | uint8_t counter_57 = 0; | ||
679 | const struct Chord chord_57 PROGMEM = {H_TOP4, NUM, &state_57, &counter_57, KC_4, 0, autoshift_dance}; | ||
680 | uint8_t state_58 = IDLE; | ||
681 | uint8_t counter_58 = 0; | ||
682 | const struct Chord chord_58 PROGMEM = {H_TOP5, NUM, &state_58, &counter_58, KC_5, 0, autoshift_dance}; | ||
683 | uint8_t state_59 = IDLE; | ||
684 | uint8_t counter_59 = 0; | ||
685 | const struct Chord chord_59 PROGMEM = {H_TOP6, NUM, &state_59, &counter_59, KC_6, 0, autoshift_dance}; | ||
686 | uint8_t state_60 = IDLE; | ||
687 | uint8_t counter_60 = 0; | ||
688 | const struct Chord chord_60 PROGMEM = {H_TOP7, NUM, &state_60, &counter_60, KC_7, 0, autoshift_dance}; | ||
689 | uint8_t state_61 = IDLE; | ||
690 | uint8_t counter_61 = 0; | ||
691 | const struct Chord chord_61 PROGMEM = {H_TOP8, NUM, &state_61, &counter_61, KC_8, 0, autoshift_dance}; | ||
692 | uint8_t state_62 = IDLE; | ||
693 | uint8_t counter_62 = 0; | ||
694 | const struct Chord chord_62 PROGMEM = {H_TOP9, NUM, &state_62, &counter_62, KC_9, 0, autoshift_dance}; | ||
695 | uint8_t state_63 = IDLE; | ||
696 | uint8_t counter_63 = 0; | ||
697 | const struct Chord chord_63 PROGMEM = {H_TOP0, NUM, &state_63, &counter_63, KC_0, 0, autoshift_dance}; | ||
698 | uint8_t state_64 = IDLE; | ||
699 | const struct Chord chord_64 PROGMEM = {H_TOP1 + H_BOT1, NUM, &state_64, NULL, KC_F1, 0, single_dance}; | ||
700 | uint8_t state_65 = IDLE; | ||
701 | const struct Chord chord_65 PROGMEM = {H_TOP2 + H_BOT2, NUM, &state_65, NULL, KC_F2, 0, single_dance}; | ||
702 | uint8_t state_66 = IDLE; | ||
703 | const struct Chord chord_66 PROGMEM = {H_TOP3 + H_BOT3, NUM, &state_66, NULL, KC_F3, 0, single_dance}; | ||
704 | uint8_t state_67 = IDLE; | ||
705 | const struct Chord chord_67 PROGMEM = {H_TOP4 + H_BOT4, NUM, &state_67, NULL, KC_F4, 0, single_dance}; | ||
706 | uint8_t state_68 = IDLE; | ||
707 | const struct Chord chord_68 PROGMEM = {H_TOP5 + H_BOT5, NUM, &state_68, NULL, KC_F5, 0, single_dance}; | ||
708 | uint8_t state_69 = IDLE; | ||
709 | const struct Chord chord_69 PROGMEM = {H_TOP6 + H_BOT6, NUM, &state_69, NULL, KC_F6, 0, single_dance}; | ||
710 | uint8_t state_70 = IDLE; | ||
711 | const struct Chord chord_70 PROGMEM = {H_TOP7 + H_BOT7, NUM, &state_70, NULL, KC_F7, 0, single_dance}; | ||
712 | uint8_t state_71 = IDLE; | ||
713 | const struct Chord chord_71 PROGMEM = {H_TOP8 + H_BOT8, NUM, &state_71, NULL, KC_F8, 0, single_dance}; | ||
714 | uint8_t state_72 = IDLE; | ||
715 | const struct Chord chord_72 PROGMEM = {H_TOP9 + H_BOT9, NUM, &state_72, NULL, KC_F9, 0, single_dance}; | ||
716 | uint8_t state_73 = IDLE; | ||
717 | const struct Chord chord_73 PROGMEM = {H_TOP0 + H_BOT0, NUM, &state_73, NULL, KC_F10, 0, single_dance}; | ||
718 | uint8_t state_74 = IDLE; | ||
719 | uint8_t counter_74 = 0; | ||
720 | const struct Chord chord_74 PROGMEM = {H_BOT1, NUM, &state_74, &counter_74, KC_GRAVE, 0, autoshift_dance}; | ||
721 | uint8_t state_75 = IDLE; | ||
722 | uint8_t counter_75 = 0; | ||
723 | const struct Chord chord_75 PROGMEM = {H_BOT2, NUM, &state_75, &counter_75, KC_MINUS, 0, autoshift_dance}; | ||
724 | uint8_t state_76 = IDLE; | ||
725 | uint8_t counter_76 = 0; | ||
726 | const struct Chord chord_76 PROGMEM = {H_BOT3, NUM, &state_76, &counter_76, KC_EQUAL, 0, autoshift_dance}; | ||
727 | uint8_t state_77 = IDLE; | ||
728 | uint8_t counter_77 = 0; | ||
729 | const struct Chord chord_77 PROGMEM = {H_BOT4, NUM, &state_77, &counter_77, KC_LBRACKET, 0, autoshift_dance}; | ||
730 | uint8_t state_78 = IDLE; | ||
731 | uint8_t counter_78 = 0; | ||
732 | const struct Chord chord_78 PROGMEM = {H_BOT5, NUM, &state_78, &counter_78, KC_RBRACKET, 0, autoshift_dance}; | ||
733 | uint8_t state_79 = IDLE; | ||
734 | uint8_t counter_79 = 0; | ||
735 | const struct Chord chord_79 PROGMEM = {H_BOT6, NUM, &state_79, &counter_79, KC_BSLASH, 0, autoshift_dance}; | ||
736 | uint8_t state_80 = IDLE; | ||
737 | uint8_t counter_80 = 0; | ||
738 | const struct Chord chord_80 PROGMEM = {H_BOT7, NUM, &state_80, &counter_80, KC_QUOTE, 0, autoshift_dance}; | ||
739 | uint8_t state_81 = IDLE; | ||
740 | const struct Chord chord_81 PROGMEM = {H_BOT9, NUM, &state_81, NULL, KC_F11, 0, single_dance}; | ||
741 | uint8_t state_82 = IDLE; | ||
742 | const struct Chord chord_82 PROGMEM = {H_BOT0, NUM, &state_82, NULL, KC_F12, 0, single_dance}; | ||
743 | uint8_t state_83 = IDLE; | ||
744 | const struct Chord chord_83 PROGMEM = {H_TOP1 + H_TOP2, NUM, &state_83, NULL, KC_ESC, 0, single_dance}; | ||
745 | uint8_t state_84 = IDLE; | ||
746 | const struct Chord chord_84 PROGMEM = {H_TOP3 + H_TOP4, NUM, &state_84, NULL, KC_TAB, 0, single_dance}; | ||
747 | uint8_t state_85 = IDLE; | ||
748 | const struct Chord chord_85 PROGMEM = {H_TOP5 + H_TOP6, NUM, &state_85, NULL, KC_RGUI, 0, one_shot_key}; | ||
749 | uint8_t state_86 = IDLE; | ||
750 | const struct Chord chord_86 PROGMEM = {H_TOP7 + H_TOP8, NUM, &state_86, NULL, KC_INS, 0, single_dance}; | ||
751 | uint8_t state_87 = IDLE; | ||
752 | const struct Chord chord_87 PROGMEM = {H_TOP8 + H_TOP9, NUM, &state_87, NULL, KC_DEL, 0, single_dance}; | ||
753 | uint8_t state_88 = IDLE; | ||
754 | const struct Chord chord_88 PROGMEM = {H_TOP9 + H_TOP0, NUM, &state_88, NULL, KC_BSPC, 0, single_dance}; | ||
755 | uint8_t state_89 = IDLE; | ||
756 | const struct Chord chord_89 PROGMEM = {H_TOP9 + H_TOP0 + H_BOT9 + H_BOT0, NUM, &state_89, NULL, KC_ENTER, 0, single_dance}; | ||
757 | uint8_t state_90 = IDLE; | ||
758 | const struct Chord chord_90 PROGMEM = {H_BOT1 + H_BOT2, NUM, &state_90, NULL, KC_LSFT, 0, one_shot_key}; | ||
759 | uint8_t state_91 = IDLE; | ||
760 | const struct Chord chord_91 PROGMEM = {H_BOT2 + H_BOT3, NUM, &state_91, NULL, KC_LCTL, 0, one_shot_key}; | ||
761 | uint8_t state_92 = IDLE; | ||
762 | const struct Chord chord_92 PROGMEM = {H_BOT3 + H_BOT4, NUM, &state_92, NULL, KC_LALT, 0, one_shot_key}; | ||
763 | uint8_t state_93 = IDLE; | ||
764 | const struct Chord chord_93 PROGMEM = {H_BOT5 + H_BOT6, NUM, &state_93, NULL, KC_LGUI, 0, one_shot_key}; | ||
765 | uint8_t state_94 = IDLE; | ||
766 | const struct Chord chord_94 PROGMEM = {H_BOT7 + H_BOT8, NUM, &state_94, NULL, KC_RALT, 0, one_shot_key}; | ||
767 | uint8_t state_95 = IDLE; | ||
768 | const struct Chord chord_95 PROGMEM = {H_BOT8 + H_BOT9, NUM, &state_95, NULL, KC_RCTL, 0, one_shot_key}; | ||
769 | uint8_t state_96 = IDLE; | ||
770 | const struct Chord chord_96 PROGMEM = {H_BOT9 + H_BOT0, NUM, &state_96, NULL, KC_RSFT, 0, one_shot_key}; | ||
771 | uint8_t state_97 = IDLE; | ||
772 | const struct Chord chord_97 PROGMEM = {H_BOT1 + H_BOT0, NUM, &state_97, NULL, KC_SPACE, 0, single_dance}; | ||
773 | uint8_t state_98 = IDLE; | ||
774 | const struct Chord chord_98 PROGMEM = {H_TOP7, MOV, &state_98, NULL, KC_HOME, 0, single_dance}; | ||
775 | uint8_t state_99 = IDLE; | ||
776 | const struct Chord chord_99 PROGMEM = {H_TOP8, MOV, &state_99, NULL, KC_UP, 0, single_dance}; | ||
777 | uint8_t state_100 = IDLE; | ||
778 | const struct Chord chord_100 PROGMEM = {H_TOP9, MOV, &state_100, NULL, KC_END, 0, single_dance}; | ||
779 | uint8_t state_101 = IDLE; | ||
780 | const struct Chord chord_101 PROGMEM = {H_TOP0, MOV, &state_101, NULL, KC_PGUP, 0, single_dance}; | ||
781 | uint8_t state_102 = IDLE; | ||
782 | const struct Chord chord_102 PROGMEM = {H_BOT3, MOV, &state_102, NULL, KC_LSFT, 0, single_dance}; | ||
783 | uint8_t state_103 = IDLE; | ||
784 | const struct Chord chord_103 PROGMEM = {H_BOT4, MOV, &state_103, NULL, KC_LCTL, 0, single_dance}; | ||
785 | uint8_t state_104 = IDLE; | ||
786 | const struct Chord chord_104 PROGMEM = {H_BOT5, MOV, &state_104, NULL, KC_LALT, 0, single_dance}; | ||
787 | uint8_t state_105 = IDLE; | ||
788 | const struct Chord chord_105 PROGMEM = {H_BOT6, MOV, &state_105, NULL, KC_LGUI, 0, single_dance}; | ||
789 | uint8_t state_106 = IDLE; | ||
790 | const struct Chord chord_106 PROGMEM = {H_BOT7, MOV, &state_106, NULL, KC_LEFT, 0, single_dance}; | ||
791 | uint8_t state_107 = IDLE; | ||
792 | const struct Chord chord_107 PROGMEM = {H_BOT8, MOV, &state_107, NULL, KC_DOWN, 0, single_dance}; | ||
793 | uint8_t state_108 = IDLE; | ||
794 | const struct Chord chord_108 PROGMEM = {H_BOT9, MOV, &state_108, NULL, KC_RIGHT, 0, single_dance}; | ||
795 | uint8_t state_109 = IDLE; | ||
796 | const struct Chord chord_109 PROGMEM = {H_BOT0, MOV, &state_109, NULL, KC_PGDN, 0, single_dance}; | ||
797 | uint8_t state_110 = IDLE; | ||
798 | const struct Chord chord_110 PROGMEM = {H_TOP7, MOUSE, &state_110, NULL, KC_BTN1, 0, single_dance}; | ||
799 | uint8_t state_111 = IDLE; | ||
800 | const struct Chord chord_111 PROGMEM = {H_TOP8, MOUSE, &state_111, NULL, KC_MS_U, 0, single_dance}; | ||
801 | uint8_t state_112 = IDLE; | ||
802 | const struct Chord chord_112 PROGMEM = {H_TOP9, MOUSE, &state_112, NULL, KC_BTN2, 0, single_dance}; | ||
803 | uint8_t state_113 = IDLE; | ||
804 | const struct Chord chord_113 PROGMEM = {H_TOP0, MOUSE, &state_113, NULL, KC_WH_U, 0, single_dance}; | ||
805 | uint8_t state_114 = IDLE; | ||
806 | const struct Chord chord_114 PROGMEM = {H_BOT3, MOUSE, &state_114, NULL, KC_LSFT, 0, single_dance}; | ||
807 | uint8_t state_115 = IDLE; | ||
808 | const struct Chord chord_115 PROGMEM = {H_BOT4, MOUSE, &state_115, NULL, KC_LCTL, 0, single_dance}; | ||
809 | uint8_t state_116 = IDLE; | ||
810 | const struct Chord chord_116 PROGMEM = {H_BOT5, MOUSE, &state_116, NULL, KC_LALT, 0, single_dance}; | ||
811 | uint8_t state_117 = IDLE; | ||
812 | const struct Chord chord_117 PROGMEM = {H_BOT6, MOUSE, &state_117, NULL, KC_LGUI, 0, single_dance}; | ||
813 | uint8_t state_118 = IDLE; | ||
814 | const struct Chord chord_118 PROGMEM = {H_BOT7, MOUSE, &state_118, NULL, KC_MS_L, 0, single_dance}; | ||
815 | uint8_t state_119 = IDLE; | ||
816 | const struct Chord chord_119 PROGMEM = {H_BOT8, MOUSE, &state_119, NULL, KC_MS_D, 0, single_dance}; | ||
817 | uint8_t state_120 = IDLE; | ||
818 | const struct Chord chord_120 PROGMEM = {H_BOT9, MOUSE, &state_120, NULL, KC_MS_R, 0, single_dance}; | ||
819 | uint8_t state_121 = IDLE; | ||
820 | const struct Chord chord_121 PROGMEM = {H_BOT0, MOUSE, &state_121, NULL, KC_WH_D, 0, single_dance}; | ||
821 | uint8_t state_122 = IDLE; | ||
822 | const struct Chord chord_122 PROGMEM = {H_TOP1, ASETNIOP, &state_122, NULL, KC_A, 0, single_dance}; | ||
823 | uint8_t state_123 = IDLE; | ||
824 | const struct Chord chord_123 PROGMEM = {H_TOP2, ASETNIOP, &state_123, NULL, KC_S, 0, single_dance}; | ||
825 | uint8_t state_124 = IDLE; | ||
826 | const struct Chord chord_124 PROGMEM = {H_TOP3, ASETNIOP, &state_124, NULL, KC_E, 0, single_dance}; | ||
827 | uint8_t state_125 = IDLE; | ||
828 | const struct Chord chord_125 PROGMEM = {H_TOP4, ASETNIOP, &state_125, NULL, KC_T, 0, single_dance}; | ||
829 | uint8_t state_126 = IDLE; | ||
830 | const struct Chord chord_126 PROGMEM = {H_TOP7, ASETNIOP, &state_126, NULL, KC_N, 0, single_dance}; | ||
831 | uint8_t state_127 = IDLE; | ||
832 | const struct Chord chord_127 PROGMEM = {H_TOP8, ASETNIOP, &state_127, NULL, KC_I, 0, single_dance}; | ||
833 | uint8_t state_128 = IDLE; | ||
834 | const struct Chord chord_128 PROGMEM = {H_TOP9, ASETNIOP, &state_128, NULL, KC_O, 0, single_dance}; | ||
835 | uint8_t state_129 = IDLE; | ||
836 | const struct Chord chord_129 PROGMEM = {H_TOP0, ASETNIOP, &state_129, NULL, KC_P, 0, single_dance}; | ||
837 | uint8_t state_130 = IDLE; | ||
838 | const struct Chord chord_130 PROGMEM = {H_TOP1 + H_TOP2, ASETNIOP, &state_130, NULL, KC_W, 0, single_dance}; | ||
839 | uint8_t state_131 = IDLE; | ||
840 | const struct Chord chord_131 PROGMEM = {H_TOP2 + H_TOP3, ASETNIOP, &state_131, NULL, KC_D, 0, single_dance}; | ||
841 | uint8_t state_132 = IDLE; | ||
842 | const struct Chord chord_132 PROGMEM = {H_TOP3 + H_TOP4, ASETNIOP, &state_132, NULL, KC_R, 0, single_dance}; | ||
843 | uint8_t state_133 = IDLE; | ||
844 | const struct Chord chord_133 PROGMEM = {H_TOP4 + H_TOP7, ASETNIOP, &state_133, NULL, KC_B, 0, single_dance}; | ||
845 | uint8_t state_134 = IDLE; | ||
846 | const struct Chord chord_134 PROGMEM = {H_TOP7 + H_TOP8, ASETNIOP, &state_134, NULL, KC_H, 0, single_dance}; | ||
847 | uint8_t state_135 = IDLE; | ||
848 | const struct Chord chord_135 PROGMEM = {H_TOP8 + H_TOP9, ASETNIOP, &state_135, NULL, KC_L, 0, single_dance}; | ||
849 | uint8_t state_136 = IDLE; | ||
850 | const struct Chord chord_136 PROGMEM = {H_TOP9 + H_TOP0, ASETNIOP, &state_136, NULL, KC_SCOLON, 0, single_dance}; | ||
851 | uint8_t state_137 = IDLE; | ||
852 | const struct Chord chord_137 PROGMEM = {H_TOP1 + H_TOP3, ASETNIOP, &state_137, NULL, KC_X, 0, single_dance}; | ||
853 | uint8_t state_138 = IDLE; | ||
854 | const struct Chord chord_138 PROGMEM = {H_TOP2 + H_TOP4, ASETNIOP, &state_138, NULL, KC_C, 0, single_dance}; | ||
855 | uint8_t state_139 = IDLE; | ||
856 | const struct Chord chord_139 PROGMEM = {H_TOP3 + H_TOP7, ASETNIOP, &state_139, NULL, KC_Y, 0, single_dance}; | ||
857 | uint8_t state_140 = IDLE; | ||
858 | const struct Chord chord_140 PROGMEM = {H_TOP4 + H_TOP8, ASETNIOP, &state_140, NULL, KC_V, 0, single_dance}; | ||
859 | uint8_t state_141 = IDLE; | ||
860 | const struct Chord chord_141 PROGMEM = {H_TOP7 + H_TOP9, ASETNIOP, &state_141, NULL, KC_U, 0, single_dance}; | ||
861 | uint8_t state_142 = IDLE; | ||
862 | const struct Chord chord_142 PROGMEM = {H_TOP1 + H_TOP4, ASETNIOP, &state_142, NULL, KC_F, 0, single_dance}; | ||
863 | uint8_t state_143 = IDLE; | ||
864 | const struct Chord chord_143 PROGMEM = {H_TOP2 + H_TOP7, ASETNIOP, &state_143, NULL, KC_J, 0, single_dance}; | ||
865 | uint8_t state_144 = IDLE; | ||
866 | const struct Chord chord_144 PROGMEM = {H_TOP3 + H_TOP8, ASETNIOP, &state_144, NULL, KC_COMMA, 0, single_dance}; | ||
867 | uint8_t state_145 = IDLE; | ||
868 | const struct Chord chord_145 PROGMEM = {H_TOP4 + H_TOP9, ASETNIOP, &state_145, NULL, KC_G, 0, single_dance}; | ||
869 | uint8_t state_146 = IDLE; | ||
870 | const struct Chord chord_146 PROGMEM = {H_TOP7 + H_TOP0, ASETNIOP, &state_146, NULL, KC_M, 0, single_dance}; | ||
871 | uint8_t state_147 = IDLE; | ||
872 | const struct Chord chord_147 PROGMEM = {H_TOP1 + H_TOP7, ASETNIOP, &state_147, NULL, KC_Q, 0, single_dance}; | ||
873 | uint8_t state_148 = IDLE; | ||
874 | const struct Chord chord_148 PROGMEM = {H_TOP2 + H_TOP8, ASETNIOP, &state_148, NULL, KC_K, 0, single_dance}; | ||
875 | uint8_t state_149 = IDLE; | ||
876 | const struct Chord chord_149 PROGMEM = {H_TOP3 + H_TOP9, ASETNIOP, &state_149, NULL, KC_MINUS, 0, single_dance}; | ||
877 | uint8_t state_150 = IDLE; | ||
878 | const struct Chord chord_150 PROGMEM = {H_TOP4 + H_TOP0, ASETNIOP, &state_150, NULL, KC_BSPC, 0, single_dance}; | ||
879 | uint8_t state_151 = IDLE; | ||
880 | const struct Chord chord_151 PROGMEM = {H_TOP1 + H_TOP8, ASETNIOP, &state_151, NULL, KC_Z, 0, single_dance}; | ||
881 | uint8_t state_152 = IDLE; | ||
882 | const struct Chord chord_152 PROGMEM = {H_TOP2 + H_TOP9, ASETNIOP, &state_152, NULL, KC_DOT, 0, single_dance}; | ||
883 | uint8_t state_153 = IDLE; | ||
884 | const struct Chord chord_153 PROGMEM = {H_TOP3 + H_TOP0, ASETNIOP, &state_153, NULL, KC_QUOTE, 0, single_dance}; | ||
885 | uint8_t state_154 = IDLE; | ||
886 | const struct Chord chord_154 PROGMEM = {H_TOP1 + H_TOP9, ASETNIOP, &state_154, NULL, KC_LBRACKET, 0, single_dance}; | ||
887 | uint8_t state_155 = IDLE; | ||
888 | const struct Chord chord_155 PROGMEM = {H_TOP2 + H_TOP0, ASETNIOP, &state_155, NULL, KC_RBRACKET, 0, single_dance}; | ||
889 | uint8_t state_156 = IDLE; | ||
890 | const struct Chord chord_156 PROGMEM = {H_TOP1 + H_TOP0, ASETNIOP, &state_156, NULL, KC_SLASH, 0, single_dance}; | ||
891 | uint8_t state_157 = IDLE; | ||
892 | const struct Chord chord_157 PROGMEM = {H_TOP5, ASETNIOP, &state_157, NULL, KC_ESC, 0, single_dance}; | ||
893 | uint8_t state_158 = IDLE; | ||
894 | const struct Chord chord_158 PROGMEM = {H_TOP6, ASETNIOP, &state_158, NULL, KC_DEL, 0, single_dance}; | ||
895 | uint8_t state_159 = IDLE; | ||
896 | const struct Chord chord_159 PROGMEM = {H_BOT4, ASETNIOP, &state_159, NULL, KC_LSFT, 0, single_dance}; | ||
897 | uint8_t state_160 = IDLE; | ||
898 | const struct Chord chord_160 PROGMEM = {H_BOT5, ASETNIOP, &state_160, NULL, KC_LCTL, 0, single_dance}; | ||
899 | uint8_t state_161 = IDLE; | ||
900 | const struct Chord chord_161 PROGMEM = {H_BOT6, ASETNIOP, &state_161, NULL, KC_LALT, 0, single_dance}; | ||
901 | uint8_t state_162 = IDLE; | ||
902 | uint8_t counter_162 = 0; | ||
903 | const struct Chord chord_162 PROGMEM = {H_BOT7, ASETNIOP, &state_162, &counter_162, KC_SPACE, ASETNIOP_123, key_layer_dance}; | ||
904 | uint8_t state_163 = IDLE; | ||
905 | const struct Chord chord_163 PROGMEM = {H_TOP5 + H_TOP6, ASETNIOP, &state_163, NULL, KC_LGUI, 0, single_dance}; | ||
906 | uint8_t state_164 = IDLE; | ||
907 | const struct Chord chord_164 PROGMEM = {H_TOP1 + H_TOP2 + H_TOP3 + H_TOP4, ASETNIOP, &state_164, NULL, QWERTY, 0, perm_pseudolayer}; | ||
908 | uint8_t state_165 = IDLE; | ||
909 | const struct Chord chord_165 PROGMEM = {H_BOT4 + H_BOT7, ASETNIOP, &state_165, NULL, ASETNIOP_FN, 0, temp_pseudolayer}; | ||
910 | uint8_t state_166 = IDLE; | ||
911 | const struct Chord chord_166 PROGMEM = {H_TOP1, ASETNIOP_123, &state_166, NULL, KC_1, 0, single_dance}; | ||
912 | uint8_t state_167 = IDLE; | ||
913 | const struct Chord chord_167 PROGMEM = {H_TOP2, ASETNIOP_123, &state_167, NULL, KC_2, 0, single_dance}; | ||
914 | uint8_t state_168 = IDLE; | ||
915 | const struct Chord chord_168 PROGMEM = {H_TOP3, ASETNIOP_123, &state_168, NULL, KC_3, 0, single_dance}; | ||
916 | uint8_t state_169 = IDLE; | ||
917 | const struct Chord chord_169 PROGMEM = {H_TOP4, ASETNIOP_123, &state_169, NULL, KC_4, 0, single_dance}; | ||
918 | uint8_t state_170 = IDLE; | ||
919 | const struct Chord chord_170 PROGMEM = {H_TOP7, ASETNIOP_123, &state_170, NULL, KC_7, 0, single_dance}; | ||
920 | uint8_t state_171 = IDLE; | ||
921 | const struct Chord chord_171 PROGMEM = {H_TOP8, ASETNIOP_123, &state_171, NULL, KC_8, 0, single_dance}; | ||
922 | uint8_t state_172 = IDLE; | ||
923 | const struct Chord chord_172 PROGMEM = {H_TOP9, ASETNIOP_123, &state_172, NULL, KC_9, 0, single_dance}; | ||
924 | uint8_t state_173 = IDLE; | ||
925 | const struct Chord chord_173 PROGMEM = {H_TOP0, ASETNIOP_123, &state_173, NULL, KC_0, 0, single_dance}; | ||
926 | uint8_t state_174 = IDLE; | ||
927 | const struct Chord chord_174 PROGMEM = {H_TOP3 + H_TOP4, ASETNIOP_123, &state_174, NULL, KC_5, 0, single_dance}; | ||
928 | uint8_t state_175 = IDLE; | ||
929 | const struct Chord chord_175 PROGMEM = {H_TOP4 + H_TOP7, ASETNIOP_123, &state_175, NULL, KC_EQUAL, 0, single_dance}; | ||
930 | uint8_t state_176 = IDLE; | ||
931 | const struct Chord chord_176 PROGMEM = {H_TOP7 + H_TOP8, ASETNIOP_123, &state_176, NULL, KC_6, 0, single_dance}; | ||
932 | uint8_t state_177 = IDLE; | ||
933 | const struct Chord chord_177 PROGMEM = {H_TOP8 + H_TOP9, ASETNIOP_123, &state_177, NULL, KC_BSLASH, 0, single_dance}; | ||
934 | uint8_t state_178 = IDLE; | ||
935 | const struct Chord chord_178 PROGMEM = {H_TOP9 + H_TOP0, ASETNIOP_123, &state_178, NULL, KC_SCOLON, 0, single_dance}; | ||
936 | uint8_t state_179 = IDLE; | ||
937 | const struct Chord chord_179 PROGMEM = {H_TOP4 + H_TOP0, ASETNIOP_123, &state_179, NULL, KC_BSPC, 0, single_dance}; | ||
938 | uint8_t state_180 = IDLE; | ||
939 | const struct Chord chord_180 PROGMEM = {H_TOP5, ASETNIOP_123, &state_180, NULL, KC_ESC, 0, single_dance}; | ||
940 | uint8_t state_181 = IDLE; | ||
941 | const struct Chord chord_181 PROGMEM = {H_TOP6, ASETNIOP_123, &state_181, NULL, KC_DEL, 0, single_dance}; | ||
942 | uint8_t state_182 = IDLE; | ||
943 | const struct Chord chord_182 PROGMEM = {H_BOT4, ASETNIOP_123, &state_182, NULL, KC_LSFT, 0, single_dance}; | ||
944 | uint8_t state_183 = IDLE; | ||
945 | const struct Chord chord_183 PROGMEM = {H_BOT5, ASETNIOP_123, &state_183, NULL, KC_LCTL, 0, single_dance}; | ||
946 | uint8_t state_184 = IDLE; | ||
947 | const struct Chord chord_184 PROGMEM = {H_BOT6, ASETNIOP_123, &state_184, NULL, KC_LALT, 0, single_dance}; | ||
948 | uint8_t state_185 = IDLE; | ||
949 | const struct Chord chord_185 PROGMEM = {H_TOP5 + H_TOP6, ASETNIOP_123, &state_185, NULL, KC_LGUI, 0, single_dance}; | ||
950 | uint8_t state_186 = IDLE; | ||
951 | const struct Chord chord_186 PROGMEM = {H_TOP1, ASETNIOP_FN, &state_186, NULL, KC_HOME, 0, single_dance}; | ||
952 | uint8_t state_187 = IDLE; | ||
953 | const struct Chord chord_187 PROGMEM = {H_TOP2, ASETNIOP_FN, &state_187, NULL, KC_PGDN, 0, single_dance}; | ||
954 | uint8_t state_188 = IDLE; | ||
955 | const struct Chord chord_188 PROGMEM = {H_TOP3, ASETNIOP_FN, &state_188, NULL, KC_PGUP, 0, single_dance}; | ||
956 | uint8_t state_189 = IDLE; | ||
957 | const struct Chord chord_189 PROGMEM = {H_TOP4, ASETNIOP_FN, &state_189, NULL, KC_END, 0, single_dance}; | ||
958 | uint8_t state_190 = IDLE; | ||
959 | const struct Chord chord_190 PROGMEM = {H_TOP7, ASETNIOP_FN, &state_190, NULL, KC_LEFT, 0, single_dance}; | ||
960 | uint8_t state_191 = IDLE; | ||
961 | const struct Chord chord_191 PROGMEM = {H_TOP8, ASETNIOP_FN, &state_191, NULL, KC_DOWN, 0, single_dance}; | ||
962 | uint8_t state_192 = IDLE; | ||
963 | const struct Chord chord_192 PROGMEM = {H_TOP9, ASETNIOP_FN, &state_192, NULL, KC_UP, 0, single_dance}; | ||
964 | uint8_t state_193 = IDLE; | ||
965 | const struct Chord chord_193 PROGMEM = {H_TOP0, ASETNIOP_FN, &state_193, NULL, KC_RIGHT, 0, single_dance}; | ||
966 | uint8_t state_194 = IDLE; | ||
967 | const struct Chord chord_194 PROGMEM = {H_TOP1 + H_TOP2, ASETNIOP_FN, &state_194, NULL, KC_F1, 0, single_dance}; | ||
968 | uint8_t state_195 = IDLE; | ||
969 | const struct Chord chord_195 PROGMEM = {H_TOP2 + H_TOP3, ASETNIOP_FN, &state_195, NULL, KC_F2, 0, single_dance}; | ||
970 | uint8_t state_196 = IDLE; | ||
971 | const struct Chord chord_196 PROGMEM = {H_TOP3 + H_TOP4, ASETNIOP_FN, &state_196, NULL, KC_F3, 0, single_dance}; | ||
972 | uint8_t state_197 = IDLE; | ||
973 | const struct Chord chord_197 PROGMEM = {H_TOP4 + H_TOP7, ASETNIOP_FN, &state_197, NULL, KC_F4, 0, single_dance}; | ||
974 | uint8_t state_198 = IDLE; | ||
975 | const struct Chord chord_198 PROGMEM = {H_TOP7 + H_TOP8, ASETNIOP_FN, &state_198, NULL, KC_F5, 0, single_dance}; | ||
976 | uint8_t state_199 = IDLE; | ||
977 | const struct Chord chord_199 PROGMEM = {H_TOP8 + H_TOP9, ASETNIOP_FN, &state_199, NULL, KC_F6, 0, single_dance}; | ||
978 | uint8_t state_200 = IDLE; | ||
979 | const struct Chord chord_200 PROGMEM = {H_TOP9 + H_TOP0, ASETNIOP_FN, &state_200, NULL, KC_F7, 0, single_dance}; | ||
980 | uint8_t state_201 = IDLE; | ||
981 | const struct Chord chord_201 PROGMEM = {H_TOP1 + H_TOP3, ASETNIOP_FN, &state_201, NULL, KC_F10, 0, single_dance}; | ||
982 | uint8_t state_202 = IDLE; | ||
983 | const struct Chord chord_202 PROGMEM = {H_TOP8 + H_TOP0, ASETNIOP_FN, &state_202, NULL, KC_F8, 0, single_dance}; | ||
984 | uint8_t state_203 = IDLE; | ||
985 | const struct Chord chord_203 PROGMEM = {H_TOP1 + H_TOP4, ASETNIOP_FN, &state_203, NULL, KC_F11, 0, single_dance}; | ||
986 | uint8_t state_204 = IDLE; | ||
987 | const struct Chord chord_204 PROGMEM = {H_TOP7 + H_TOP0, ASETNIOP_FN, &state_204, NULL, KC_F9, 0, single_dance}; | ||
988 | uint8_t state_205 = IDLE; | ||
989 | const struct Chord chord_205 PROGMEM = {H_TOP1 + H_TOP7, ASETNIOP_FN, &state_205, NULL, KC_F12, 0, single_dance}; | ||
990 | uint8_t state_206 = IDLE; | ||
991 | const struct Chord chord_206 PROGMEM = {H_TOP4 + H_TOP0, ASETNIOP_FN, &state_206, NULL, KC_BSPC, 0, single_dance}; | ||
992 | uint8_t state_207 = IDLE; | ||
993 | const struct Chord chord_207 PROGMEM = {H_TOP5, ASETNIOP_FN, &state_207, NULL, KC_ESC, 0, single_dance}; | ||
994 | uint8_t state_208 = IDLE; | ||
995 | const struct Chord chord_208 PROGMEM = {H_TOP6, ASETNIOP_FN, &state_208, NULL, KC_DEL, 0, single_dance}; | ||
996 | uint8_t state_209 = IDLE; | ||
997 | const struct Chord chord_209 PROGMEM = {H_BOT4, ASETNIOP_FN, &state_209, NULL, KC_LSFT, 0, single_dance}; | ||
998 | uint8_t state_210 = IDLE; | ||
999 | const struct Chord chord_210 PROGMEM = {H_BOT5, ASETNIOP_FN, &state_210, NULL, KC_LCTL, 0, single_dance}; | ||
1000 | uint8_t state_211 = IDLE; | ||
1001 | const struct Chord chord_211 PROGMEM = {H_BOT6, ASETNIOP_FN, &state_211, NULL, KC_LALT, 0, single_dance}; | ||
1002 | uint8_t state_212 = IDLE; | ||
1003 | const struct Chord chord_212 PROGMEM = {H_TOP5 + H_TOP6, ASETNIOP_FN, &state_212, NULL, KC_LGUI, 0, single_dance}; | ||
1004 | |||
1005 | const struct Chord* const list_of_chords[] PROGMEM = { | ||
1006 | &chord_0, &chord_1, &chord_2, &chord_3, &chord_4, &chord_5, &chord_6, &chord_7, &chord_8, &chord_9, &chord_10, &chord_11, &chord_12, &chord_13, &chord_14, &chord_15, &chord_16, &chord_17, &chord_18, &chord_19, &chord_20, &chord_21, &chord_22, &chord_23, &chord_24, &chord_25, &chord_26, &chord_27, &chord_28, &chord_29, &chord_30, &chord_31, &chord_32, &chord_33, &chord_34, &chord_35, &chord_36, &chord_37, &chord_38, &chord_39, &chord_40, &chord_41, &chord_42, &chord_43, &chord_44, &chord_45, &chord_46, &chord_47, &chord_48, &chord_49, &chord_50, &chord_51, &chord_52, &chord_53, &chord_54, &chord_55, &chord_56, &chord_57, &chord_58, &chord_59, &chord_60, &chord_61, &chord_62, &chord_63, &chord_64, &chord_65, &chord_66, &chord_67, &chord_68, &chord_69, &chord_70, &chord_71, &chord_72, &chord_73, &chord_74, &chord_75, &chord_76, &chord_77, &chord_78, &chord_79, &chord_80, &chord_81, &chord_82, &chord_83, &chord_84, &chord_85, &chord_86, &chord_87, &chord_88, &chord_89, &chord_90, &chord_91, &chord_92, &chord_93, &chord_94, &chord_95, &chord_96, &chord_97, &chord_98, &chord_99, &chord_100, &chord_101, &chord_102, &chord_103, &chord_104, &chord_105, &chord_106, &chord_107, &chord_108, &chord_109, &chord_110, &chord_111, &chord_112, &chord_113, &chord_114, &chord_115, &chord_116, &chord_117, &chord_118, &chord_119, &chord_120, &chord_121, &chord_122, &chord_123, &chord_124, &chord_125, &chord_126, &chord_127, &chord_128, &chord_129, &chord_130, &chord_131, &chord_132, &chord_133, &chord_134, &chord_135, &chord_136, &chord_137, &chord_138, &chord_139, &chord_140, &chord_141, &chord_142, &chord_143, &chord_144, &chord_145, &chord_146, &chord_147, &chord_148, &chord_149, &chord_150, &chord_151, &chord_152, &chord_153, &chord_154, &chord_155, &chord_156, &chord_157, &chord_158, &chord_159, &chord_160, &chord_161, &chord_162, &chord_163, &chord_164, &chord_165, &chord_166, &chord_167, &chord_168, &chord_169, &chord_170, &chord_171, &chord_172, &chord_173, &chord_174, &chord_175, &chord_176, &chord_177, &chord_178, &chord_179, &chord_180, &chord_181, &chord_182, &chord_183, &chord_184, &chord_185, &chord_186, &chord_187, &chord_188, &chord_189, &chord_190, &chord_191, &chord_192, &chord_193, &chord_194, &chord_195, &chord_196, &chord_197, &chord_198, &chord_199, &chord_200, &chord_201, &chord_202, &chord_203, &chord_204, &chord_205, &chord_206, &chord_207, &chord_208, &chord_209, &chord_210, &chord_211, &chord_212 | ||
1007 | }; | ||
1008 | |||
1009 | const uint16_t** const leader_triggers PROGMEM = NULL; | ||
1010 | void (*leader_functions[]) (void) = {}; | ||
1011 | |||
1012 | #define NUMBER_OF_CHORDS 213 | ||
1013 | #define NUMBER_OF_LEADER_COMBOS 0 | ||
1014 | |||
1015 | bool are_hashed_keycodes_in_sound(HASH_TYPE keycodes_hash, HASH_TYPE sound) { | ||
1016 | return (keycodes_hash & sound) == keycodes_hash; | ||
1017 | } | ||
1018 | |||
1019 | uint8_t keycode_to_index(uint16_t keycode) { | ||
1020 | return keycode - FIRST_INTERNAL_KEYCODE; | ||
1021 | } | ||
1022 | |||
1023 | void sound_keycode_array(uint16_t keycode) { | ||
1024 | uint8_t index = keycode_to_index(keycode); | ||
1025 | keycode_index++; | ||
1026 | keycodes_buffer_array[index] = keycode_index; | ||
1027 | } | ||
1028 | |||
1029 | void silence_keycode_hash_array(HASH_TYPE keycode_hash) { | ||
1030 | for (int i = 0; i < NUMBER_OF_KEYS; i++) { | ||
1031 | bool index_in_hash = ((HASH_TYPE) 1 << i) & keycode_hash; | ||
1032 | if (index_in_hash) { | ||
1033 | uint8_t current_val = keycodes_buffer_array[i]; | ||
1034 | keycodes_buffer_array[i] = 0; | ||
1035 | for (int j = 0; j < NUMBER_OF_KEYS; j++) { | ||
1036 | if (keycodes_buffer_array[j] > current_val) { | ||
1037 | keycodes_buffer_array[j]--; | ||
1038 | } | ||
1039 | } | ||
1040 | keycode_index--; | ||
1041 | } | ||
1042 | } | ||
1043 | } | ||
1044 | |||
1045 | bool are_hashed_keycodes_in_array(HASH_TYPE keycode_hash) { | ||
1046 | for (int i = 0; i < NUMBER_OF_KEYS; i++) { | ||
1047 | bool index_in_hash = ((HASH_TYPE) 1 << i) & keycode_hash; | ||
1048 | bool index_in_array = (bool) keycodes_buffer_array[i]; | ||
1049 | if (index_in_hash && !index_in_array) { | ||
1050 | return false; | ||
1051 | } | ||
1052 | } | ||
1053 | return true; | ||
1054 | } | ||
1055 | |||
1056 | void kill_one_shots(void) { | ||
1057 | struct Chord chord_storage; | ||
1058 | struct Chord* chord_ptr; | ||
1059 | struct Chord* chord; | ||
1060 | |||
1061 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1062 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1063 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1064 | chord = &chord_storage; | ||
1065 | |||
1066 | if (*chord->state == IN_ONE_SHOT) { | ||
1067 | *chord->state = RESTART; | ||
1068 | chord->function(chord); | ||
1069 | if (*chord->state == RESTART) { | ||
1070 | *chord->state = IDLE; | ||
1071 | } | ||
1072 | } | ||
1073 | } | ||
1074 | } | ||
1075 | |||
1076 | void process_finished_dances(void) { | ||
1077 | struct Chord chord_storage; | ||
1078 | struct Chord* chord_ptr; | ||
1079 | struct Chord* chord; | ||
1080 | |||
1081 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1082 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1083 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1084 | chord = &chord_storage; | ||
1085 | |||
1086 | if (*chord->state == ACTIVATED) { | ||
1087 | *chord->state = PRESS_FROM_ACTIVE; | ||
1088 | chord->function(chord); | ||
1089 | if (a_key_went_through) { | ||
1090 | kill_one_shots(); | ||
1091 | } | ||
1092 | dance_timer = timer_read(); | ||
1093 | } else if (*chord->state == IDLE_IN_DANCE) { | ||
1094 | *chord->state = FINISHED; | ||
1095 | chord->function(chord); | ||
1096 | if (*chord->state == FINISHED) { | ||
1097 | *chord->state = RESTART; | ||
1098 | if (*chord->state == RESTART) { | ||
1099 | *chord->state = IDLE; | ||
1100 | } | ||
1101 | } | ||
1102 | } else if (*chord->state == PRESS_FROM_ACTIVE) { | ||
1103 | *chord->state = FINISHED_FROM_ACTIVE; | ||
1104 | chord->function(chord); | ||
1105 | if (a_key_went_through) { | ||
1106 | kill_one_shots(); | ||
1107 | } | ||
1108 | dance_timer = timer_read(); | ||
1109 | } | ||
1110 | } | ||
1111 | } | ||
1112 | |||
1113 | uint8_t keycodes_buffer_array_min(uint8_t* first_keycode_index) { | ||
1114 | for (int i = 0; i < NUMBER_OF_KEYS; i++) { | ||
1115 | if (keycodes_buffer_array[i] == 1) { | ||
1116 | if (first_keycode_index != NULL) { | ||
1117 | *first_keycode_index = (uint8_t) i; | ||
1118 | } | ||
1119 | return 1; | ||
1120 | } | ||
1121 | } | ||
1122 | return 0; | ||
1123 | } | ||
1124 | |||
1125 | void remove_subchords(void) { | ||
1126 | struct Chord chord_storage; | ||
1127 | struct Chord* chord_ptr; | ||
1128 | struct Chord* chord; | ||
1129 | |||
1130 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1131 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1132 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1133 | chord = &chord_storage; | ||
1134 | |||
1135 | if (!(*chord->state == READY || *chord->state == READY_IN_DANCE || *chord->state == READY_LOCKED)) { | ||
1136 | continue; | ||
1137 | } | ||
1138 | |||
1139 | struct Chord chord_storage_2; | ||
1140 | struct Chord* chord_ptr_2; | ||
1141 | struct Chord* chord_2; | ||
1142 | for (int j = 0; j < NUMBER_OF_CHORDS; j++) { | ||
1143 | if (i == j) {continue;} | ||
1144 | |||
1145 | chord_ptr_2 = (struct Chord*) pgm_read_word (&list_of_chords[j]); | ||
1146 | memcpy_P(&chord_storage_2, chord_ptr_2, sizeof(struct Chord)); | ||
1147 | chord_2 = &chord_storage_2; | ||
1148 | |||
1149 | if (are_hashed_keycodes_in_sound(chord_2->keycodes_hash, chord->keycodes_hash)) { | ||
1150 | if (*chord_2->state == READY) { | ||
1151 | *chord_2->state = IDLE; | ||
1152 | } | ||
1153 | if (*chord_2->state == READY_IN_DANCE) { | ||
1154 | *chord_2->state = IDLE_IN_DANCE; | ||
1155 | } | ||
1156 | if (*chord_2->state == READY_LOCKED) { | ||
1157 | *chord_2->state = LOCKED; | ||
1158 | } | ||
1159 | } | ||
1160 | } | ||
1161 | } | ||
1162 | } | ||
1163 | |||
1164 | void process_ready_chords(void) { | ||
1165 | uint8_t first_keycode_index = 0; | ||
1166 | while (keycodes_buffer_array_min(&first_keycode_index)) { | ||
1167 | // find ready chords | ||
1168 | struct Chord chord_storage; | ||
1169 | struct Chord* chord_ptr; | ||
1170 | struct Chord* chord; | ||
1171 | |||
1172 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1173 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1174 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1175 | chord = &chord_storage; | ||
1176 | |||
1177 | // if the chord does not contain the first keycode | ||
1178 | bool contains_first_keycode = ((uint32_t) 1 << first_keycode_index) & chord->keycodes_hash; | ||
1179 | if (!contains_first_keycode) { | ||
1180 | continue; | ||
1181 | } | ||
1182 | |||
1183 | if (!are_hashed_keycodes_in_array(chord->keycodes_hash)){ | ||
1184 | continue; | ||
1185 | } | ||
1186 | |||
1187 | if (*chord->state == LOCKED) { | ||
1188 | *chord->state = READY_LOCKED; | ||
1189 | continue; | ||
1190 | } | ||
1191 | |||
1192 | if (!(chord->pseudolayer == current_pseudolayer || chord->pseudolayer == ALWAYS_ON)) { | ||
1193 | continue; | ||
1194 | } | ||
1195 | |||
1196 | if (*chord->state == IDLE) { | ||
1197 | *chord->state = READY; | ||
1198 | continue; | ||
1199 | } | ||
1200 | |||
1201 | if (*chord->state == IDLE_IN_DANCE) { | ||
1202 | *chord->state = READY_IN_DANCE; | ||
1203 | } | ||
1204 | } | ||
1205 | |||
1206 | // remove subchords | ||
1207 | remove_subchords(); | ||
1208 | |||
1209 | // execute logic | ||
1210 | // this should be only one chord | ||
1211 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1212 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1213 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1214 | chord = &chord_storage; | ||
1215 | |||
1216 | if (*chord->state == READY_LOCKED) { | ||
1217 | *chord->state = RESTART; | ||
1218 | chord->function(chord); | ||
1219 | if (*chord->state == RESTART) { | ||
1220 | *chord->state = IDLE; | ||
1221 | } | ||
1222 | break; | ||
1223 | } | ||
1224 | |||
1225 | if (*chord->state == READY || *chord->state == READY_IN_DANCE) { | ||
1226 | if (last_chord && last_chord != chord) { | ||
1227 | process_finished_dances(); | ||
1228 | } | ||
1229 | |||
1230 | bool lock_next_prev_state = lock_next; | ||
1231 | |||
1232 | *chord->state = ACTIVATED; | ||
1233 | chord->function(chord); | ||
1234 | dance_timer = timer_read(); | ||
1235 | |||
1236 | if (lock_next && lock_next == lock_next_prev_state) { | ||
1237 | lock_next = false; | ||
1238 | *chord->state = PRESS_FROM_ACTIVE; | ||
1239 | chord->function(chord); | ||
1240 | if (*chord->state == PRESS_FROM_ACTIVE) { | ||
1241 | *chord->state = LOCKED; | ||
1242 | } | ||
1243 | if (a_key_went_through) { | ||
1244 | kill_one_shots(); | ||
1245 | } | ||
1246 | } | ||
1247 | break; | ||
1248 | } | ||
1249 | } | ||
1250 | |||
1251 | // silence notes | ||
1252 | silence_keycode_hash_array(chord->keycodes_hash); | ||
1253 | } | ||
1254 | } | ||
1255 | |||
1256 | void deactivate_active_chords(uint16_t keycode) { | ||
1257 | HASH_TYPE hash = (HASH_TYPE)1 << (keycode - SAFE_RANGE); | ||
1258 | bool broken; | ||
1259 | struct Chord chord_storage; | ||
1260 | struct Chord* chord_ptr; | ||
1261 | struct Chord* chord; | ||
1262 | |||
1263 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1264 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1265 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1266 | chord = &chord_storage; | ||
1267 | |||
1268 | broken = are_hashed_keycodes_in_sound(hash, chord->keycodes_hash); | ||
1269 | if (!broken) { | ||
1270 | continue; | ||
1271 | } | ||
1272 | |||
1273 | switch (*chord->state) { | ||
1274 | case ACTIVATED: | ||
1275 | *chord->state = DEACTIVATED; | ||
1276 | chord->function(chord); | ||
1277 | |||
1278 | if (*chord->state == DEACTIVATED) { | ||
1279 | dance_timer = timer_read(); | ||
1280 | *chord->state = IDLE_IN_DANCE; | ||
1281 | } | ||
1282 | if (*chord->state != IN_ONE_SHOT) { | ||
1283 | kill_one_shots(); | ||
1284 | } | ||
1285 | break; | ||
1286 | case PRESS_FROM_ACTIVE: | ||
1287 | case FINISHED_FROM_ACTIVE: | ||
1288 | *chord->state = RESTART; | ||
1289 | chord->function(chord); | ||
1290 | if (*chord->state == RESTART) { | ||
1291 | *chord->state = IDLE; | ||
1292 | } | ||
1293 | kill_one_shots(); | ||
1294 | break; | ||
1295 | default: | ||
1296 | break; | ||
1297 | } | ||
1298 | } | ||
1299 | |||
1300 | } | ||
1301 | |||
1302 | void process_command(void) { | ||
1303 | command_mode = 0; | ||
1304 | for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { | ||
1305 | if (command_buffer[i]) { | ||
1306 | register_code(command_buffer[i]); | ||
1307 | } | ||
1308 | send_keyboard_report(); | ||
1309 | } | ||
1310 | wait_ms(TAP_TIMEOUT); | ||
1311 | for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { | ||
1312 | if (command_buffer[i]) { | ||
1313 | unregister_code(command_buffer[i]); | ||
1314 | } | ||
1315 | send_keyboard_report(); | ||
1316 | } | ||
1317 | for (int i = 0; i < COMMAND_MAX_LENGTH; i++) { | ||
1318 | command_buffer[i] = 0; | ||
1319 | } | ||
1320 | command_ind = 0; | ||
1321 | } | ||
1322 | |||
1323 | void process_leader(void) { | ||
1324 | in_leader_mode = false; | ||
1325 | for (int i = 0; i < NUMBER_OF_LEADER_COMBOS; i++) { | ||
1326 | uint16_t trigger[LEADER_MAX_LENGTH]; | ||
1327 | memcpy_P(trigger, leader_triggers[i], LEADER_MAX_LENGTH * sizeof(uint16_t)); | ||
1328 | |||
1329 | if (identical(leader_buffer, trigger)) { | ||
1330 | (*leader_functions[i])(); | ||
1331 | break; | ||
1332 | } | ||
1333 | } | ||
1334 | for (int i = 0; i < LEADER_MAX_LENGTH; i++) { | ||
1335 | leader_buffer[i] = 0; | ||
1336 | } | ||
1337 | } | ||
1338 | |||
1339 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
1340 | if (keycode < FIRST_INTERNAL_KEYCODE || keycode > LAST_INTERNAL_KEYCODE) { | ||
1341 | return true; | ||
1342 | } | ||
1343 | |||
1344 | if (record->event.pressed) { | ||
1345 | sound_keycode_array(keycode); | ||
1346 | } else { | ||
1347 | process_ready_chords(); | ||
1348 | deactivate_active_chords(keycode); | ||
1349 | } | ||
1350 | chord_timer = timer_read(); | ||
1351 | leader_timer = timer_read(); | ||
1352 | |||
1353 | return false; | ||
1354 | } | ||
1355 | |||
1356 | void matrix_scan_user(void) { | ||
1357 | bool chord_timer_expired = timer_elapsed(chord_timer) > CHORD_TIMEOUT; | ||
1358 | if (chord_timer_expired && keycodes_buffer_array_min(NULL)) { | ||
1359 | process_ready_chords(); | ||
1360 | } | ||
1361 | |||
1362 | bool dance_timer_expired = timer_elapsed(dance_timer) > DANCE_TIMEOUT; | ||
1363 | if (dance_timer_expired) { // would love to have && in_dance but not sure how | ||
1364 | process_finished_dances(); | ||
1365 | } | ||
1366 | |||
1367 | bool in_command_mode = command_mode == 2; | ||
1368 | if (in_command_mode) { | ||
1369 | process_command(); | ||
1370 | } | ||
1371 | |||
1372 | bool leader_timer_expired = timer_elapsed(leader_timer) > LEADER_TIMEOUT; | ||
1373 | if (leader_timer_expired && in_leader_mode) { | ||
1374 | process_leader(); | ||
1375 | } | ||
1376 | |||
1377 | } | ||
1378 | |||
1379 | void clear(const struct Chord* self) { | ||
1380 | if (*self->state == ACTIVATED) { | ||
1381 | // kill all chords | ||
1382 | struct Chord chord_storage; | ||
1383 | struct Chord* chord_ptr; | ||
1384 | struct Chord* chord; | ||
1385 | |||
1386 | for (int i = 0; i < NUMBER_OF_CHORDS; i++) { | ||
1387 | chord_ptr = (struct Chord*) pgm_read_word (&list_of_chords[i]); | ||
1388 | memcpy_P(&chord_storage, chord_ptr, sizeof(struct Chord)); | ||
1389 | chord = &chord_storage; | ||
1390 | |||
1391 | *chord->state = IDLE; | ||
1392 | |||
1393 | if (chord->counter) { | ||
1394 | *chord->counter = 0; | ||
1395 | } | ||
1396 | } | ||
1397 | |||
1398 | // clear keyboard | ||
1399 | clear_keyboard(); | ||
1400 | send_keyboard_report(); | ||
1401 | |||
1402 | // switch to default pseudolayer | ||
1403 | current_pseudolayer = DEFAULT_PSEUDOLAYER; | ||
1404 | |||
1405 | // clear all keyboard states | ||
1406 | lock_next = false; | ||
1407 | autoshift_mode = true; | ||
1408 | command_mode = 0; | ||
1409 | in_leader_mode = false; | ||
1410 | leader_ind = 0; | ||
1411 | dynamic_macro_mode = false; | ||
1412 | a_key_went_through = false; | ||
1413 | |||
1414 | for (int i = 0; i < DYNAMIC_MACRO_MAX_LENGTH; i++) { | ||
1415 | dynamic_macro_buffer[i] = 0; | ||
1416 | } | ||
1417 | } | ||
1418 | } \ No newline at end of file | ||
diff --git a/keyboards/butterstick/keymaps/dennytom/keymap_def.json b/keyboards/butterstick/keymaps/dennytom/keymap_def.json new file mode 100644 index 000000000..16f02ca52 --- /dev/null +++ b/keyboards/butterstick/keymaps/dennytom/keymap_def.json | |||
@@ -0,0 +1,309 @@ | |||
1 | { | ||
2 | "keys": [ | ||
3 | "TOP1", "TOP2", "TOP3", "TOP4", "TOP5", "TOP6", "TOP7", "TOP8", "TOP9", "TOP0", | ||
4 | "BOT1", "BOT2", "BOT3", "BOT4", "BOT5", "BOT6", "BOT7", "BOT8", "BOT9", "BOT0" | ||
5 | ], | ||
6 | "parameters": { | ||
7 | "layout_function_name": "LAYOUT_butter", | ||
8 | "chord_timeout": 100, | ||
9 | "dance_timeout": 200, | ||
10 | "leader_timeout": 750, | ||
11 | "tap_timeout": 50, | ||
12 | "command_max_length": 5, | ||
13 | "leader_max_length": 5, | ||
14 | "dynamic_macro_max_length": 20, | ||
15 | "string_max_length": 16, | ||
16 | "long_press_multiplier": 3, | ||
17 | "default_pseudolayer": "QWERTY" | ||
18 | }, | ||
19 | "layers": [ | ||
20 | { | ||
21 | "type": "auto" | ||
22 | } | ||
23 | ], | ||
24 | "chord_sets": [ | ||
25 | { | ||
26 | "name": "rows", | ||
27 | "chords": [ | ||
28 | ["TOP1"], ["TOP2"], ["TOP3"], ["TOP4"], ["TOP5"], ["TOP6"], ["TOP7"], ["TOP8"], ["TOP9"], ["TOP0"], | ||
29 | ["TOP1", "BOT1"], ["TOP2", "BOT2"], ["TOP3", "BOT3"], ["TOP4", "BOT4"], ["TOP5", "BOT5"], ["TOP6", "BOT6"], ["TOP7", "BOT7"], ["TOP8", "BOT8"], ["TOP9", "BOT9"], ["TOP0", "BOT0"], | ||
30 | ["BOT1"], ["BOT2"], ["BOT3"], ["BOT4"], ["BOT5"], ["BOT6"], ["BOT7"], ["BOT8"], ["BOT9"], ["BOT0"] | ||
31 | ] | ||
32 | }, | ||
33 | { | ||
34 | "name": "cols", | ||
35 | "chords": [ | ||
36 | ["TOP1", "TOP2"], ["TOP2", "TOP3"], ["TOP3", "TOP4"], ["TOP4", "TOP5"], ["TOP5", "TOP6"], ["TOP6", "TOP7"], ["TOP7", "TOP8"], ["TOP8", "TOP9"], ["TOP9", "TOP0"], | ||
37 | ["TOP1", "TOP2", "BOT1", "BOT2"], ["TOP2", "TOP3", "BOT2", "BOT3"], ["TOP3", "TOP4", "BOT3", "BOT4"], ["TOP4", "TOP5", "BOT4", "BOT5"], ["TOP5", "TOP6", "BOT5", "BOT6"], ["TOP6", "TOP7", "BOT6", "BOT7"], ["TOP7", "TOP8", "BOT7", "BOT8"], ["TOP8", "TOP9", "BOT8", "BOT9"], ["TOP9", "TOP0", "BOT9", "BOT0"], | ||
38 | ["BOT1", "BOT2"], ["BOT2", "BOT3"], ["BOT3", "BOT4"], ["BOT4", "BOT5"], ["BOT5", "BOT6"], ["BOT6", "BOT7"], ["BOT7", "BOT8"], ["BOT8", "BOT9"], ["BOT9", "BOT0"] | ||
39 | ] | ||
40 | }, | ||
41 | { | ||
42 | "name": "asetniop", | ||
43 | "chords": [ | ||
44 | ["TOP1"], ["TOP2"], ["TOP3"], ["TOP4"], ["TOP7"], ["TOP8"], ["TOP9"], ["TOP0"], | ||
45 | ["TOP1", "TOP2"], ["TOP2", "TOP3"], ["TOP3", "TOP4"], ["TOP4", "TOP7"], ["TOP7", "TOP8"], ["TOP8", "TOP9"], ["TOP9", "TOP0"], | ||
46 | ["TOP1", "TOP3"], ["TOP2", "TOP4"], ["TOP3", "TOP7"], ["TOP4", "TOP8"], ["TOP7", "TOP9"], ["TOP8", "TOP0"], | ||
47 | ["TOP1", "TOP4"], ["TOP2", "TOP7"], ["TOP3", "TOP8"], ["TOP4", "TOP9"], ["TOP7", "TOP0"], | ||
48 | ["TOP1", "TOP7"], ["TOP2", "TOP8"], ["TOP3", "TOP9"], ["TOP4", "TOP0"], | ||
49 | ["TOP1", "TOP8"], ["TOP2", "TOP9"], ["TOP3", "TOP0"], | ||
50 | ["TOP1", "TOP9"], ["TOP2", "TOP0"], | ||
51 | ["TOP1", "TOP0"] | ||
52 | ] | ||
53 | } | ||
54 | ], | ||
55 | "pseudolayers": [ | ||
56 | { | ||
57 | "name": "ALWAYS_ON", | ||
58 | "chords": [ | ||
59 | { | ||
60 | "type": "chord_set", | ||
61 | "set": "cols", | ||
62 | "keycodes": [ | ||
63 | " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
64 | "LOCK", " AT", " ", " ", " CMD", " ", " ", " ", " ", | ||
65 | " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
66 | ] | ||
67 | }, | ||
68 | { | ||
69 | "type": "visual", | ||
70 | "chord": [ | ||
71 | "X", "X", " ", " ", " ", " ", " ", " ", "X", "X", | ||
72 | "X", "X", " ", " ", " ", " ", " ", " ", "X", "X" | ||
73 | ], | ||
74 | "keycode": "CLEAR_KB" | ||
75 | } | ||
76 | ] | ||
77 | }, | ||
78 | { | ||
79 | "name": "QWERTY", | ||
80 | "chords": [ | ||
81 | { | ||
82 | "type": "chord_set", | ||
83 | "set": "rows", | ||
84 | "keycodes": [ | ||
85 | "AS(Q)", "AS(W)", "AS(E)", "AS(R)", "AS(T)", "AS(Y)", "AS(U)", "AS(I)", "AS(O)", "AS(P)", | ||
86 | "AS(A)", "AS(S)", "AS(D)", "AS(F)", "AS(G)", "AS(H)", "AS(J)", "AS(K)", "AS(L)", "AS(;)", | ||
87 | "AS(Z)", "AS(X)", "AS(C)", "AS(V)", "AS(B)", "AS(N)", "AS(M)", "AS(,)", "AS(.)", "AS(/)" | ||
88 | ] | ||
89 | }, | ||
90 | { | ||
91 | "type": "chord_set", | ||
92 | "set": "cols", | ||
93 | "keycodes": [ | ||
94 | " ESC", "MO(MOV)", " TAB", " ", "O(RGUI)", " ", " INS", " DEL", " BSPC", | ||
95 | " ", " ", " ", " ", " ", " ", " ", " ", " ENTER", | ||
96 | "O(LSFT)", "O(LCTL)", "O(LALT)", "O(NUM)", "O(LGUI)", "O(NUM)", "O(RALT)", "O(RCTL)", "O(RSFT)" | ||
97 | ] | ||
98 | }, | ||
99 | { | ||
100 | "type": "simple", | ||
101 | "chord": ["BOT1", "BOT0"], | ||
102 | "keycode": "SPACE" | ||
103 | }, | ||
104 | { | ||
105 | "type": "visual", | ||
106 | "chord": [ | ||
107 | "X", "X", "X", "X", " ", " ", " ", " ", " ", " ", | ||
108 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
109 | ], | ||
110 | "keycode": "MO(MOUSE)" | ||
111 | }, | ||
112 | { | ||
113 | "type": "visual", | ||
114 | "chord": [ | ||
115 | "X", "X", "X", "X", " ", " ", "X", "X", "X", "X", | ||
116 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
117 | ], | ||
118 | "keycode": "DF(ASETNIOP)" | ||
119 | } | ||
120 | ] | ||
121 | }, | ||
122 | { | ||
123 | "name": "NUM", | ||
124 | "chords": [ | ||
125 | { | ||
126 | "type": "chord_set", | ||
127 | "set": "rows", | ||
128 | "keycodes": [ | ||
129 | "AS(1)", "AS(2)", "AS(3)", "AS(4)", "AS(5)", "AS(6)", "AS(7)", "AS(8)", "AS(9)", "AS(0)", | ||
130 | " F1", " F2", " F3", " F4", " F5", " F6", " F7", " F8", " F9", " F10", | ||
131 | "AS(`)", "AS(-)", "AS(=)", "AS([)", "AS(])", "AS(\\)", "AS(')", " ", " F11", " F12" | ||
132 | ] | ||
133 | }, | ||
134 | { | ||
135 | "type": "chord_set", | ||
136 | "set": "cols", | ||
137 | "keycodes": [ | ||
138 | " ESC", " ", " TAB", " ", "O(RGUI)", " ", " INS", " DEL", " BSPC", | ||
139 | " ", " ", " ", " ", " ", " ", " ", " ", " ENTER", | ||
140 | "O(LSFT)", "O(LCTL)", "O(LALT)", " ", "O(LGUI)", " ", "O(RALT)", "O(RCTL)", " O(RSFT)" | ||
141 | ] | ||
142 | }, | ||
143 | { | ||
144 | "type": "simple", | ||
145 | "chord": ["BOT1", "BOT0"], | ||
146 | "keycode": "SPACE" | ||
147 | } | ||
148 | ] | ||
149 | }, | ||
150 | { | ||
151 | "name": "MOV", | ||
152 | "chords": [ | ||
153 | { | ||
154 | "type": "chord_set", | ||
155 | "set": "rows", | ||
156 | "keycodes": [ | ||
157 | " ", " ", " ", " ", " ", " ", " HOME", " UP", " END", " PGUP", | ||
158 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
159 | " ", " ", " LSFT", " LCTL", " LALT", " LGUI", " LEFT", " DOWN", "RIGHT", " PGDN" | ||
160 | ] | ||
161 | } | ||
162 | ] | ||
163 | }, | ||
164 | { | ||
165 | "name": "MOUSE", | ||
166 | "chords": [ | ||
167 | { | ||
168 | "type": "chord_set", | ||
169 | "set": "rows", | ||
170 | "keycodes": [ | ||
171 | " ", " ", " ", " ", " ", " ", " BTN1", " MS_U", " BTN2", " WH_U", | ||
172 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
173 | " ", " ", " LSFT", " LCTL", " LALT", " LGUI", " MS_L", " MS_D", " MS_R", " WH_D" | ||
174 | ] | ||
175 | } | ||
176 | ] | ||
177 | }, | ||
178 | { | ||
179 | "name": "ASETNIOP", | ||
180 | "chords": [ | ||
181 | { | ||
182 | "type": "chord_set", | ||
183 | "set": "asetniop", | ||
184 | "keycodes": [ | ||
185 | "A", "S", "E", "T", "N", "I", "O", "P", | ||
186 | "W", "D", "R", "B", "H", "L", ";", | ||
187 | "X", "C", "Y", "V", "U", "", | ||
188 | "F", "J", ",", "G", "M", | ||
189 | "Q", "K", "-", "BSPC", | ||
190 | "Z", ".", "'", | ||
191 | "[", "]", | ||
192 | "/" | ||
193 | ] | ||
194 | }, | ||
195 | { | ||
196 | "type": "chord_set", | ||
197 | "set": "rows", | ||
198 | "keycodes": [ | ||
199 | " ", " ", " ", " ", " ESC", " DEL", " ", " ", " ", " ", | ||
200 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
201 | " ", " ", " ", "LSFT", "LCTL", "LALT", "KL(SPACE, ASETNIOP_123)", "", "", "" | ||
202 | ] | ||
203 | }, | ||
204 | { | ||
205 | "type": "chord_set", | ||
206 | "set": "cols", | ||
207 | "keycodes": [ | ||
208 | " ", " ", " ", " ", "LGUI", " ", " ", " ", " ", | ||
209 | " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
210 | " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
211 | ] | ||
212 | }, | ||
213 | { | ||
214 | "type": "visual", | ||
215 | "chord": [ | ||
216 | "X", "X", "X", "X", " ", " ", " ", " ", " ", " ", | ||
217 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
218 | ], | ||
219 | "keycode": "DF(QWERTY)" | ||
220 | }, | ||
221 | { | ||
222 | "type": "visual", | ||
223 | "chord": [ | ||
224 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
225 | " ", " ", " ", "X", " ", " ", "X", " ", " ", " " | ||
226 | ], | ||
227 | "keycode": "MO(ASETNIOP_FN)" | ||
228 | } | ||
229 | ] | ||
230 | }, | ||
231 | { | ||
232 | "name": "ASETNIOP_123", | ||
233 | "chords": [ | ||
234 | { | ||
235 | "type": "chord_set", | ||
236 | "set": "asetniop", | ||
237 | "keycodes": [ | ||
238 | "1", "2", "3", "4", "7", "8", "9", "0", | ||
239 | " ", " ", "5", "=", "6", "\\", ";", | ||
240 | " ", " ", " ", " ", " ", " ", | ||
241 | " ", " ", " ", " ", " ", | ||
242 | " ", " ", " ", "BSPC", | ||
243 | " ", " ", " ", | ||
244 | " ", " ", | ||
245 | " " | ||
246 | ] | ||
247 | }, | ||
248 | { | ||
249 | "type": "chord_set", | ||
250 | "set": "rows", | ||
251 | "keycodes": [ | ||
252 | " ", " ", " ", " ", " ESC", " DEL", " ", " ", " ", " ", | ||
253 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
254 | " ", " ", " ", "LSFT", "LCTL", "LALT", " ", " ", " ", " " | ||
255 | ] | ||
256 | }, | ||
257 | { | ||
258 | "type": "chord_set", | ||
259 | "set": "cols", | ||
260 | "keycodes": [ | ||
261 | " ", " ", " ", " ", "LGUI", " ", " ", " ", " ", | ||
262 | " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
263 | " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
264 | ] | ||
265 | } | ||
266 | ] | ||
267 | }, | ||
268 | { | ||
269 | "name": "ASETNIOP_FN", | ||
270 | "chords": [ | ||
271 | { | ||
272 | "type": "chord_set", | ||
273 | "set": "asetniop", | ||
274 | "keycodes": [ | ||
275 | "HOME", "PGDN", "PGUP", " END", "LEFT", "DOWN", " UP", "RIGHT", | ||
276 | " F1", " F2", " F3", " F4", " F5", " F6", " F7", | ||
277 | " F10", " ", " ", " ", " ", " F8", | ||
278 | " F11", " ", " ", " ", " F9", | ||
279 | " F12", " ", " ", "BSPC", | ||
280 | " ", " ", " ", | ||
281 | " ", " ", | ||
282 | " " | ||
283 | ] | ||
284 | }, | ||
285 | { | ||
286 | "type": "chord_set", | ||
287 | "set": "rows", | ||
288 | "keycodes": [ | ||
289 | " ", " ", " ", " ", " ESC", " DEL", " ", " ", " ", " ", | ||
290 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
291 | " ", " ", " ", "LSFT", "LCTL", "LALT", " ", " ", " ", " " | ||
292 | ] | ||
293 | }, | ||
294 | { | ||
295 | "type": "chord_set", | ||
296 | "set": "cols", | ||
297 | "keycodes": [ | ||
298 | " ", " ", " ", " ", "LGUI", " ", " ", " ", " ", | ||
299 | " ", " ", " ", " ", " ", " ", " ", " ", " ", | ||
300 | " ", " ", " ", " ", " ", " ", " ", " ", " " | ||
301 | ] | ||
302 | } | ||
303 | ] | ||
304 | } | ||
305 | ], | ||
306 | "leader_sequences": [], | ||
307 | "extra_code": "", | ||
308 | "extra_dependencies": [] | ||
309 | } \ No newline at end of file | ||
diff --git a/keyboards/butterstick/keymaps/dennytom/rules.mk b/keyboards/butterstick/keymaps/dennytom/rules.mk new file mode 100644 index 000000000..1155f72c0 --- /dev/null +++ b/keyboards/butterstick/keymaps/dennytom/rules.mk | |||
@@ -0,0 +1,8 @@ | |||
1 | MOUSEKEY_ENABLE = yes | ||
2 | EXTRAKEY_ENABLE = yes | ||
3 | CONSOLE_ENABLE = no | ||
4 | # COMMAND_ENABLE = no | ||
5 | NKRO_ENABLE = yes | ||
6 | |||
7 | TMPVAR := $(SRC) | ||
8 | SRC = $(filter-out sten.c, $(TMPVAR)) \ No newline at end of file | ||