diff --git a/keyboards/drop/alt/keymaps/fylch_alt/alt_config.h b/keyboards/drop/alt/keymaps/fylch_alt/alt_config.h new file mode 100644 index 000000000000..52333c33ab99 --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/alt_config.h @@ -0,0 +1,14 @@ +#pragma once + +typedef union { + uint32_t raw; + struct { + uint8_t current_layer :4; + uint8_t layer_hue[3]; // Hue on each layer + }; +} alt_config_t; + +alt_config_t alt_config = { + .current_layer = 0, + .layer_hue = {80, 0, 168}, +}; diff --git a/keyboards/drop/alt/keymaps/fylch_alt/key_codes.h b/keyboards/drop/alt/keymaps/fylch_alt/key_codes.h new file mode 100644 index 000000000000..53470901fc46 --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/key_codes.h @@ -0,0 +1,16 @@ +#pragma once + +enum alt_keycodes { + MD_BOOT = SAFE_RANGE, + LAYER_TOGGLE, + PYCHARM_COMMENT, + PYCHARM_PREV_TAB, + PYCHARM_NEXT_TAB, + PYCHARM_PREV_CHANGE, + PYCHARM_NEXT_CHANGE, + PYCHARM_REFORMAT, + PYCHARM_TOGGLE_CASE, + PYCHARM_FIND_USAGES, + PYCHARM_SETTINGS, + PYCHARM_GO_TO_DECLARATION, +}; diff --git a/keyboards/drop/alt/keymaps/fylch_alt/key_processor.h b/keyboards/drop/alt/keymaps/fylch_alt/key_processor.h new file mode 100644 index 000000000000..4e0dd9347ad3 --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/key_processor.h @@ -0,0 +1,76 @@ +#pragma once + +#include "key_codes.h" +#include "utils.h" + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LEFT_SHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + case PYCHARM_COMMENT: + if (record->event.pressed) { + SEND_STRING(SS_LCTL(SS_TAP(X_SLASH))); + } + return false; + case PYCHARM_PREV_TAB: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_TAP(X_LEFT))); + } + return false; + case PYCHARM_NEXT_TAB: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_TAP(X_RIGHT))); + } + return false; + case PYCHARM_PREV_CHANGE: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_LCTL(SS_TAP(X_LEFT)))); + } + return false; + case PYCHARM_NEXT_CHANGE: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_LCTL(SS_TAP(X_RIGHT)))); + } + return false; + case PYCHARM_REFORMAT: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_LCTL(SS_TAP(X_L)))); + } + return false; + case PYCHARM_TOGGLE_CASE: + if (record->event.pressed) { + SEND_STRING(SS_LSFT(SS_LCTL(SS_TAP(X_U)))); + } + return false; + case PYCHARM_FIND_USAGES: + if (record->event.pressed) { + SEND_STRING(SS_LALT(SS_TAP(X_F7))); + } + return false; + case PYCHARM_SETTINGS: + if (record->event.pressed) { + SEND_STRING(SS_LCTL(SS_LALT(SS_TAP(X_S)))); + } + return false; + case PYCHARM_GO_TO_DECLARATION: + if (record->event.pressed) { + SEND_STRING(SS_LCTL(SS_TAP(X_B))); + } + return false; + default: + return true; + } +} diff --git a/keyboards/drop/alt/keymaps/fylch_alt/keymap.c b/keyboards/drop/alt/keymaps/fylch_alt/keymap.c index 9492005e4561..3dcc702ee5f9 100644 --- a/keyboards/drop/alt/keymaps/fylch_alt/keymap.c +++ b/keyboards/drop/alt/keymaps/fylch_alt/keymap.c @@ -1,116 +1,21 @@ #include QMK_KEYBOARD_H -enum alt_keycodes { - MD_BOOT = SAFE_RANGE, - EN, - RU, - GR -}; +#include "alt_config.h" +#include "key_codes.h" +#include "key_processor.h" +#include "layers.h" +#include "tapdance.h" +#include "utils.h" -typedef union { - uint32_t raw; - struct { - uint8_t rgb_mode :8; - }; -} alt_config_t; +#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT -alt_config_t alt_config; - -// Tap Dance declarations -enum { - TD_CTRL, - TD_EN, - TD_RU -}; - -void set_led_colors_in_range(unsigned char start_led, unsigned char end_led, unsigned char r, unsigned char g, unsigned char b) -{ - for (int i = start_led; i <= end_led; ++i) - { - rgb_matrix_set_color(i, r,g,b); - } -} - -void td_en_finished(tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - SEND_STRING(SS_LALT(SS_LSFT("8"))); - set_led_colors_in_range(67, 105, 0, 0, 255); - } else if (state->count == 2) { - SEND_STRING(SS_LALT(SS_LSFT("7"))); - set_led_colors_in_range(67, 105, 0, 255, 0); - } -} - -void td_ru_finished(tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - SEND_STRING(SS_LALT(SS_LSFT("9"))); - set_led_colors_in_range(67, 105, 255, 0, 0); - } else if (state->count == 2) { - SEND_STRING(SS_LALT(SS_LSFT("7"))); - set_led_colors_in_range(67, 105, 0, 255, 0); +void keyboard_post_init_kb(void) { + if (!rgb_matrix_is_enabled()) { + rgb_matrix_enable(); } -} -// Tap Dance definitions -tap_dance_action_t tap_dance_actions[] = { - [TD_CTRL] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_ESC), - [TD_EN] = ACTION_TAP_DANCE_FN(td_en_finished), - [TD_RU] = ACTION_TAP_DANCE_FN(td_ru_finished) -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_65_ansi_blocker( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, - 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_VOLU, - TD(TD_CTRL), 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_VOLD , - 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, MO(1), - TD(TD_EN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, TD(TD_RU), KC_LEFT, KC_DOWN, KC_RGHT - ), - [1] = LAYOUT_65_ansi_blocker( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PSCR, - _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______,_______, _______, _______, _______, _______, KC_SCROLL_LOCK, - _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_PAUSE, - _______, _______, _______, _______, _______, MD_BOOT, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END - ), - /* - [X] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - */ -}; - - -// Keyboard post initialization -void keyboard_post_init_kb(void) { - // Set pre-configured RGB mode - alt_config.raw = eeconfig_read_user(); - rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); rgb_matrix_set_color_all(0, 0, 0); -} -#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LEFT_SHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint32_t key_timer; - - switch (keycode) { - case MD_BOOT: - if (record->event.pressed) { - key_timer = timer_read32(); - } else { - if (timer_elapsed32(key_timer) >= 500) { - reset_keyboard(); - } - } - return false; - default: - return true; //Process all other keycodes normally - } -} \ No newline at end of file + change_layer(0); +} diff --git a/keyboards/drop/alt/keymaps/fylch_alt/layers.h b/keyboards/drop/alt/keymaps/fylch_alt/layers.h new file mode 100644 index 000000000000..4dfb1695024d --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/layers.h @@ -0,0 +1,28 @@ +#pragma once + +#include "key_codes.h" +#include "tapdance.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_65_ansi_blocker( + KC_GRAVE, 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_DEL, + 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_HOME, + TD(TD_CTRL), 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_END , + TD(TD_SHIFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, TD(TD_LAYER_MOD), + TD(TD_EN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, TD(TD_RU), KC_LEFT, KC_DOWN, KC_RIGHT + ), + [1] = LAYOUT_65_ansi_blocker( + _______, 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_SCROLL_LOCK, + _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______,_______, _______, _______, _______, _______, KC_PGUP, + _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, + _______, _______, _______, _______, _______, MD_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT_65_ansi_blocker( + _______, TD(TD_BOOKMARK_1), TD(TD_BOOKMARK_2), TD(TD_BOOKMARK_3), TD(TD_BOOKMARK_4), TD(TD_BOOKMARK_5), TD(TD_BOOKMARK_6), TD(TD_BOOKMARK_7), TD(TD_BOOKMARK_8), TD(TD_BOOKMARK_9), TD(TD_BOOKMARK_REMOVE), _______, _______, TD(TD_STOP), _______, + _______, _______, _______, _______, TD(TD_REPLACE), _______, PYCHARM_FIND_USAGES, PYCHARM_TOGGLE_CASE, _______, _______, _______, PYCHARM_PREV_TAB, PYCHARM_NEXT_TAB, _______, _______, + _______, _______, PYCHARM_SETTINGS, PYCHARM_GO_TO_DECLARATION, TD(TD_FIND), _______, TD(TD_HIDE), _______, _______, PYCHARM_REFORMAT, _______, _______, TD(TD_RUN), _______, + _______, _______, _______, _______, _______, TD(TD_BREAKPOINT), TD(TD_BREAKPOINT_NAVIGATION), _______, PYCHARM_PREV_CHANGE, PYCHARM_NEXT_CHANGE, PYCHARM_COMMENT, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/drop/alt/keymaps/fylch_alt/rules.mk b/keyboards/drop/alt/keymaps/fylch_alt/rules.mk index 1ba2fa8fbefa..3e1fec9a774f 100644 --- a/keyboards/drop/alt/keymaps/fylch_alt/rules.mk +++ b/keyboards/drop/alt/keymaps/fylch_alt/rules.mk @@ -1 +1,2 @@ -TAP_DANCE_ENABLE = yes \ No newline at end of file +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no diff --git a/keyboards/drop/alt/keymaps/fylch_alt/tapdance.h b/keyboards/drop/alt/keymaps/fylch_alt/tapdance.h new file mode 100644 index 000000000000..f4e048cc5d30 --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/tapdance.h @@ -0,0 +1,234 @@ +#pragma once + +#include "alt_config.h" +#include "utils.h" + +enum { + TD_CTRL, + TD_EN, + TD_RU, + TD_SHIFT, + TD_LAYER_MOD, + TD_BOOKMARK_1, + TD_BOOKMARK_2, + TD_BOOKMARK_3, + TD_BOOKMARK_4, + TD_BOOKMARK_5, + TD_BOOKMARK_6, + TD_BOOKMARK_7, + TD_BOOKMARK_8, + TD_BOOKMARK_9, + TD_BOOKMARK_REMOVE, + TD_RUN, + TD_FIND, + TD_REPLACE, + TD_HIDE, + TD_BREAKPOINT, + TD_BREAKPOINT_NAVIGATION, + TD_STOP, +}; + +void td_en_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_8)))); + set_en_colors(); + } else if (state->count == 2) { + SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_7)))); + set_gr_colors(); + } +} + +void td_ru_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_9)))); + set_ru_colors(); + } else if (state->count == 2) { + SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_7)))); + set_gr_colors(); + } +} + +void td_layer_mod_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + // We're not saving momentary layers, only persistent layers + change_effect_color(alt_config.layer_hue[1]); + layer_on(1); + } else if (state->count == 2) { + if (alt_config.current_layer == 0) + { + change_layer(2); + } + else + { + change_layer(0); + } + layer_invert(2); + } +} + +void td_layer_mod_reset(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + change_effect_color(alt_config.layer_hue[alt_config.current_layer]); + layer_off(1); + } +} + +void td_bookmark_1_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_1))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_1)))); + } +} + +void td_bookmark_2_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_2))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_2)))); + } +} + +void td_bookmark_3_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_3))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_3)))); + } +} + +void td_bookmark_4_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_4))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_4)))); + } +} + +void td_bookmark_5_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_5))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_5)))); + } +} + +void td_bookmark_6_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_6))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_6)))); + } +} + +void td_bookmark_7_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_7))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_7)))); + } +} + +void td_bookmark_8_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_8))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_8)))); + } +} + +void td_bookmark_9_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_9))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_9)))); + } +} + + +void td_bookmark_remove_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + SEND_STRING(SS_TAP(X_F11)); + } +} + +void td_run_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LSFT(SS_TAP(X_F10))); + } else if (state->count == 2) { + SEND_STRING(SS_LSFT(SS_TAP(X_F9))); + } +} + +void td_find_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_F))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_F)))); + } +} + +void td_replace_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_R))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_R)))); + } +} + +void td_hide_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LSFT(SS_TAP(X_ESC))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_F12)))); + } +} + +void td_breakpoint_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_F8))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_LALT(SS_TAP(X_F8))))); + } +} + +void td_breakpoint_navigation_finished(tap_dance_state_t *state, void *user_) { + if (state->count == 1) { + SEND_STRING(SS_TAP(X_F9)); + } else if (state->count == 2) { + SEND_STRING(SS_TAP(X_F8)); + } +} + +void td_stop_finished(tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + SEND_STRING(SS_LCTL(SS_TAP(X_F2))); + } else if (state->count == 2) { + SEND_STRING(SS_LCTL(SS_LSFT(SS_TAP(X_F2)))); + } +} + +tap_dance_action_t tap_dance_actions[] = { + [TD_CTRL] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_ESC), + [TD_EN] = ACTION_TAP_DANCE_FN(td_en_finished), + [TD_RU] = ACTION_TAP_DANCE_FN(td_ru_finished), + [TD_SHIFT] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS_LOCK), + [TD_LAYER_MOD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_layer_mod_finished, td_layer_mod_reset), + [TD_BOOKMARK_1] = ACTION_TAP_DANCE_FN(td_bookmark_1_finished), + [TD_BOOKMARK_2] = ACTION_TAP_DANCE_FN(td_bookmark_2_finished), + [TD_BOOKMARK_3] = ACTION_TAP_DANCE_FN(td_bookmark_3_finished), + [TD_BOOKMARK_4] = ACTION_TAP_DANCE_FN(td_bookmark_4_finished), + [TD_BOOKMARK_5] = ACTION_TAP_DANCE_FN(td_bookmark_5_finished), + [TD_BOOKMARK_6] = ACTION_TAP_DANCE_FN(td_bookmark_6_finished), + [TD_BOOKMARK_7] = ACTION_TAP_DANCE_FN(td_bookmark_7_finished), + [TD_BOOKMARK_8] = ACTION_TAP_DANCE_FN(td_bookmark_8_finished), + [TD_BOOKMARK_9] = ACTION_TAP_DANCE_FN(td_bookmark_9_finished), + [TD_BOOKMARK_REMOVE] = ACTION_TAP_DANCE_FN(td_bookmark_remove_finished), + [TD_RUN] = ACTION_TAP_DANCE_FN(td_run_finished), + [TD_FIND] = ACTION_TAP_DANCE_FN(td_find_finished), + [TD_REPLACE] = ACTION_TAP_DANCE_FN(td_replace_finished), + [TD_HIDE] = ACTION_TAP_DANCE_FN(td_hide_finished), + [TD_BREAKPOINT] = ACTION_TAP_DANCE_FN(td_breakpoint_finished), + [TD_BREAKPOINT_NAVIGATION] = ACTION_TAP_DANCE_FN(td_breakpoint_navigation_finished), + [TD_STOP] = ACTION_TAP_DANCE_FN(td_stop_finished), +}; diff --git a/keyboards/drop/alt/keymaps/fylch_alt/utils.h b/keyboards/drop/alt/keymaps/fylch_alt/utils.h new file mode 100644 index 000000000000..919d961947bd --- /dev/null +++ b/keyboards/drop/alt/keymaps/fylch_alt/utils.h @@ -0,0 +1,39 @@ +#pragma once + +#include "alt_config.h" + +void set_led_colors_in_range(unsigned char start_led, unsigned char end_led, unsigned char r, unsigned char g, unsigned char b) +{ + for (int i = start_led; i <= end_led; ++i) + { + rgb_matrix_set_color(i, r,g,b); + } +} + +void change_effect_color(unsigned char hue) +{ + rgb_matrix_set_speed(63); + rgb_matrix_mode(34); + rgb_matrix_sethsv(hue, 255, 255); +} + +void change_layer(unsigned char layer) +{ + alt_config.current_layer = layer; + change_effect_color(alt_config.layer_hue[layer]); +} + +void set_en_colors(void) +{ + set_led_colors_in_range(67, 105, 0, 0, 255); +} + +void set_gr_colors(void) +{ + set_led_colors_in_range(67, 105, 0, 255, 0); +} + +void set_ru_colors(void) +{ + set_led_colors_in_range(67, 105, 255, 0, 0); +}