aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Racine <mailto.danielracine@gmail.com>2020-05-07 00:01:19 -0400
committerGitHub <noreply@github.com>2020-05-06 21:01:19 -0700
commit923bad46f93d9dc9b6d8e5c6694a7fdd745e0fde (patch)
treea730359f49c3e6af8dd6b0b4c55d1e60a9c7177d
parent19513fac5ff7543d116c2808822420d9ac12906f (diff)
downloadqmk_firmware-923bad46f93d9dc9b6d8e5c6694a7fdd745e0fde.tar.gz
qmk_firmware-923bad46f93d9dc9b6d8e5c6694a7fdd745e0fde.zip
[Keymap] New keymap layout for dztech/dz65rgb/keymaps (#8199)
* New keymap layout for dztech/dz65rgb/keymaps * New keymap layout for dztech/dz65rgb/keymaps - Conding conventions fixes * Fix typo in Leader Key table * PR #8199 Feedback Commit #1 * Fixed data types and function names - Simplified accent macros by removing repetition - Added selection wrap macros - readme.md doc updated with changes * PR #8199 second feedback commit - Clarified function names, variables names and comments * Fix: accent output fix _grave <==> _circumflex * dry fixes on led set_color with hsv and led blinking code blocks
-rw-r--r--keyboards/dztech/dz65rgb/keymaps/drootz/config.h52
-rw-r--r--keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c757
-rw-r--r--keyboards/dztech/dz65rgb/keymaps/drootz/readme.md210
-rw-r--r--keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk11
4 files changed, 1030 insertions, 0 deletions
diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/config.h b/keyboards/dztech/dz65rgb/keymaps/drootz/config.h
new file mode 100644
index 000000000..581050797
--- /dev/null
+++ b/keyboards/dztech/dz65rgb/keymaps/drootz/config.h
@@ -0,0 +1,52 @@
1#pragma once
2
3#define LEADER_PER_KEY_TIMING
4#define LEADER_TIMEOUT 425
5#define TAP_HOLD_CAPS_DELAY 80
6
7#ifdef RGB_MATRIX_ENABLE
8/* Reset default from dz65rgb/v2 config.h */
9# undef DISABLE_RGB_MATRIX_SPLASH
10# undef DISABLE_RGB_MATRIX_SOLID_SPLASH
11# undef RGB_MATRIX_LED_FLUSH_LIMIT
12# undef RGB_MATRIX_STARTUP_MODE
13# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
14# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255
15# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // default: 26
16# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_TYPING_HEATMAP
17# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
18# define RGB_MATRIX_STARTUP_HUE 10
19# define RGB_MATRIX_STARTUP_SAT 255
20# define RGB_MATRIX_STARTUP_VAL 200
21# define RGB_MATRIX_STARTUP_SPD 75
22/* Active RBG Modes */
23/* # define DISABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM! */
24/* # define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out */
25/* # define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out */
26/* Disabling to optimize firmware size */
27# define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
28# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient left to right, speed controls how much gradient changes
29# define DISABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation
30# define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right
31# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
32# define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
33# define DISABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient
34# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right
35# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
36# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
37# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
38# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
39# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
40# define DISABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
41# define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
42# define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
43# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
44# define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
45# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
46# define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
47#endif /* RBG MATRIX */
48
49/* Firmware size Optimizations */
50#define NO_ACTION_MACRO
51#define NO_ACTION_FUNCTION
52#define NO_ACTION_ONESHOT
diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c
new file mode 100644
index 000000000..c313f467e
--- /dev/null
+++ b/keyboards/dztech/dz65rgb/keymaps/drootz/keymap.c
@@ -0,0 +1,757 @@
1#include QMK_KEYBOARD_H
2
3/**************** SOME GLOBALS *********************/
4
5bool onMac = false;
6bool isLeader = false;
7bool isBlinking = false;
8bool isRecording = false;
9bool isPlaying = false;
10const float led_dim_ratio = 0.50;
11static uint16_t blink_cycle_timer,
12 blink_fade_in_timer,
13 blink_fade_out_timer,
14 macro_one_play_timer,
15 macro_two_play_timer,
16 macro_play_blink_timer = 2000;
17static uint8_t fade_in_step_counter,
18 fade_out_step_counter,
19 blink_hsv_value;
20
21/**************** LED BLINK HELPER FUNCTIONS *********************/
22
23/*
24Function to set color with hsv arguments
25- "hue", "sat" and "val" arguments above 255 will get value from rgb matrix config
26- "val_ratio" is used to adjust brightness ratio
27*/
28void rgb_matrix_set_color_hsv(uint8_t led, uint16_t hue, uint16_t sat, uint16_t val, float val_ratio) {
29 const uint8_t h = hue <= 255 ? hue : rgb_matrix_config.hsv.h;
30 const uint8_t s = sat <= 255 ? sat : rgb_matrix_config.hsv.s;
31 const uint8_t v = val <= 255 ? val * val_ratio : rgb_matrix_config.hsv.v * val_ratio;
32 HSV hsv_in = {h, s, v};
33 RGB rgb_out = hsv_to_rgb(hsv_in);
34 rgb_matrix_set_color(led, rgb_out.r, rgb_out.g, rgb_out.b);
35}
36
37void reset_blink_cycle(void) {
38 blink_cycle_timer = timer_read();
39 blink_fade_in_timer = timer_read();
40 blink_fade_out_timer = timer_read();
41 blink_hsv_value = 0;
42 fade_in_step_counter = 0;
43 fade_out_step_counter = 0;
44}
45
46void reset_blink_status(void) {
47 isRecording = false;
48 isPlaying = false;
49 isBlinking = false;
50}
51
52void get_this_led_blinking(uint8_t led_index, bool speed, uint8_t hue, uint8_t sat) {
53 const uint16_t static_on_time = speed ? 200 : 500;
54 const uint16_t static_off_time = speed ? 200 : 500;
55 const uint8_t fade_timing = speed ? 100 : 150;
56 const uint8_t fade_step = speed ? 10 : 15;
57 const uint8_t fade_value_step_size = rgb_matrix_config.hsv.v / fade_step;
58 const uint8_t fade_cycle_time_elapsed = fade_timing / fade_step;
59 if (timer_elapsed(blink_cycle_timer) < static_on_time) {
60 if (timer_elapsed(blink_fade_in_timer) > fade_cycle_time_elapsed && fade_in_step_counter < fade_step) {
61 blink_hsv_value = blink_hsv_value + fade_value_step_size;
62 fade_in_step_counter = fade_in_step_counter + 1;
63 blink_fade_in_timer = timer_read();
64 }
65 } else {
66 if (timer_elapsed(blink_fade_out_timer) > fade_cycle_time_elapsed && fade_out_step_counter < fade_step) {
67 blink_hsv_value = blink_hsv_value - fade_value_step_size;
68 fade_out_step_counter = fade_out_step_counter + 1;
69 blink_fade_out_timer = timer_read();
70 }
71 }
72
73 rgb_matrix_set_color_hsv(led_index, hue, sat, blink_hsv_value, 0.75);
74
75 if (timer_elapsed(blink_cycle_timer) > static_on_time + static_off_time) {
76 reset_blink_cycle();
77 }
78}
79
80
81/**************** LAYOUT *********************/
82
83/*
84[LEDS]
85 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
8615, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
8730, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43
8844, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57
8958, 59, 60, 61, 62, 63, 64, 65, 66, 67
90
91[KEYS]
92ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, BCK, INS
93TAB, Q, W, E, R, T, Y, U, I, O, P, [, ], \,PGUP
94CPS, A, S, D, F, G, H, J, K, L, COL, QOT, RETURN,PGDN
95SFT, Z, X, C, V, B, N, M, COM, DOT, SLS, SHIFT, UP, DEL
96CTL, GUI, ALT, SPACEBAR, ALT, FN, CTL, LFT, DWN, RIT
97*/
98
99enum layers {
100 _MAIN,
101 _MAC,
102 _FN
103}
104
105const layers_leds_map[] = {
106 [_MAIN] = 45,
107 [_MAC] = 46,
108 [_FN] = 63
109};
110
111const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
112 [_MAIN] = LAYOUT_65_ansi(
113 KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS,
114 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
115 KC_LEAD, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
116 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
117 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
118 ),
119 [_MAC] = LAYOUT_65_ansi(
120 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
121 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
122 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
123 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
124 KC_TRNS, KC_LALT, KC_LGUI, KC_TRNS, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
125 ),
126 [_FN] = LAYOUT_65_ansi(
127 DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
128 KC_TRNS, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_SAI, DYN_MACRO_PLAY2, DYN_REC_START2,
129 KC_TRNS, KC_BRID, KC_VOLD, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUD, RGB_HUI, DYN_MACRO_PLAY1, DYN_REC_START1,
130 KC_TRNS, TO(_MAIN), TO(_MAC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SPD, RGB_SPI, KC_TRNS, RGB_VAI, KC_NO,
131 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD
132 ),
133};
134
135//**************** MATRIX SCANS *********************//
136
137void rgb_matrix_indicators_user(void) {
138
139 #ifdef RGB_MATRIX_ENABLE
140
141 /*Ensure some leds don't completeley turn off if hsv value setting is below 100 in the rgb matrix config */
142 const uint8_t led_constant_val = rgb_matrix_config.hsv.v < 100 ? 100 : rgb_matrix_config.hsv.v;
143
144 /* CapsLock LED indicator */
145 if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
146 rgb_matrix_set_color_hsv(30, 999, 0, led_constant_val, 0.75); // WHITE
147 }
148
149 /* Current layer LED indicator */
150 rgb_matrix_set_color_hsv(layers_leds_map[get_highest_layer(layer_state)], 999, 0, led_constant_val, led_dim_ratio); // WHITE
151
152 /* Leader Key LED under-glow */
153 if (isLeader) {
154 rgb_matrix_set_color_hsv(14, 999, 999, 999, 1); // CONFIG
155 rgb_matrix_set_color_hsv(30, 999, 999, 999, 1); // CONFIG
156 } else {
157 rgb_matrix_set_color_hsv(14, 999, 999, 999, led_dim_ratio); // CONFIG
158 }
159
160 /* Blinking LED indicator when recording Dynamic Macro */
161 if (isRecording && isBlinking) {
162 get_this_led_blinking(0, false, 0, 255);
163 }
164
165 /* Blinking LED indicator when playing Dynamic Macro */
166 if (isPlaying && isBlinking) {
167 if (timer_elapsed(macro_one_play_timer) < macro_play_blink_timer || timer_elapsed(macro_two_play_timer) < macro_play_blink_timer) {
168 get_this_led_blinking(0, true, 85, 255);
169 } else {
170 if (isBlinking && isPlaying) {
171 reset_blink_status();
172 reset_blink_cycle();
173 }
174 }
175 }
176
177 switch (biton32(layer_state)) {
178 case _FN:
179 /* Dynamic Macro LED indicator */
180 if (isRecording) {
181 rgb_matrix_set_color_hsv(0, 0, 999, 999, 1); /* RED macro stop */
182 } else {
183 rgb_matrix_set_color_hsv(43, 0, 999, 999, led_dim_ratio); /* RED macro 1 record */
184 rgb_matrix_set_color_hsv(29, 0, 999, 999, led_dim_ratio); /* RED macro 2 record */
185 rgb_matrix_set_color_hsv(42, 85, 999, 999, led_dim_ratio); /* GREEN macro 1 play */
186 rgb_matrix_set_color_hsv(28, 85, 999, 999, led_dim_ratio); /* GREEN macro 2 play */
187 }
188 /* Layer LED indicators */
189 rgb_matrix_set_color_hsv(45, 999, 0, led_constant_val, led_dim_ratio); /* WHITE Layer _MAIN */
190 rgb_matrix_set_color_hsv(46, 999, 0, led_constant_val, led_dim_ratio); /* WHITE Layer _MAC */
191 break;
192 }
193
194 #endif /* RGB_MATRIX */
195}
196
197bool process_record_user(uint16_t keycode, keyrecord_t *record) {
198 bool pressed = record->event.pressed;
199 if (pressed) {
200 switch (keycode) {
201 case TO(_MAC):
202 onMac = true;
203 break;
204 case TO(_MAIN):
205 onMac = false;
206 break;
207 }
208 }
209 return true;
210}
211
212//**************** LEADER *********************//
213
214#ifdef LEADER_ENABLE
215
216/******* FRENCH ACCENT HELPER FUNCTIONS & DECLARATIONS *************/
217/*Most comonly used accents only*/
218
219enum french_letter {
220 _A,
221 _E,
222 _I,
223 _O,
224 _U
225};
226
227const uint8_t french_letter_index[5] = {
228 [_A] = 0,
229 [_E] = 1,
230 [_I] = 2,
231 [_O] = 3,
232 [_U] = 4
233};
234
235enum french_accent {
236 _CIRCUMFLEX,
237 _GRAVE,
238 _ACUTE
239};
240
241const uint8_t french_accent_index[3] = {
242 [_CIRCUMFLEX] = 0,
243 [_GRAVE] = 1,
244 [_ACUTE] = 2
245};
246
247/*
248This represent unicode decimal values
249Each index will be mapped to numpad keycode to out put the correct sequence
250All codes in this array should be of size 3
251All accent codes have the same index position as in the french_accent_index Array
252*/
253const uint8_t french_decimal_unicodes[5][3][2] = { /*[Letter][Accent][Case]*/
254 {
255 {
256 131, // â
257 194 // Â
258 },{
259 133, // à
260 192 // À
261 }
262 },{
263 {
264 136, // ê
265 202 // Ê
266 },{
267 138, // è
268 200 // È
269 },{
270 130, // é
271 201 // É
272 }
273 },{
274 {
275 140, // î
276 206 // Î
277 }
278 },{
279 {
280 147, // ô
281 212 // Ô
282 }
283 },{
284 {
285 150, // û
286 219 // Û
287 },{
288 151, // ù
289 217 // Ù
290 }
291 }
292};
293
294void break_int_in_array(uint8_t int_code, uint8_t size, uint8_t *array) {
295 uint8_t i;
296 i = size;
297 while (i--) {
298 array[i] = int_code%10;
299 int_code /= 10;
300 }
301}
302
303/*
304Function meant to be used in Leader Key macros to output most commonly used french accents
305This is designed and work on an English language keyboard setting on both Windows and Mac
306=> accept french_letter and french_accent enum's as argument
307*/
308void send_french_accent(uint8_t letter, uint8_t accent) {
309
310 bool isCaps;
311 uint8_t decimal_unicode_in;
312 uint8_t decimal_unicode_size = 3;
313 uint8_t decimal_unicode_out[decimal_unicode_size];
314
315 /*Map to numpad keycodes*/
316 const uint16_t numpad_key_map[10] = {
317 KC_P0, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9
318 };
319
320 /*Map to letter keycodes*/
321 const uint16_t french_letter_key_map[5] = {
322 KC_A, KC_E, KC_I, KC_O, KC_U
323 };
324
325 /*Map to mod keys for French Mac shortcuts*/
326 const uint16_t osx_mod_key_map[3] = {
327 KC_I, // _CIRCUMFLEX
328 KC_GRAVE, // _GRAVE
329 KC_E // _ACUTE
330 };
331
332 /*
333 Function to tap the correct keycodes in sequence for the
334 "Windows Alt Code" requested, aka Decimal Unicodes
335 */
336 void tap_win_alt_code(void) {
337 if (isCaps) {
338 tap_code(numpad_key_map[0]); // Leading 0 on all upper case "Windows alt codes"
339 }
340 for (int i = 0; i < decimal_unicode_size; ++i) {
341 tap_code(numpad_key_map[decimal_unicode_out[i]]);
342 }
343 }
344
345 isCaps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? true : false;
346
347 if (onMac) {
348 if (isCaps) {
349 SEND_STRING(SS_TAP(X_CAPSLOCK));
350 register_code(KC_LALT);
351 tap_code(osx_mod_key_map[accent]);
352 unregister_code(KC_LALT);
353 register_code(KC_LSFT);
354 tap_code(french_letter_key_map[letter]);
355 unregister_code(KC_LSFT);
356 tap_code(KC_CAPS);
357 } else {
358 register_code(KC_LALT);
359 tap_code(osx_mod_key_map[accent]);
360 unregister_code(KC_LALT);
361 tap_code(french_letter_key_map[letter]);
362 }
363 } else {
364 /*get the correct decimal unicode*/
365 decimal_unicode_in = isCaps ? french_decimal_unicodes[letter][accent][1] : french_decimal_unicodes[letter][accent][0];
366 break_int_in_array(decimal_unicode_in, decimal_unicode_size, decimal_unicode_out);
367 register_code(KC_LALT);
368 tap_win_alt_code();
369 unregister_code(KC_LALT);
370 }
371}
372
373/*Couple functions used to output the same macro on two different sequences*/
374
375/* (|) */
376void ldrkey_send_paranthesis_wrap_ini(void) {
377 SEND_STRING("()" SS_TAP(X_LEFT));
378}
379
380/* (X) */
381void ldrkey_send_paranthesis_wrap_word(void) {
382 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "(" SS_LALT(SS_TAP(X_RIGHT)) ")") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "(" SS_LCTL(SS_TAP(X_RIGHT)) ")");
383}
384
385/* (selection) */
386void ldrkey_send_paranthesis_wrap_selection(void) {
387 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_X)) "()" SS_TAP(X_LEFT) SS_LGUI(SS_TAP(X_V)) SS_TAP(X_RIGHT)) : SEND_STRING(SS_LCTL(SS_TAP(X_X)) "()" SS_TAP(X_LEFT) SS_LCTL(SS_TAP(X_V)) SS_TAP(X_RIGHT));
388}
389
390/* [|] */
391void ldrkey_send_bracket_wrap_ini(void) {
392 SEND_STRING("[]" SS_TAP(X_LEFT));
393}
394
395/* [X] */
396void ldrkey_send_bracket_wrap_word(void) {
397 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "[" SS_LALT(SS_TAP(X_RIGHT)) "]") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "[" SS_LCTL(SS_TAP(X_RIGHT)) "]");
398}
399
400/* [selection] */
401void ldrkey_send_bracket_wrap_selection(void) {
402 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_X)) "[]" SS_TAP(X_LEFT) SS_LGUI(SS_TAP(X_V)) SS_TAP(X_RIGHT)) : SEND_STRING(SS_LCTL(SS_TAP(X_X)) "[]" SS_TAP(X_LEFT) SS_LCTL(SS_TAP(X_V)) SS_TAP(X_RIGHT));
403}
404
405/* {|} */
406void ldrkey_send_curlybrace_wrap_ini(void) {
407 SEND_STRING("{}" SS_TAP(X_LEFT));
408}
409
410/* {X} */
411void ldrkey_send_curlybrace_wrap_word(void) {
412 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "{" SS_LALT(SS_TAP(X_RIGHT)) "}") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "{" SS_LCTL(SS_TAP(X_RIGHT)) "}");
413}
414
415/* {selection} */
416void ldrkey_send_curlybrace_wrap_selection(void) {
417 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LGUI(SS_TAP(X_V)) SS_TAP(X_RIGHT)) : SEND_STRING(SS_LCTL(SS_TAP(X_X)) "{}" SS_TAP(X_LEFT) SS_LCTL(SS_TAP(X_V)) SS_TAP(X_RIGHT));
418}
419
420LEADER_EXTERNS();
421
422void matrix_scan_user(void)
423{
424 LEADER_DICTIONARY()
425 {
426 leading = false;
427 leader_end();
428
429 /* Sequences on layer _MAIN & _MAC */
430 /* éÉ => LdrKey > / */
431 SEQ_ONE_KEY(KC_SLSH) {
432 send_french_accent(_E, _ACUTE);
433 }
434 /* àÀ => LdrKey > A */
435 SEQ_ONE_KEY(KC_A) {
436 send_french_accent(_A, _GRAVE);
437 }
438 /* èÈ => LdrKey > E */
439 SEQ_ONE_KEY(KC_E) {
440 send_french_accent(_E, _GRAVE);
441 }
442 /* ùÙ => LdrKey > U */
443 SEQ_ONE_KEY(KC_U) {
444 send_french_accent(_U, _GRAVE);
445 }
446 /* â => LdrKey > A > A */
447 SEQ_TWO_KEYS(KC_A, KC_A) {
448 send_french_accent(_A, _CIRCUMFLEX);
449 }
450 /* êÊ => LdrKey > E > E */
451 SEQ_TWO_KEYS(KC_E, KC_E) {
452 send_french_accent(_E, _CIRCUMFLEX);
453 }
454 /* îÎ => LdrKey > I > I */
455 SEQ_TWO_KEYS(KC_I, KC_I) {
456 send_french_accent(_I, _CIRCUMFLEX);
457 }
458 /* ôÔ => LdrKey > O > O */
459 SEQ_TWO_KEYS(KC_O, KC_O) {
460 send_french_accent(_O, _CIRCUMFLEX);
461 }
462 /* ûÛ => LdrKey > U > U */
463 SEQ_TWO_KEYS(KC_U, KC_U) {
464 send_french_accent(_U, _CIRCUMFLEX);
465 }
466 /* çÇ => LdrKey > C */
467 SEQ_ONE_KEY(KC_C) {
468 if (onMac) {
469 SEND_STRING(SS_LALT("c"));
470 } else {
471 IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P2) SS_TAP(X_P8) SS_UP(X_LALT)) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P3) SS_TAP(X_P5) SS_UP(X_LALT));
472 }
473 }
474 /* CapsLock */
475 SEQ_ONE_KEY(KC_LEAD) {
476 tap_code(KC_CAPS);
477 }
478 /* ± => LdrKey > = > - */
479 SEQ_TWO_KEYS(KC_EQL, KC_MINS) {
480 onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_EQL)))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P1) SS_UP(X_LALT));
481 }
482 /* ≤ => LdrKey > - > = */
483 SEQ_TWO_KEYS(KC_MINS, KC_EQL) {
484 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_COMM))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P3) SS_UP(X_LALT));
485 }
486 /* ≥ => LdrKey > = > = */
487 SEQ_TWO_KEYS(KC_EQL, KC_EQL) {
488 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_DOT))) : SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P2) SS_TAP(X_P4) SS_TAP(X_P2) SS_UP(X_LALT));
489 }
490 /* <= => LdrKey > , > , */
491 SEQ_TWO_KEYS(KC_COMM, KC_COMM) {
492 SEND_STRING(SS_LSFT(SS_TAP(X_COMM)) SS_TAP(X_SPC) SS_TAP(X_EQL) SS_TAP(X_LEFT) SS_TAP(X_BSPC) SS_TAP(X_RIGHT));
493 }
494 /* => => LdrKey > . > . */
495 SEQ_TWO_KEYS(KC_DOT, KC_DOT) {
496 SEND_STRING("=>");
497 }
498 /* ", " => LdrKey > " " */
499 SEQ_ONE_KEY(KC_SPC) {
500 SEND_STRING(", ");
501 }
502 /* ". " => LdrKey > " " > " " */
503 SEQ_TWO_KEYS(KC_SPC, KC_SPC) {
504 SEND_STRING(". ");
505 }
506 /* Backward delete current word (on cursor) */
507 SEQ_TWO_KEYS(KC_BSPC, KC_BSPC) {
508 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_RIGHT)) SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT)) SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC));
509 }
510 /* Previous word delete */
511 SEQ_ONE_KEY(KC_BSPC) {
512 onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC)) : SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_LEFT))) SS_TAP(X_BSPC));
513 }
514 /* Forward delete current word (on cursor) */
515 SEQ_TWO_KEYS(KC_DEL, KC_DEL) {
516
517 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)) : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL));
518 }
519 /* Next word delete */
520 SEQ_ONE_KEY(KC_DEL) {
521 onMac ? SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL)): SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_RIGHT))) SS_TAP(X_DEL));
522 }
523 /* ` => LdrKey > Escape */
524 SEQ_ONE_KEY(KC_GESC) {
525 SEND_STRING("`");
526 }
527 /* ``` => LdrKey > Escape > Escape > Escape */
528 SEQ_THREE_KEYS(KC_GESC, KC_GESC, KC_GESC) {
529 SEND_STRING("```");
530 }
531 /* Printscreen => LdrKey > Insert */
532 SEQ_ONE_KEY(KC_INS) {
533 onMac ? SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))) : SEND_STRING(SS_TAP(X_PSCR));
534 }
535 /* Home => LdrKey > Page Up */
536 SEQ_ONE_KEY(KC_PGUP) {
537 onMac ? SEND_STRING(SS_TAP(X_HOME)) : SEND_STRING(SS_LCTL(SS_TAP(X_HOME)));
538 }
539 /* End => LdrKey > Page Down */
540 SEQ_ONE_KEY(KC_PGDN) {
541 onMac ? SEND_STRING(SS_TAP(X_END)) : SEND_STRING(SS_LCTL(SS_TAP(X_END)));
542 }
543 /* Close Curernt File/Tab => LdrKey > W */
544 SEQ_ONE_KEY(KC_W) {
545 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_W))) : SEND_STRING(SS_LCTL(SS_TAP(X_W)));
546 }
547 /* Close Current App => LdrKey > Q */
548 SEQ_ONE_KEY(KC_Q) {
549 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_Q))) : SEND_STRING(SS_LALT(SS_TAP(X_F4)));
550 }
551 /* " => LdrKey > ' */
552 SEQ_ONE_KEY(KC_QUOT) {
553 SEND_STRING("\"");
554 }
555 /* "|" => LdrKey > ' > ' */
556 SEQ_TWO_KEYS(KC_QUOT, KC_QUOT) {
557 SEND_STRING("\"\"" SS_TAP(X_LEFT));
558 }
559 /* "X" wrap => LdrKey > ' > ' > ' */
560 SEQ_THREE_KEYS(KC_QUOT, KC_QUOT, KC_QUOT) {
561 onMac ? SEND_STRING(SS_LALT(SS_TAP(X_LEFT)) "\"" SS_LALT(SS_TAP(X_RIGHT)) "\"") : SEND_STRING(SS_LCTL(SS_TAP(X_LEFT)) "\"" SS_LCTL(SS_TAP(X_RIGHT)) "\"");
562 }
563 /* ( => LdrKey > Left Shift */
564 SEQ_ONE_KEY(KC_LSFT) {
565 SEND_STRING("(");
566 }
567 /* ) => LdrKey > Right Shift */
568 SEQ_ONE_KEY(KC_RSFT) {
569 SEND_STRING(")");
570 }
571 /* (|) => LdrKey > Left Shift > Left Shift */
572 SEQ_TWO_KEYS(KC_LSFT, KC_LSFT) {
573 ldrkey_send_paranthesis_wrap_ini();
574 }
575 /* (|) => LdrKey > Right Shift > Right Shift */
576 SEQ_TWO_KEYS(KC_RSFT, KC_RSFT) {
577 ldrkey_send_paranthesis_wrap_ini();
578 }
579 /* (X) wrap => LdrKey > Left Shift > W */
580 SEQ_TWO_KEYS(KC_LSFT, KC_W) {
581 ldrkey_send_paranthesis_wrap_word();
582 }
583 /* (X) wrap => LdrKey > Right Shift > W */
584 SEQ_TWO_KEYS(KC_RSFT, KC_W) {
585 ldrkey_send_paranthesis_wrap_word();
586 }
587 /* (X) wrap selection => LdrKey > Left Shift > W > W */
588 SEQ_THREE_KEYS(KC_LSFT, KC_W, KC_W) {
589 ldrkey_send_paranthesis_wrap_selection();
590 }
591 /* (X) wrap selection => LdrKey > Right Shift > W > W */
592 SEQ_THREE_KEYS(KC_RSFT, KC_W, KC_W) {
593 ldrkey_send_paranthesis_wrap_selection();
594 }
595 /* [ => LdrKey > Left CTL */
596 SEQ_ONE_KEY(KC_LCTL) {
597 SEND_STRING("[");
598 }
599 /* ] => LdrKey > Right CTL */
600 SEQ_ONE_KEY(KC_RCTL) {
601 SEND_STRING("]");
602 }
603 /* [|] => LdrKey > Left CTL > Left CTL */
604 SEQ_TWO_KEYS(KC_LCTL, KC_LCTL) {
605 ldrkey_send_bracket_wrap_ini();
606 }
607 /* [|] => LdrKey > Right CTL > Right CTL */
608 SEQ_TWO_KEYS(KC_RCTL, KC_RCTL) {
609 ldrkey_send_bracket_wrap_ini();
610 }
611 /* [X] wrap => LdrKey > Left CTL > W */
612 SEQ_TWO_KEYS(KC_LCTL, KC_W) {
613 ldrkey_send_bracket_wrap_word();
614 }
615 /* [X] wrap => LdrKey > Right CTL > W */
616 SEQ_TWO_KEYS(KC_RCTL, KC_W) {
617 ldrkey_send_bracket_wrap_word();
618 }
619 /* [X] wrap selection => LdrKey > Left CTL > W > W */
620 SEQ_THREE_KEYS(KC_LCTL, KC_W, KC_W) {
621 ldrkey_send_bracket_wrap_selection();
622 }
623 /* [X] wrap selection => LdrKey > Right CTL > W > W */
624 SEQ_THREE_KEYS(KC_RCTL, KC_W, KC_W) {
625 ldrkey_send_bracket_wrap_selection();
626 }
627 /* { => LdrKey > Left ALT */
628 SEQ_ONE_KEY(KC_LALT) {
629 SEND_STRING("{");
630 }
631 /* } => LdrKey > Right ALT */
632 SEQ_ONE_KEY(KC_RALT) {
633 SEND_STRING("}");
634 }
635 /* {|} => LdrKey > Left ALT > Left ALT */
636 SEQ_TWO_KEYS(KC_LALT, KC_LALT) {
637 ldrkey_send_curlybrace_wrap_ini();
638 }
639 /* {|} => LdrKey > Right ALT > Right ALT */
640 SEQ_TWO_KEYS(KC_RALT, KC_RALT) {
641 ldrkey_send_curlybrace_wrap_ini();
642 }
643 /* {X} wrap => LdrKey > Left ALT > W */
644 SEQ_TWO_KEYS(KC_LALT, KC_W) {
645 ldrkey_send_curlybrace_wrap_word();
646 }
647 /* {X} wrap => LdrKey > Right ALT > W */
648 SEQ_TWO_KEYS(KC_RALT, KC_W) {
649 ldrkey_send_curlybrace_wrap_word();
650 }
651 /* {X} wrap selection => LdrKey > Left ALT > W > W */
652 SEQ_THREE_KEYS(KC_LALT, KC_W, KC_W) {
653 ldrkey_send_curlybrace_wrap_selection();
654 }
655 /* {X} wrap selection => LdrKey > Right ALT > W > W */
656 SEQ_THREE_KEYS(KC_RALT, KC_W, KC_W) {
657 ldrkey_send_curlybrace_wrap_selection();
658 }
659 /* Select everything on this line before cursor => LdrKey > Left */
660 SEQ_ONE_KEY(KC_LEFT) {
661 onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_LEFT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_HOME)));
662 }
663 /* Select everything on this line after cursor => LdrKey > Right */
664 SEQ_ONE_KEY(KC_RIGHT) {
665 onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_END)));
666 }
667 /* Select everything on this line before cursor and bring on previous line => LdrKey > Left > Left */
668 SEQ_TWO_KEYS(KC_LEFT, KC_LEFT) {
669 onMac ? SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_UP) SS_TAP(X_END)));
670 }
671 /* Select everything on this line => LdrKey > Right > Left */
672 SEQ_TWO_KEYS(KC_RIGHT, KC_LEFT) {
673 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_RIGHT) SS_LSFT(SS_LGUI(SS_TAP(X_LEFT))))) : SEND_STRING(SS_TAP(X_END) SS_LSFT(SS_TAP(X_HOME)));
674 }
675 /* Select 1x Page Up on the page before the cursor => LdrKey > Up */
676 SEQ_ONE_KEY(KC_UP) {
677 SEND_STRING(SS_LSFT(SS_TAP(X_PGUP)));
678 }
679 /* Select 1x Page Down on the page after the cursor => LdrKey > Down */
680 SEQ_ONE_KEY(KC_DOWN) {
681 SEND_STRING(SS_LSFT(SS_TAP(X_PGDN)));
682 }
683 /* Select everything on the page before the cursor => LdrKey > Up > Up */
684 SEQ_TWO_KEYS(KC_UP, KC_UP) {
685 onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_UP)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_HOME))));
686 }
687 /* Select everything on the page after the cursor => LdrKey > Down > Down */
688 SEQ_TWO_KEYS(KC_DOWN, KC_DOWN) {
689 onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_DOWN)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_END))));
690 }
691 /* HELPER => spit out the url of the layout description page on github */
692 SEQ_FIVE_KEYS(KC_GESC, KC_GESC, KC_GESC, KC_GESC, KC_GESC) {
693 SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/keyboards/dztech/dz65rgb/keymaps/drootz");
694 }
695 /* google.ca => LdrKey > G > G */
696 SEQ_TWO_KEYS(KC_G, KC_G) {
697 SEND_STRING("https://google.ca" SS_TAP(X_ENT));
698 }
699 /* @gmail => LdrKey > M > L > T */
700 SEQ_THREE_KEYS(KC_M, KC_L, KC_T) {
701 SEND_STRING("mailto." SS_TAP(X_D) SS_TAP(X_A) SS_TAP(X_N) SS_TAP(X_I) SS_TAP(X_E) SS_TAP(X_L) SS_TAP(X_R) SS_TAP(X_A) SS_TAP(X_C) SS_TAP(X_I) SS_TAP(X_N) SS_TAP(X_E) "@gmail.com");
702 }
703 /* Show Desktop => LdrKey > D */
704 SEQ_ONE_KEY(KC_D) {
705 onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_SPC)) "Mission" SS_TAP(X_ENT)) : SEND_STRING(SS_LGUI(SS_TAP(X_D)));
706 }
707 }
708}
709
710void leader_start(void) {
711 isLeader = true;
712}
713
714void leader_end(void) {
715 isLeader = false;
716}
717
718#endif /* LEADER */
719
720/**************** DYNAMIC MACRO *********************/
721
722void dynamic_macro_record_start_user(void) {
723 onMac = false; /* reset layer bool as dynamic macro clear the keyboard and reset layers. */
724 if (!isBlinking && !isRecording) {
725 reset_blink_cycle();
726 isBlinking = true;
727 isRecording = true;
728 }
729}
730
731void dynamic_macro_record_end_user(int8_t direction) {
732 if (isBlinking && isRecording) {
733 reset_blink_status();
734 reset_blink_cycle();
735 }
736}
737
738void dynamic_macro_play_user(int8_t direction) {
739 switch (direction) {
740 case 1:
741 if (!isBlinking && !isPlaying) {
742 reset_blink_cycle();
743 isBlinking = true;
744 isPlaying = true;
745 macro_one_play_timer = timer_read();
746 }
747 break;
748 case -1:
749 if (!isBlinking && !isPlaying) {
750 reset_blink_cycle();
751 isBlinking = true;
752 isPlaying = true;
753 macro_two_play_timer = timer_read();
754 }
755 break;
756 }
757}
diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/readme.md b/keyboards/dztech/dz65rgb/keymaps/drootz/readme.md
new file mode 100644
index 000000000..15f15d752
--- /dev/null
+++ b/keyboards/dztech/dz65rgb/keymaps/drootz/readme.md
@@ -0,0 +1,210 @@
1![DZ65RGBv2 Layout Image - MAIN](https://res.cloudinary.com/drootz/image/upload/c_scale,w_800/v1582000645/drootz_dz65rgb_layer_0_main_n61oxl.jpg)
2
3# Drootz's DZ65RGBv2 ANSI Layout
4
5This layout fit best people who mainly type in English but regularly need to type in French _(using an English keyboard in OS setting)_. There are also some cool LED indicator effects and tons of Leader Key bindings/macros designed to work on both Mac and Windows OS. I tried to keep things as simple as possible from a usability perspective. Enjoy!
6
7- [LAYERS](#LAYERS)
8- [LEADER KEY BINDINGS:](#LEADER-KEY-BINDINGS)
9 - [OS and Keyboard Macros](#OS-and-Keyboard-Macros)
10 - [French Accents](#French-Accents)
11 - [Special Characters and Punctuation](#Special-Characters-and-Punctuation)
12 - [Text Selection Macros](#Text-Selection-Macros)
13 - [Expanded Space Cadet Macros](#Expanded-Space-Cadet-Macros)
14 - [Text Expanders](#Text-Expanders)
15- [STEP BY STEP FLASH INSTRUCTIONS](#STEP-BY-STEP-FLASH-INSTRUCTIONS)
16
17## HIGH LEVEL DESCRIPTION
18
19#### Dual function Capslock key
20- Single tap to trigger the Leader Key
21- Double tap to toggle Capslock ON/OFF
22
23#### 70+ useful Leader Key bindings and macros
24- "Designed" to work on both Mac and Windows OS with an English keyboard OS setting
25- Per key timing set at 425ms. Never a key sequence!
26- 20+ Punctuation, ASCII, System shortcuts and macros
27- 15+ French accents (è, é, ê, È, É, Ê, à, etc.)
28 - No need to switch to a French keyboard OS setting!
29 - Preserve Capslock if enabled
30- 8 Text "selection" shortcuts
31- 20+ Expanded "Space Cadet" feature with Shift, Ctrl, Alt and DoubleQuote for (), [], {} and ""
32- Few useful strings output for my workflow (You may want to change or remove them...)
33
34#### Dynamic Macros enabled
35- Record/Play up to 2 Macros
36- Nesting allowed
37
38#### Kept only 4 RGB matrix animations due to size of firmware
39- Typing Heatmap => How hot is your WPM! (preferred animation because of LED indicators)
40- Matrix Splash => Full gradient & value pulse away from a single key hit then fades value out
41- Solid Splash => Hue & value pulse away from a single key hit then fades value out
42- Solid Color => Static single hue, no speed support
43
44#### LED indicators and animations
45- White led when Capslock toggle ON
46- The brightness of all the other indicator can be adjusted globally with the RGB matrix brightness setting on layer \_FN
47- White LED indicator for layer selection and current layer identification
48- Red and green blinking indicator when "recording" or "playing" Dynamic Macros
49- Leader Key LED indicator:
50 - Persistent 50% dimmed under-glow on top right corner key
51 - Light up at 100% for the duration of the Leader Key timeout when activated
52 - Hue, saturation and brightness can be globally adjusted with the RGB matrix settings on layer \_FN
53
54#### 3 Layers
55- \_MAIN: Default layer for Windows OS
56- \_MAC: Transparent layer that switch left hand modifier KC_LALT and KC_LGUI keys for MacOS
57- \_FN: Functions & settings layer:
58 - Macro 1 & 2 keycodes (Record, Stop, Play) with LED indicators
59 - F Keys (F1...F12) on number row
60 - RGB matrix & animation settings
61 - Screen brightness & volume system controls
62 - Layer selection
63
64## LAYERS
65
66- Colored keys on the layout visuals below represent the position of the LED indicators on each layer.
67- Press down and hold the MO(\_FN) key to access the \_FN layer
68- Double tap on the Capslock key to toggle Capslock ON/OFF
69- \_TRNS keys use the next lowest non-transparent key (on lower layers)
70- \_NO keys are ignored (nothing happens)
71
72### [Layer 0: \_MAIN](http://www.keyboard-layout-editor.com/#/gists/67c22220856a927766bd3e0331ed782a)
73![DZ65RGBv2 Layout Image - MAIN](https://res.cloudinary.com/drootz/image/upload/c_scale,w_800/v1582000645/drootz_dz65rgb_layer_0_main_n61oxl.jpg)
74
75### [Layer 1: \_MAC](http://www.keyboard-layout-editor.com/#/gists/4a32d80c67c778658febf28524fb5000)
76![DZ65RGBv2 Layout Image - MAC](https://res.cloudinary.com/drootz/image/upload/c_scale,w_800/v1582000653/drootz_dz65rgb_layer_1_mac_z4tsaw.jpg)
77
78### [Layer 2: \_FN](http://www.keyboard-layout-editor.com/#/gists/b583bd7cc5b0a75b4610bbda18fba65e)
79![DZ65RGBv2 Layout Image - FN](https://res.cloudinary.com/drootz/image/upload/c_scale,w_800/v1582000661/drootz_dz65rgb_layer_2_fn_zv8yte.jpg)
80
81## LEADER KEY BINDINGS
82
83The Leader Key on this layout is triggered by tapping the Capslock key once. Once triggered, we have 450ms between each key press to type any one of the sequences listed below. All sequences are designed to work on both Mac and Windows with an English keyboard OS setting.
84
85- [OS and Keyboard Macros](#OS-and-Keyboard-Macros)
86- [French Accents](#French-Accents)
87- [Special Characters and Ponctuation](#Special-Characters-and-Ponctuation)
88- [Text Selection Macros](#Text-Selection-Macros)
89- [Expanded Space Cadet Macros](#Expanded-Space-Cadet-Macros)
90- [Text Expanders](#Text-Expanders)
91
92#### Legend:
93
94| Acronym | Description |
95| :--- | :--- |
96| LDR | Leader Key |
97| SFT | Shift key |
98| CTL | Control key |
99| ESC | Escape key |
100| ¶ | Text cursor position |
101
102### OS and Keyboard Macros
103
104| Output | Sequence | Description
105| :--- | :--- | :--- |
106| Toggle Capslock | `LDR LDR` | Single tap Capslock to trigger the LDR key |
107| Delete all previous characters in word on cursor OR; | `LDR BACKSPACE` | n/a |
108| => Delete previous word if triggered repeatedly | `LDR BACKSPACE` | n/a |
109| Delete all forward characters in word on cursor OR; | `LDR DEL` | n/a |
110| => Delete next word if triggered repeatedly | `LDR DEL` | n/a |
111| Backward Delete whole word on cursor | `LDR BACKSPACE BACKSPACE` | n/a |
112| Forward Delete whole word on cursor | `LDR DEL DEL` | n/a |
113| Printscreen | `LDR INSERT` | n/a |
114| Home | `LDR PAGE-UP` | n/a |
115| End | `LDR PAGE-DOWN` | n/a |
116| OS: Close current file/tab | `LDR W` | n/a |
117| OS: Close current application | `LDR Q` | n/a |
118| OS: Show Desktop(Win) or Mission Control(Mac) | `LDR D` | The Mac sequence will work with LaunchBar (Cmd+Space) |
119
120### French Accents
121
122| Output | Sequence | Description
123| :--- | :--- | :--- |
124| `à`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `À`¶ | `LDR A` | Will output upper character if Capslock enabled. |
125| `â`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Â`¶ | `LDR A A` | Will output upper character if Capslock enabled. |
126| `ç`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Ç`¶ | `LDR C` | Will output upper character if Capslock enabled. |
127| `è`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `È`¶ | `LDR E` | Will output upper character if Capslock enabled. |
128| `ê`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Ê`¶ | `LDR E E` | Will output upper character if Capslock enabled. |
129| `é`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `É`¶ | `LDR /` | Will output upper character if Capslock enabled |
130| `î`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Î`¶ | `LDR I I` | Will output upper character if Capslock enabled. |
131| `ô`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Ô`¶ | `LDR O O` | Will output upper character if Capslock enabled. |
132| `ù`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Ù`¶ | `LDR U` | Will output upper character if Capslock enabled. |
133| `û`¶ &nbsp;&nbsp;or&nbsp;&nbsp; `Û`¶ | `LDR U U` | Will output upper character if Capslock enabled. |
134
135### Special Characters and Punctuation
136
137| Output | Sequence | Description |
138| :--- | :--- | :--- |
139| `±`¶ | `LDR = -` | n/a |
140| `≤`¶ | `LDR - =` | n/a |
141| `≥`¶ | `LDR = =` | n/a |
142| `=>`¶ | `LDR , ,` | n/a |
143| `<=`¶ | `LDR . .` | n/a |
144| ``` ` ``` ¶ | `LDR ESC` | n/a |
145| \`\`\` ¶ | `LDR ESC ESC ESC` | n/a |
146| `,` space ¶ | `LDR SPACE` | n/a |
147| `.` space ¶ | `LDR SPACE SPACE` | n/a |
148
149### Text Selection Macros
150
151| Output | Sequence |
152| :--- | :--- |
153| Select everything on this line before cursor | `LDR LEFT-ARROW` |
154| Select everything on this line after cursor | `LDR RIGHT-ARROW` |
155| Select everything on this line before cursor up to end of previous line | `LDR LEFT-ARROW LEFT-ARROW` | n/a |
156| Select everything on this line | `LDR RIGHT-ARROW LEFT-ARROW` |
157| Select 1x Page Up on the page before the cursor | `LDR UP-ARROW` |
158| Select 1x Page Down on the page after the cursor | `LDR DOWN-ARROW` |
159| Select everything on the page before the cursor | `LDR UP-ARROW UP-ARROW` |
160| Select everything on the page after the cursor | `LDR DOWN-ARROW DOWN-ARROW` |
161
162### Expanded Space Cadet Macros
163
164| Output | Sequence | Description |
165| :--- | :--- | :--- |
166| `"`¶ | `LDR '` | Will output single double-quote |
167| `"`¶`"` | `LDR ' '` | Will wrap cursor between two double-quotes |
168| `"`WORD`"`¶ | `LDR ' ' '` | Will wrap word on cursor between two double-quotes |
169| `(`¶ | `LDR LEFT-SFT` | Will output single left parenthesis |
170| `)`¶ | `LDR RIGHT-SFT` | Will output single right parenthesis |
171| `(`¶`)` | `LDR LEFT-SFT LEFT-SFT` | Will wrap cursor between two parenthesis' |
172| `(`¶`)` | `LDR RIGHT-SFT RIGHT-SFT` | Will wrap cursor between two parenthesis' |
173| `(`WORD`)`¶ | `LDR LEFT-SFT W` | Will wrap word on cursor between two parenthesis' |
174| `(`WORD`)`¶ | `LDR RIGHT-SFT W` | Will wrap word on cursor between two parenthesis' |
175| `(`SELECTION`)`¶ | `LDR LEFT-SFT W W` | Will wrap selection between two parenthesis' |
176| `(`SELECTION`)`¶ | `LDR RIGHT-SFT W W` | Will wrap selection between two parenthesis' |
177| `[`¶ | `LDR LEFT-CTL` | Will output single left bracket |
178| `]`¶ | `LDR RIGHT-CTL` | Will output single right bracket |
179| `[`¶`]` | `LDR LEFT-CTL LEFT-CTL` | Will wrap cursor between two brackets' |
180| `[`¶`]` | `LDR RIGHT-CTL RIGHT-CTL` | Will wrap cursor between two brackets' |
181| `[`WORD`]`¶ | `LDR LEFT-CTL W` | Will wrap word on cursor between two brackets' |
182| `[`WORD`]`¶ | `LDR RIGHT-CTL W` | Will wrap word on cursor between two brackets' |
183| `[`SELECTION`]`¶ | `LDR LEFT-CTL W W` | Will wrap selection between two brackets' |
184| `[`SELECTION`]`¶ | `LDR RIGHT-CTL W W` | Will wrap selection between two brackets' |
185| `{`¶ | `LDR LEFT-ALT` | Will output single left curly brace |
186| `}`¶ | `LDR RIGHT-ALT` | Will output single right curly brace |
187| `{`¶`}` | `LDR LEFT-ALT LEFT-ALT` | Will wrap cursor between two curly braces' |
188| `{`¶`}` | `LDR RIGHT-ALT RIGHT-ALT` | Will wrap cursor between two curly braces' |
189| `{`WORD`}`¶ | `LDR LEFT-ALT W` | Will wrap word on cursor between two curly braces' |
190| `{`WORD`}`¶ | `LDR RIGHT-ALT W` | Will wrap word on cursor between two curly braces' |
191| `{`SELECTION`}`¶ | `LDR LEFT-ALT W W` | Will wrap selection between two curly braces' |
192| `{`SELECTION`}`¶ | `LDR RIGHT-ALT W W` | Will wrap selection between two curly braces' |
193
194### Text Expanders
195
196| Output | Sequence | Description |
197| :--- | :--- | :--- |
198| https://google.ca | `LDR G G` | n/a |
199| Layout Help URL | `LDR ESC ESC ESC ESC ESC` | URL to this readme.md page |
200| My Gmail | `LDR M L T` | You may want to update this before compiling the firmware |
201
202## STEP BY STEP FLASH INSTRUCTIONS
2031. Build the Firmware. Run build command in directory: `make dztech/dz65rgb/v2:drootz`
204 - Approximate firmware size: 27302/28672 (95%, 1370 bytes free)
2052. Flash the Firmware:
206 - Open QMK Toolbox Application
207 - Open firmware file: dztech_dz65rgb_v2_drootz.hex
208 - Unplug keyboard USB, and hold the ESC key while plugging it back in
209 - Check that QMK Toolbox displays: *** DFU device connected.
210 - Hit the flash button!
diff --git a/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk b/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk
new file mode 100644
index 000000000..24a765ab9
--- /dev/null
+++ b/keyboards/dztech/dz65rgb/keymaps/drootz/rules.mk
@@ -0,0 +1,11 @@
1DYNAMIC_MACRO_ENABLE = yes
2LEADER_ENABLE = yes
3
4# Firmware size Optimizations
5EXTRAFLAGS += -flto
6MOUSEKEY_ENABLE = no
7NKRO_ENABLE = no
8SPACE_CADET_ENABLE = no
9TAP_DANCE_ENABLE = no
10UNICODEMAP_ENABLE = no
11SPLIT_KEYBOARD = no