468 lines
31 KiB
C
468 lines
31 KiB
C
#include "betalupi_ergodox.h"
|
|
#include "version.h"
|
|
//#include "keymap_german.h"
|
|
//#include "keymap_nordic.h"
|
|
//#include "keymap_french.h"
|
|
//#include "keymap_spanish.h"
|
|
//#include "keymap_hungarian.h"
|
|
//#include "keymap_swedish.h"
|
|
//#include "keymap_br_abnt2.h"
|
|
//#include "keymap_canadian_multilingual.h"
|
|
//#include "keymap_german_ch.h"
|
|
//#include "keymap_jp.h"
|
|
//#include "keymap_korean.h"
|
|
//#include "keymap_bepo.h"
|
|
//#include "keymap_italian.h"
|
|
//#include "keymap_slovenian.h"
|
|
//#include "keymap_lithuanian_azerty.h"
|
|
//#include "keymap_danish.h"
|
|
//#include "keymap_norwegian.h"
|
|
//#include "keymap_portuguese.h"
|
|
//#include "keymap_contributions.h"
|
|
//#include "keymap_czech.h"
|
|
//#include "keymap_romanian.h"
|
|
#include "keymap_russian.h"
|
|
//#include "keymap_uk.h"
|
|
//#include "keymap_estonian.h"
|
|
//#include "keymap_belgian.h"
|
|
#include "keymap_us_international.h"
|
|
|
|
#define KC_MAC_UNDO LGUI(KC_Z)
|
|
#define KC_MAC_CUT LGUI(KC_X)
|
|
#define KC_MAC_COPY LGUI(KC_C)
|
|
#define KC_MAC_PASTE LGUI(KC_V)
|
|
#define KC_PC_UNDO LCTL(KC_Z)
|
|
#define KC_PC_CUT LCTL(KC_X)
|
|
#define KC_PC_COPY LCTL(KC_C)
|
|
#define KC_PC_PASTE LCTL(KC_V)
|
|
#define ES_LESS_MAC KC_GRAVE
|
|
#define ES_GRTR_MAC LSFT(KC_GRAVE)
|
|
#define ES_BSLS_MAC ALGR(KC_6)
|
|
#define NO_PIPE_ALT KC_GRAVE
|
|
#define NO_BSLS_ALT KC_EQUAL
|
|
#define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc)
|
|
#define BP_NDSH_MAC ALGR(KC_8)
|
|
|
|
|
|
enum custom_keycodes {
|
|
RGB_SLD = EZ_SAFE_RANGE,
|
|
HSV_136_138_245,
|
|
HSV_24_210_255,
|
|
HSV_0_0_255,
|
|
ST_MACRO_0,
|
|
ST_MACRO_1,
|
|
RU_LAYER,
|
|
EN_LAYER,
|
|
RU_SYMBOL,
|
|
};
|
|
|
|
enum tap_dance_codes {
|
|
DANCE_0,
|
|
};
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
[0] = LAYOUT_ergodox_pretty(
|
|
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, TG(2), LCTL(KC_LALT), KC_6, KC_7, KC_8, KC_9, KC_0, LGUI(KC_TAB),
|
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI, KC_TRANSPARENT, KC_Y, KC_U, KC_I, KC_O, KC_TRANSPARENT, TG(6),
|
|
KC_DELETE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, MO(3), KC_L, KC_TRANSPARENT,
|
|
KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRANSPARENT, KC_TRANSPARENT, KC_N, KC_M, KC_P, KC_DOT, KC_COMMA, KC_TRANSPARENT,
|
|
OSL(7), OSL(5), KC_LALT, KC_LSHIFT, MO(4), KC_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT, OSL(5), KC_TRANSPARENT,
|
|
KC_PSCREEN, LT(8,KC_NO), LGUI(KC_SPACE), RU_LAYER,
|
|
TD(DANCE_0), TG(1),
|
|
KC_SPACE, KC_BSPACE, LCTL(KC_BSPACE), KC_DELETE, KC_RSHIFT, KC_ENTER
|
|
),
|
|
[1] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_TRANSPARENT, KC_TRANSPARENT, KC_J, KC_L, KC_U, KC_O, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_TRANSPARENT, KC_I, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_TRANSPARENT, KC_TRANSPARENT, KC_K, KC_H, KC_O, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
|
|
),
|
|
[2] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_CIRC, KC_NO, KC_HASH, KC_DLR, KC_PERC, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_NO, KC_7, KC_8, KC_9, KC_ASTR, KC_SLASH, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_PLUS, KC_4, KC_5, KC_6, KC_0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_MINUS, KC_1, KC_2, KC_3, KC_DOT, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
|
|
),
|
|
[3] = LAYOUT_ergodox_pretty(
|
|
KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_GRAVE, KC_LPRN, KC_RPRN, KC_QUES, KC_LCBR, KC_NO, KC_NO, KC_LABK, KC_RABK, KC_SLASH, KC_NO, KC_BSLASH, KC_NO,
|
|
KC_NO, KC_TILD, KC_QUOTE, KC_COMMA, KC_DOT, KC_DQUO, KC_UNDS, KC_MINUS, KC_COLN, KC_TRANSPARENT, KC_PIPE, KC_NO,
|
|
KC_NO, KC_NO, KC_LBRACKET, KC_RBRACKET, KC_EXLM, KC_RCBR, KC_NO, KC_NO, KC_EQUAL, KC_PLUS, KC_SCOLON, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT
|
|
),
|
|
[4] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_LEFT, KC_RIGHT, KC_UP, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, LALT(KC_LCTRL), KC_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_PGDOWN, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
|
|
),
|
|
[5] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT, KC_TRANSPARENT, KC_F6, KC_F7, KC_F9, KC_F9, KC_F10, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
|
|
),
|
|
[6] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_NO, KC_MS_WH_UP, KC_MS_UP, KC_MS_WH_DOWN, KC_NO, KC_NO, TO(0), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
TO(7), KC_NO, KC_NO, KC_TRANSPARENT, KC_MS_BTN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_NO, KC_NO, KC_TRANSPARENT,
|
|
KC_NO, KC_TRANSPARENT,
|
|
KC_MS_BTN1, KC_MS_BTN2, KC_NO, KC_NO, KC_LGUI, KC_TRANSPARENT
|
|
),
|
|
[7] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, LCTL(LGUI(LSFT(KC_1))),LCTL(LGUI(LSFT(KC_2))),LCTL(LGUI(LSFT(KC_3))),LCTL(LGUI(LSFT(KC_4))),KC_NO, ST_MACRO_0, ST_MACRO_1, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_TRANSPARENT, LALT(LCTL(KC_UP)),KC_NO, LCTL(LGUI(KC_SPACE)),LGUI(KC_T), KC_NO, KC_NO, KC_NO, KC_NO, LCTL(LGUI(KC_UP)),KC_NO, LGUI(KC_P), KC_NO,
|
|
KC_NO, LALT(LCTL(KC_LEFT)),LALT(LCTL(KC_DOWN)),LALT(LCTL(KC_RIGHT)),LGUI(KC_F), LGUI(KC_M), KC_NO, LCTL(LGUI(KC_LEFT)),LCTL(LGUI(KC_DOWN)),LCTL(LGUI(KC_RIGHT)),KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_NO, LGUI(LSFT(KC_C)),LGUI(KC_N), KC_NO, KC_NO, KC_NO, KC_NO, LGUI(KC_H), LGUI(KC_J), KC_NO, KC_NO, KC_NO,
|
|
TO(0), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,
|
|
KC_NO, KC_AUDIO_VOL_UP,
|
|
LGUI(KC_ENTER), LGUI(KC_BSLASH),KC_NO, KC_AUDIO_VOL_DOWN,KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE
|
|
),
|
|
[8] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, HSV_136_138_245,HSV_24_210_255, HSV_0_0_255, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, LED_LEVEL, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, RESET,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, RGB_HUI, RGB_SAI, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, RGB_HUD, RGB_SAD, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
RGB_TOG, KC_TRANSPARENT, KC_NO, RGB_TOG,
|
|
RGB_SPI, KC_NO,
|
|
RGB_MOD, RGB_SLD, RGB_SPD, TOGGLE_LAYER_COLOR,RGB_VAD, RGB_VAI
|
|
),
|
|
[9] = LAYOUT_ergodox_pretty(
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, RU_NUM, RU_RUBL, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, RU_CHE, RU_SHA, RU_IE, RU_ER, RU_TE, RU_YO, RU_SOFT, RU_U, RU_YU, RU_I, RU_O, RU_SHCH, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, RU_A, RU_ES, RU_DE, RU_EF, RU_GHE, RU_HA, RU_ZHE, RU_KA, RU_SYMBOL, RU_EL, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, RU_ZE, RU_YA, RU_TSE, RU_VE, RU_BE, RU_E, RU_HARD, RU_EN, RU_EM, RU_PE, RU_YERU, RU_SHTI, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, EN_LAYER,
|
|
KC_TRANSPARENT, KC_TRANSPARENT,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
|
|
),
|
|
[10] = LAYOUT_ergodox_pretty(
|
|
KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_GRAVE, KC_LPRN, KC_RPRN, KC_QUES, KC_LCBR, KC_NO, KC_NO, KC_LABK, KC_RABK, KC_SLASH, KC_NO, KC_BSLASH, KC_NO,
|
|
KC_NO, KC_TILD, KC_QUOTE, KC_COMMA, KC_DOT, KC_DQUO, KC_UNDS, KC_MINUS, KC_COLN, RU_SYMBOL, KC_PIPE, KC_NO,
|
|
KC_NO, KC_NO, KC_LBRACKET, KC_RBRACKET, KC_EXLM, KC_RCBR, KC_NO, KC_NO, KC_EQUAL, KC_PLUS, KC_SCOLON, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO, KC_NO, KC_NO,
|
|
KC_NO, KC_NO,
|
|
KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT
|
|
),
|
|
};
|
|
|
|
|
|
extern bool g_suspend_state;
|
|
extern rgb_config_t rgb_matrix_config;
|
|
|
|
void keyboard_post_init_user(void) {
|
|
rgb_matrix_enable();
|
|
}
|
|
|
|
const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
|
|
[1] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[2] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {32,176,255}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {85,203,158}, {32,176,255}, {32,176,255}, {85,203,158}, {85,203,158}, {85,203,158}, {32,176,255}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[3] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {85,203,158}, {134,255,213}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {243,222,234}, {10,225,255}, {134,255,213}, {85,203,158}, {85,203,158}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {10,225,255}, {243,222,234}, {243,222,234}, {243,222,234}, {243,222,234}, {10,225,255}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[4] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {32,176,255}, {32,176,255}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[5] = { {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[6] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {243,222,234}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[7] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {0,0,0}, {14,255,255}, {0,0,0}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {134,255,213}, {0,0,0}, {85,203,158}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {85,203,158}, {85,203,158}, {0,0,0}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
[9] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,165}, {0,0,165}, {0,0,165}, {0,0,165}, {0,0,165}, {153,255,153}, {153,255,153}, {153,255,153}, {153,255,153}, {153,255,153}, {0,255,145}, {0,255,145}, {0,255,145}, {0,255,145}, {0,255,145}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,165}, {0,0,165}, {0,0,165}, {0,0,165}, {0,0,165}, {153,255,153}, {153,255,153}, {153,255,153}, {153,255,153}, {153,255,153}, {0,255,145}, {0,255,145}, {0,255,145}, {0,255,145}, {0,255,145}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
[10] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {85,203,158}, {134,255,213}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {243,222,234}, {10,225,255}, {134,255,213}, {85,203,158}, {85,203,158}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {10,225,255}, {243,222,234}, {243,222,234}, {243,222,234}, {243,222,234}, {10,225,255}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} },
|
|
|
|
};
|
|
|
|
void set_layer_color(int layer) {
|
|
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
|
HSV hsv = {
|
|
.h = pgm_read_byte(&ledmap[layer][i][0]),
|
|
.s = pgm_read_byte(&ledmap[layer][i][1]),
|
|
.v = pgm_read_byte(&ledmap[layer][i][2]),
|
|
};
|
|
if (!hsv.h && !hsv.s && !hsv.v) {
|
|
rgb_matrix_set_color( i, 0, 0, 0 );
|
|
} else {
|
|
RGB rgb = hsv_to_rgb( hsv );
|
|
float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
|
|
rgb_matrix_set_color( i, f * rgb.r, f * rgb.g, f * rgb.b );
|
|
}
|
|
}
|
|
}
|
|
|
|
void rgb_matrix_indicators_user(void) {
|
|
if (g_suspend_state || keyboard_config.disable_layer_led) {
|
|
return;
|
|
}
|
|
|
|
switch (biton32(layer_state)) {
|
|
case 1:
|
|
set_layer_color(1);
|
|
break;
|
|
case 2:
|
|
set_layer_color(2);
|
|
break;
|
|
case 3:
|
|
set_layer_color(3);
|
|
break;
|
|
case 4:
|
|
set_layer_color(4);
|
|
break;
|
|
case 5:
|
|
set_layer_color(5);
|
|
break;
|
|
case 6:
|
|
set_layer_color(6);
|
|
break;
|
|
case 7:
|
|
set_layer_color(7);
|
|
break;
|
|
case 9:
|
|
set_layer_color(9);
|
|
break;
|
|
case 10:
|
|
set_layer_color(10);
|
|
break;
|
|
default:
|
|
if (rgb_matrix_get_flags() == LED_FLAG_NONE) {
|
|
rgb_matrix_set_color_all(0, 0, 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
switch (keycode) {
|
|
case ST_MACRO_0:
|
|
if (record->event.pressed) {
|
|
SEND_STRING(SS_LCTL(SS_LGUI(SS_LSFT(SS_TAP(X_R)))));
|
|
}
|
|
break;
|
|
|
|
case ST_MACRO_1:
|
|
if (record->event.pressed) {
|
|
SEND_STRING(SS_LGUI(SS_TAP(X_P)) SS_DELAY(100) SS_TAP(X_Y) SS_DELAY(100) SS_TAP(X_ENTER));
|
|
|
|
}
|
|
break;
|
|
|
|
case RU_LAYER:
|
|
if (record->event.pressed) {
|
|
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9)))));
|
|
layer_move(9);
|
|
}
|
|
break;
|
|
|
|
case EN_LAYER:
|
|
if (record->event.pressed) {
|
|
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0)))));
|
|
layer_move(0);
|
|
}
|
|
break;
|
|
|
|
case RU_SYMBOL:
|
|
if (record->event.pressed) {
|
|
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0)))));
|
|
layer_move(10);
|
|
} else {
|
|
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9)))));
|
|
layer_move(9);
|
|
}
|
|
break;
|
|
|
|
case RGB_SLD:
|
|
if (record->event.pressed) {
|
|
rgblight_mode(1);
|
|
}
|
|
return false;
|
|
|
|
case HSV_136_138_245:
|
|
if (record->event.pressed) {
|
|
rgblight_mode(1);
|
|
rgblight_sethsv(136,138,245);
|
|
}
|
|
return false;
|
|
|
|
case HSV_24_210_255:
|
|
if (record->event.pressed) {
|
|
rgblight_mode(1);
|
|
rgblight_sethsv(24,210,255);
|
|
}
|
|
return false;
|
|
|
|
case HSV_0_0_255:
|
|
if (record->event.pressed) {
|
|
rgblight_mode(1);
|
|
rgblight_sethsv(0,0,255);
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
uint32_t layer_state_set_user(uint32_t state) {
|
|
|
|
uint8_t layer = biton32(state);
|
|
|
|
ergodox_board_led_off();
|
|
ergodox_right_led_1_off();
|
|
ergodox_right_led_2_off();
|
|
ergodox_right_led_3_off();
|
|
switch (layer) {
|
|
case 1:
|
|
ergodox_right_led_1_on();
|
|
break;
|
|
|
|
case 2:
|
|
ergodox_right_led_2_on();
|
|
break;
|
|
|
|
case 3:
|
|
ergodox_right_led_3_on();
|
|
break;
|
|
|
|
case 4:
|
|
ergodox_right_led_1_on();
|
|
ergodox_right_led_2_on();
|
|
break;
|
|
|
|
case 5:
|
|
ergodox_right_led_1_on();
|
|
ergodox_right_led_3_on();
|
|
break;
|
|
|
|
case 6:
|
|
ergodox_right_led_2_on();
|
|
ergodox_right_led_3_on();
|
|
break;
|
|
|
|
case 7:
|
|
ergodox_right_led_1_on();
|
|
ergodox_right_led_2_on();
|
|
ergodox_right_led_3_on();
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
return state;
|
|
};
|
|
|
|
typedef struct {
|
|
bool is_press_action;
|
|
uint8_t step;
|
|
} tap;
|
|
|
|
enum {
|
|
SINGLE_TAP = 1,
|
|
SINGLE_HOLD,
|
|
DOUBLE_TAP,
|
|
DOUBLE_HOLD,
|
|
DOUBLE_SINGLE_TAP,
|
|
MORE_TAPS
|
|
};
|
|
|
|
static tap dance_state[1];
|
|
|
|
uint8_t dance_step(qk_tap_dance_state_t *state);
|
|
|
|
uint8_t dance_step(qk_tap_dance_state_t *state) {
|
|
if (state->count == 1) {
|
|
if (state->interrupted || !state->pressed) {
|
|
return SINGLE_TAP;
|
|
} else {
|
|
return SINGLE_HOLD;
|
|
}
|
|
} else if (state->count == 2) {
|
|
if (state->interrupted) {
|
|
return DOUBLE_SINGLE_TAP;
|
|
} else if (state->pressed) {
|
|
return DOUBLE_HOLD;
|
|
} else {
|
|
return DOUBLE_TAP;
|
|
}
|
|
}
|
|
return MORE_TAPS;
|
|
}
|
|
|
|
|
|
void on_dance_0(qk_tap_dance_state_t *state, void *user_data);
|
|
void dance_0_finished(qk_tap_dance_state_t *state, void *user_data);
|
|
void dance_0_reset(qk_tap_dance_state_t *state, void *user_data);
|
|
|
|
void on_dance_0(qk_tap_dance_state_t *state, void *user_data) {
|
|
if(state->count == 3) {
|
|
tap_code16(LGUI(KC_L));
|
|
tap_code16(LGUI(KC_L));
|
|
tap_code16(LGUI(KC_L));
|
|
}
|
|
if(state->count > 3) {
|
|
tap_code16(LGUI(KC_L));
|
|
}
|
|
}
|
|
|
|
void dance_0_finished(qk_tap_dance_state_t *state, void *user_data) {
|
|
dance_state[0].step = dance_step(state);
|
|
switch (dance_state[0].step) {
|
|
case SINGLE_TAP:
|
|
register_code16(LGUI(KC_L));
|
|
break;
|
|
case DOUBLE_TAP:
|
|
register_code16(LGUI(KC_K));
|
|
break;
|
|
case DOUBLE_SINGLE_TAP:
|
|
tap_code16(LGUI(KC_L));
|
|
register_code16(LGUI(KC_L));
|
|
break;
|
|
}
|
|
}
|
|
|
|
void dance_0_reset(qk_tap_dance_state_t *state, void *user_data) {
|
|
wait_ms(10);
|
|
switch (dance_state[0].step) {
|
|
case SINGLE_TAP:
|
|
unregister_code16(LGUI(KC_L));
|
|
break;
|
|
case DOUBLE_TAP:
|
|
unregister_code16(LGUI(KC_K));
|
|
break;
|
|
case DOUBLE_SINGLE_TAP:
|
|
unregister_code16(LGUI(KC_L));
|
|
break;
|
|
}
|
|
dance_state[0].step = 0;
|
|
}
|
|
|
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
|
[DANCE_0] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_0, dance_0_finished, dance_0_reset),
|
|
};
|