#include QMK_KEYBOARD_H
bool onMac = false;
bool isLeader = false;
bool isBlinking = false;
bool isRecording = false;
bool isPlaying = false;
const float led_dim_ratio = 0.50;
static uint16_t blink_cycle_timer,
blink_fade_in_timer,
blink_fade_out_timer,
macro_one_play_timer,
macro_two_play_timer,
macro_play_blink_timer = 2000;
static uint8_t fade_in_step_counter,
fade_out_step_counter,
blink_hsv_value;
void rgb_matrix_set_color_hsv(uint8_t led, uint16_t hue, uint16_t sat, uint16_t val, float val_ratio) {
const uint8_t h = hue <= 255 ? hue : rgb_matrix_config.hsv.h;
const uint8_t s = sat <= 255 ? sat : rgb_matrix_config.hsv.s;
const uint8_t v = val <= 255 ? val * val_ratio : rgb_matrix_config.hsv.v * val_ratio;
HSV hsv_in = {h, s, v};
RGB rgb_out = hsv_to_rgb(hsv_in);
rgb_matrix_set_color(led, rgb_out.r, rgb_out.g, rgb_out.b);
}
void reset_blink_cycle(void) {
blink_cycle_timer = timer_read();
blink_fade_in_timer = timer_read();
blink_fade_out_timer = timer_read();
blink_hsv_value = 0;
fade_in_step_counter = 0;
fade_out_step_counter = 0;
}
void reset_blink_status(void) {
isRecording = false;
isPlaying = false;
isBlinking = false;
}
void get_this_led_blinking(uint8_t led_index, bool speed, uint8_t hue, uint8_t sat) {
const uint16_t static_on_time = speed ? 200 : 500;
const uint16_t static_off_time = speed ? 200 : 500;
const uint8_t fade_timing = speed ? 100 : 150;
const uint8_t fade_step = speed ? 10 : 15;
const uint8_t fade_value_step_size = rgb_matrix_config.hsv.v / fade_step;
const uint8_t fade_cycle_time_elapsed = fade_timing / fade_step;
if (timer_elapsed(blink_cycle_timer) < static_on_time) {
if (timer_elapsed(blink_fade_in_timer) > fade_cycle_time_elapsed && fade_in_step_counter < fade_step) {
blink_hsv_value = blink_hsv_value + fade_value_step_size;
fade_in_step_counter = fade_in_step_counter + 1;
blink_fade_in_timer = timer_read();
}
} else {
if (timer_elapsed(blink_fade_out_timer) > fade_cycle_time_elapsed && fade_out_step_counter < fade_step) {
blink_hsv_value = blink_hsv_value - fade_value_step_size;
fade_out_step_counter = fade_out_step_counter + 1;
blink_fade_out_timer = timer_read();
}
}
rgb_matrix_set_color_hsv(led_index, hue, sat, blink_hsv_value, 0.75);
if (timer_elapsed(blink_cycle_timer) > static_on_time + static_off_time) {
reset_blink_cycle();
}
}
enum layers {
_MAIN,
_MAC,
_FN
}
const layers_leds_map[] = {
[_MAIN] = 45,
[_MAC] = 46,
[_FN] = 63
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MAIN] = LAYOUT_65_ansi(
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,
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,
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,
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,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_MAC] = LAYOUT_65_ansi(
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,
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,
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, 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_LALT, KC_LGUI, KC_TRNS, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[_FN] = LAYOUT_65_ansi(
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,
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,
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,
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,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_MOD
),
};
void rgb_matrix_indicators_user(void) {
#ifdef RGB_MATRIX_ENABLE
const uint8_t led_constant_val = rgb_matrix_config.hsv.v < 100 ? 100 : rgb_matrix_config.hsv.v;
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
rgb_matrix_set_color_hsv(30, 999, 0, led_constant_val, 0.75); }
rgb_matrix_set_color_hsv(layers_leds_map[get_highest_layer(layer_state)], 999, 0, led_constant_val, led_dim_ratio);
if (isLeader) {
rgb_matrix_set_color_hsv(14, 999, 999, 999, 1); rgb_matrix_set_color_hsv(30, 999, 999, 999, 1); } else {
rgb_matrix_set_color_hsv(14, 999, 999, 999, led_dim_ratio); }
if (isRecording && isBlinking) {
get_this_led_blinking(0, false, 0, 255);
}
if (isPlaying && isBlinking) {
if (timer_elapsed(macro_one_play_timer) < macro_play_blink_timer || timer_elapsed(macro_two_play_timer) < macro_play_blink_timer) {
get_this_led_blinking(0, true, 85, 255);
} else {
if (isBlinking && isPlaying) {
reset_blink_status();
reset_blink_cycle();
}
}
}
switch (biton32(layer_state)) {
case _FN:
if (isRecording) {
rgb_matrix_set_color_hsv(0, 0, 999, 999, 1);
} else {
rgb_matrix_set_color_hsv(43, 0, 999, 999, led_dim_ratio);
rgb_matrix_set_color_hsv(29, 0, 999, 999, led_dim_ratio);
rgb_matrix_set_color_hsv(42, 85, 999, 999, led_dim_ratio);
rgb_matrix_set_color_hsv(28, 85, 999, 999, led_dim_ratio);
}
rgb_matrix_set_color_hsv(45, 999, 0, led_constant_val, led_dim_ratio);
rgb_matrix_set_color_hsv(46, 999, 0, led_constant_val, led_dim_ratio);
break;
}
#endif
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
bool pressed = record->event.pressed;
if (pressed) {
switch (keycode) {
case TO(_MAC):
onMac = true;
break;
case TO(_MAIN):
onMac = false;
break;
}
}
return true;
}
#ifdef LEADER_ENABLE
enum french_letter {
_A,
_E,
_I,
_O,
_U
};
const uint8_t french_letter_index[5] = {
[_A] = 0,
[_E] = 1,
[_I] = 2,
[_O] = 3,
[_U] = 4
};
enum french_accent {
_CIRCUMFLEX,
_GRAVE,
_ACUTE
};
const uint8_t french_accent_index[3] = {
[_CIRCUMFLEX] = 0,
[_GRAVE] = 1,
[_ACUTE] = 2
};
const uint8_t french_decimal_unicodes[5][3][2] = {
{
{
131, 194 },{
133, 192 }
},{
{
136, 202 },{
138, 200 },{
130, 201 }
},{
{
140, 206 }
},{
{
147, 212 }
},{
{
150, 219 },{
151, 217 }
}
};
void break_int_in_array(uint8_t int_code, uint8_t size, uint8_t *array) {
uint8_t i;
i = size;
while (i--) {
array[i] = int_code%10;
int_code /= 10;
}
}
void send_french_accent(uint8_t letter, uint8_t accent) {
bool isCaps;
uint8_t decimal_unicode_in;
uint8_t decimal_unicode_size = 3;
uint8_t decimal_unicode_out[decimal_unicode_size];
const uint16_t numpad_key_map[10] = {
KC_P0, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9
};
const uint16_t french_letter_key_map[5] = {
KC_A, KC_E, KC_I, KC_O, KC_U
};
const uint16_t osx_mod_key_map[3] = {
KC_I, KC_GRAVE, KC_E };
void tap_win_alt_code(void) {
if (isCaps) {
tap_code(numpad_key_map[0]); }
for (int i = 0; i < decimal_unicode_size; ++i) {
tap_code(numpad_key_map[decimal_unicode_out[i]]);
}
}
isCaps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK) ? true : false;
if (onMac) {
if (isCaps) {
SEND_STRING(SS_TAP(X_CAPSLOCK));
register_code(KC_LALT);
tap_code(osx_mod_key_map[accent]);
unregister_code(KC_LALT);
register_code(KC_LSFT);
tap_code(french_letter_key_map[letter]);
unregister_code(KC_LSFT);
tap_code(KC_CAPS);
} else {
register_code(KC_LALT);
tap_code(osx_mod_key_map[accent]);
unregister_code(KC_LALT);
tap_code(french_letter_key_map[letter]);
}
} else {
decimal_unicode_in = isCaps ? french_decimal_unicodes[letter][accent][1] : french_decimal_unicodes[letter][accent][0];
break_int_in_array(decimal_unicode_in, decimal_unicode_size, decimal_unicode_out);
register_code(KC_LALT);
tap_win_alt_code();
unregister_code(KC_LALT);
}
}
void ldrkey_send_paranthesis_wrap_ini(void) {
SEND_STRING("()" SS_TAP(X_LEFT));
}
void ldrkey_send_paranthesis_wrap_word(void) {
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)) ")");
}
void ldrkey_send_paranthesis_wrap_selection(void) {
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));
}
void ldrkey_send_bracket_wrap_ini(void) {
SEND_STRING("[]" SS_TAP(X_LEFT));
}
void ldrkey_send_bracket_wrap_word(void) {
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)) "]");
}
void ldrkey_send_bracket_wrap_selection(void) {
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));
}
void ldrkey_send_curlybrace_wrap_ini(void) {
SEND_STRING("{}" SS_TAP(X_LEFT));
}
void ldrkey_send_curlybrace_wrap_word(void) {
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)) "}");
}
void ldrkey_send_curlybrace_wrap_selection(void) {
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));
}
LEADER_EXTERNS();
void matrix_scan_user(void)
{
LEADER_DICTIONARY()
{
leading = false;
leader_end();
SEQ_ONE_KEY(KC_SLSH) {
send_french_accent(_E, _ACUTE);
}
SEQ_ONE_KEY(KC_A) {
send_french_accent(_A, _GRAVE);
}
SEQ_ONE_KEY(KC_E) {
send_french_accent(_E, _GRAVE);
}
SEQ_ONE_KEY(KC_U) {
send_french_accent(_U, _GRAVE);
}
SEQ_TWO_KEYS(KC_A, KC_A) {
send_french_accent(_A, _CIRCUMFLEX);
}
SEQ_TWO_KEYS(KC_E, KC_E) {
send_french_accent(_E, _CIRCUMFLEX);
}
SEQ_TWO_KEYS(KC_I, KC_I) {
send_french_accent(_I, _CIRCUMFLEX);
}
SEQ_TWO_KEYS(KC_O, KC_O) {
send_french_accent(_O, _CIRCUMFLEX);
}
SEQ_TWO_KEYS(KC_U, KC_U) {
send_french_accent(_U, _CIRCUMFLEX);
}
SEQ_ONE_KEY(KC_C) {
if (onMac) {
SEND_STRING(SS_LALT("c"));
} else {
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));
}
}
SEQ_ONE_KEY(KC_LEAD) {
tap_code(KC_CAPS);
}
SEQ_TWO_KEYS(KC_EQL, KC_MINS) {
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));
}
SEQ_TWO_KEYS(KC_MINS, KC_EQL) {
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));
}
SEQ_TWO_KEYS(KC_EQL, KC_EQL) {
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));
}
SEQ_TWO_KEYS(KC_COMM, KC_COMM) {
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));
}
SEQ_TWO_KEYS(KC_DOT, KC_DOT) {
SEND_STRING("=>");
}
SEQ_ONE_KEY(KC_SPC) {
SEND_STRING(", ");
}
SEQ_TWO_KEYS(KC_SPC, KC_SPC) {
SEND_STRING(". ");
}
SEQ_TWO_KEYS(KC_BSPC, KC_BSPC) {
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));
}
SEQ_ONE_KEY(KC_BSPC) {
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));
}
SEQ_TWO_KEYS(KC_DEL, KC_DEL) {
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));
}
SEQ_ONE_KEY(KC_DEL) {
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));
}
SEQ_ONE_KEY(KC_GESC) {
SEND_STRING("`");
}
SEQ_THREE_KEYS(KC_GESC, KC_GESC, KC_GESC) {
SEND_STRING("```");
}
SEQ_ONE_KEY(KC_INS) {
onMac ? SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_4)))) : SEND_STRING(SS_TAP(X_PSCR));
}
SEQ_ONE_KEY(KC_PGUP) {
onMac ? SEND_STRING(SS_TAP(X_HOME)) : SEND_STRING(SS_LCTL(SS_TAP(X_HOME)));
}
SEQ_ONE_KEY(KC_PGDN) {
onMac ? SEND_STRING(SS_TAP(X_END)) : SEND_STRING(SS_LCTL(SS_TAP(X_END)));
}
SEQ_ONE_KEY(KC_W) {
onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_W))) : SEND_STRING(SS_LCTL(SS_TAP(X_W)));
}
SEQ_ONE_KEY(KC_Q) {
onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_Q))) : SEND_STRING(SS_LALT(SS_TAP(X_F4)));
}
SEQ_ONE_KEY(KC_QUOT) {
SEND_STRING("\"");
}
SEQ_TWO_KEYS(KC_QUOT, KC_QUOT) {
SEND_STRING("\"\"" SS_TAP(X_LEFT));
}
SEQ_THREE_KEYS(KC_QUOT, KC_QUOT, KC_QUOT) {
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)) "\"");
}
SEQ_ONE_KEY(KC_LSFT) {
SEND_STRING("(");
}
SEQ_ONE_KEY(KC_RSFT) {
SEND_STRING(")");
}
SEQ_TWO_KEYS(KC_LSFT, KC_LSFT) {
ldrkey_send_paranthesis_wrap_ini();
}
SEQ_TWO_KEYS(KC_RSFT, KC_RSFT) {
ldrkey_send_paranthesis_wrap_ini();
}
SEQ_TWO_KEYS(KC_LSFT, KC_W) {
ldrkey_send_paranthesis_wrap_word();
}
SEQ_TWO_KEYS(KC_RSFT, KC_W) {
ldrkey_send_paranthesis_wrap_word();
}
SEQ_THREE_KEYS(KC_LSFT, KC_W, KC_W) {
ldrkey_send_paranthesis_wrap_selection();
}
SEQ_THREE_KEYS(KC_RSFT, KC_W, KC_W) {
ldrkey_send_paranthesis_wrap_selection();
}
SEQ_ONE_KEY(KC_LCTL) {
SEND_STRING("[");
}
SEQ_ONE_KEY(KC_RCTL) {
SEND_STRING("]");
}
SEQ_TWO_KEYS(KC_LCTL, KC_LCTL) {
ldrkey_send_bracket_wrap_ini();
}
SEQ_TWO_KEYS(KC_RCTL, KC_RCTL) {
ldrkey_send_bracket_wrap_ini();
}
SEQ_TWO_KEYS(KC_LCTL, KC_W) {
ldrkey_send_bracket_wrap_word();
}
SEQ_TWO_KEYS(KC_RCTL, KC_W) {
ldrkey_send_bracket_wrap_word();
}
SEQ_THREE_KEYS(KC_LCTL, KC_W, KC_W) {
ldrkey_send_bracket_wrap_selection();
}
SEQ_THREE_KEYS(KC_RCTL, KC_W, KC_W) {
ldrkey_send_bracket_wrap_selection();
}
SEQ_ONE_KEY(KC_LALT) {
SEND_STRING("{");
}
SEQ_ONE_KEY(KC_RALT) {
SEND_STRING("}");
}
SEQ_TWO_KEYS(KC_LALT, KC_LALT) {
ldrkey_send_curlybrace_wrap_ini();
}
SEQ_TWO_KEYS(KC_RALT, KC_RALT) {
ldrkey_send_curlybrace_wrap_ini();
}
SEQ_TWO_KEYS(KC_LALT, KC_W) {
ldrkey_send_curlybrace_wrap_word();
}
SEQ_TWO_KEYS(KC_RALT, KC_W) {
ldrkey_send_curlybrace_wrap_word();
}
SEQ_THREE_KEYS(KC_LALT, KC_W, KC_W) {
ldrkey_send_curlybrace_wrap_selection();
}
SEQ_THREE_KEYS(KC_RALT, KC_W, KC_W) {
ldrkey_send_curlybrace_wrap_selection();
}
SEQ_ONE_KEY(KC_LEFT) {
onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_LEFT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_HOME)));
}
SEQ_ONE_KEY(KC_RIGHT) {
onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_RIGHT)))) : SEND_STRING(SS_LSFT(SS_TAP(X_END)));
}
SEQ_TWO_KEYS(KC_LEFT, KC_LEFT) {
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)));
}
SEQ_TWO_KEYS(KC_RIGHT, KC_LEFT) {
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)));
}
SEQ_ONE_KEY(KC_UP) {
SEND_STRING(SS_LSFT(SS_TAP(X_PGUP)));
}
SEQ_ONE_KEY(KC_DOWN) {
SEND_STRING(SS_LSFT(SS_TAP(X_PGDN)));
}
SEQ_TWO_KEYS(KC_UP, KC_UP) {
onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_UP)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_HOME))));
}
SEQ_TWO_KEYS(KC_DOWN, KC_DOWN) {
onMac ? SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_DOWN)))) : SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_END))));
}
SEQ_FIVE_KEYS(KC_GESC, KC_GESC, KC_GESC, KC_GESC, KC_GESC) {
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/keyboards/dztech/dz65rgb/keymaps/drootz");
}
SEQ_TWO_KEYS(KC_G, KC_G) {
SEND_STRING("https://google.ca" SS_TAP(X_ENT));
}
SEQ_THREE_KEYS(KC_M, KC_L, KC_T) {
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");
}
SEQ_ONE_KEY(KC_D) {
onMac ? SEND_STRING(SS_LGUI(SS_TAP(X_SPC)) "Mission" SS_TAP(X_ENT)) : SEND_STRING(SS_LGUI(SS_TAP(X_D)));
}
}
}
void leader_start(void) {
isLeader = true;
}
void leader_end(void) {
isLeader = false;
}
#endif
void dynamic_macro_record_start_user(void) {
onMac = false;
if (!isBlinking && !isRecording) {
reset_blink_cycle();
isBlinking = true;
isRecording = true;
}
}
void dynamic_macro_record_end_user(int8_t direction) {
if (isBlinking && isRecording) {
reset_blink_status();
reset_blink_cycle();
}
}
void dynamic_macro_play_user(int8_t direction) {
switch (direction) {
case 1:
if (!isBlinking && !isPlaying) {
reset_blink_cycle();
isBlinking = true;
isPlaying = true;
macro_one_play_timer = timer_read();
}
break;
case -1:
if (!isBlinking && !isPlaying) {
reset_blink_cycle();
isBlinking = true;
isPlaying = true;
macro_two_play_timer = timer_read();
}
break;
}
}