Compare commits

..

3 Commits

Author SHA1 Message Date
Mark a4759176b1
Removed keyboard ascii art 2022-07-19 08:45:42 -07:00
Mark 092fdc64ba
Added editorconfig 2022-07-19 08:45:26 -07:00
Mark fab3cef86d
Defined layers with macros and rearranged code
Closes: #2
2022-07-19 08:45:18 -07:00
29 changed files with 721 additions and 525 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

View File

@ -1,4 +1,5 @@
#include "keymap.h"
#include "layers/layers.h"
// Values that should not be saved to git.
// Create a `secrets.h` in the keymap directory.
@ -7,101 +8,21 @@
// SECRET_EMAIL
#include "secrets.h"
// Define custom keys
// (Must be done BEFORE keymaps)
enum custom_keycodes {
M_SHUTDOWN = BETA_SAFE_RANGE,
M_RESETWM,
M_RU_CTRL,
M_RU_ALT
};
enum tap_dance_codes {
TD_WMLAYOUT,
};
// Assemble key and LED maps
enum layer_indices {
LAYER_MAIN_IDX = 0,
LAYER_RUSSIAN_IDX,
LAYER_NUMPAD_IDX,
LAYER_SYMBOLS_IDX,
LAYER_ARROWS_IDX,
LAYER_FKEYS_IDX,
LAYER_DESKTOP_IDX,
LAYER_KEYBOARD_IDX,
LAYER_SYMBOLS_RU_IDX
};
enum led_indices {
// We have seperate indexes for LEDs because
// some layers may not need an led map.
// This saves memory by avoiding extra empty led maps.
LAYER_RUSSIAN_LEDS_IDX = 0,
LAYER_NUMPAD_LEDS_IDX,
LAYER_SYMBOLS_LEDS_IDX,
LAYER_ARROWS_LEDS_IDX,
LAYER_FKEYS_LEDS_IDX,
LAYER_DESKTOP_LEDS_IDX,
LAYER_SYMBOLS_RU_LEDS_IDX
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_MAIN_IDX] = LAYER_MAIN,
[LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN,
[LAYER_NUMPAD_IDX] = LAYER_NUMPAD,
[LAYER_SYMBOLS_IDX] = LAYER_SYMBOLS,
[LAYER_ARROWS_IDX] = LAYER_ARROWS,
[LAYER_FKEYS_IDX] = LAYER_FKEYS,
[LAYER_DESKTOP_IDX] = LAYER_DESKTOP,
[LAYER_KEYBOARD_IDX] = LAYER_KEYBOARD,
[LAYER_SYMBOLS_RU_IDX] = LAYER_SYMBOLS_RU
};
const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
[LAYER_RUSSIAN_LEDS_IDX] = LAYER_RUSSIAN_LEDS,
[LAYER_NUMPAD_LEDS_IDX] = LAYER_NUMPAD_LEDS,
[LAYER_SYMBOLS_LEDS_IDX] = LAYER_SYMBOLS_LEDS,
[LAYER_ARROWS_LEDS_IDX] = LAYER_ARROWS_LEDS,
[LAYER_FKEYS_LEDS_IDX] = LAYER_FKEYS_LEDS,
[LAYER_DESKTOP_LEDS_IDX] = LAYER_DESKTOP_LEDS,
[LAYER_SYMBOLS_RU_LEDS_IDX] = LAYER_SYMBOLS_RU_LEDS
};
void keyboard_post_init_user(void) {}
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 leader_start(void) {
ergodox_right_led_3_on();
}
void leader_end(void) {
ergodox_right_led_3_off();
}
LEADER_EXTERNS();
void leader_start(void) { ergodox_right_led_3_on(); }
void leader_end(void) { ergodox_right_led_3_off(); }
void matrix_scan_user(void) {
LEADER_DICTIONARY() {
leading = false;
leader_end();
SEQ_TWO_KEYS(KC_E, KC_M) {
SEND_STRING(SECRET_EMAIL);
}
//SEQ_ONE_KEY(KC_F) {}
//
//SEQ_TWO_KEYS(KC_A, KC_S) {
@ -112,113 +33,51 @@ void matrix_scan_user(void) {
//}
SEQ_TWO_KEYS(KC_E, KC_M) {
SEND_STRING(SECRET_EMAIL);
}
}
}
void rgb_matrix_indicators_user(void) {
if (keyboard_config.disable_layer_led) {
return;
}
switch (biton32(layer_state)) {
case LAYER_RUSSIAN_IDX:
set_layer_color(LAYER_RUSSIAN_LEDS_IDX);
break;
case LAYER_SYMBOLS_RU_IDX:
set_layer_color(LAYER_SYMBOLS_RU_LEDS_IDX);
break;
case LAYER_NUMPAD_IDX:
set_layer_color(LAYER_NUMPAD_LEDS_IDX);
break;
case LAYER_SYMBOLS_IDX:
set_layer_color(LAYER_SYMBOLS_LEDS_IDX);
break;
case LAYER_ARROWS_IDX:
set_layer_color(LAYER_ARROWS_LEDS_IDX);
break;
case LAYER_FKEYS_IDX:
set_layer_color(LAYER_FKEYS_LEDS_IDX);
break;
case LAYER_DESKTOP_IDX:
set_layer_color(LAYER_DESKTOP_LEDS_IDX);
break;
default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE) {
rgb_matrix_set_color_all(0, 0, 0);
}
break;
}
}
// Return FALSE to halt key processing,
// Return TRUE to allow QMK to handle keypress.
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// Handle macros
switch (keycode) {
case M_RESETWM:
if (record->event.pressed) {
SEND_STRING(SS_LCTL(SS_LGUI(SS_LSFT(SS_TAP(X_R)))));
}
break;
return false;
case M_SHUTDOWN:
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;
return false;
case M_RU_CTRL:
if (record->event.pressed) {
layer_move(LAYER_MAIN_IDX);
layer_move(LAYER_MAIN);
register_code16(KC_LCTRL);
} else {
unregister_code16(KC_LCTRL);
layer_move(LAYER_RUSSIAN_IDX);
layer_move(LAYER_RUSSIAN);
}
break;
return false;
case M_RU_ALT:
if (record->event.pressed) {
layer_move(LAYER_MAIN_IDX);
layer_move(LAYER_MAIN);
register_code16(KC_LALT);
} else {
unregister_code16(KC_LALT);
layer_move(LAYER_RUSSIAN_IDX);
layer_move(LAYER_RUSSIAN);
}
break;
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 LAYER_NUMPAD_IDX:
ergodox_right_led_1_on();
break;
case LAYER_KEYBOARD_IDX:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
default:
break;
}
return state;
};
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_WMLAYOUT] = ACTION_TAP_DANCE_FN_ADVANCED(td_wmlayout_dance, td_wmlayout_finished, td_wmlayout_reset),
};
}

View File

@ -2,39 +2,14 @@
#include "betalupi_ergodox.h"
#include "version.h"
#include "keymap_russian.h"
#include "keymap_us_international.h"
#include "layers.h"
#include "tapdance.h"
#include "tapdance/tapdance.h"
extern rgb_config_t rgb_matrix_config;
/* Text keyboard
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd |
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | LGui | | Alt |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Home | | PgUp | | |
* | Space|Backsp|------| |------| Tab |Enter |
* | |ace | End | | PgDn | | |
* `--------------------' `----------------------'
*/
// LED colors, in HSV.
#define LC_OFF LC_HSV( 0, 0, 0)
#define LC_GREEN LC_HSV( 85, 203, 158)
@ -47,3 +22,11 @@ extern rgb_config_t rgb_matrix_config;
#define LC_RU_G LC_HSV(153, 255, 153)
#define LC_RU_K LC_HSV( 0, 255, 145)
// Define custom keys
// (Must be done BEFORE keymaps)
enum custom_keycodes {
M_SHUTDOWN = BETA_SAFE_RANGE,
M_RESETWM,
M_RU_CTRL,
M_RU_ALT
};

View File

@ -1,11 +0,0 @@
#pragma once
#include "layers/main.h"
#include "layers/numpad.h"
#include "layers/symbols.h"
#include "layers/arrows.h"
#include "layers/fkeys.h"
#include "layers/desktop.h"
#include "layers/keyboard.h"
#include "layers/russian.h"
#include "layers/symbols_ru.h"

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_ARROWS LAYOUT_ergodox(\
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_TRANSPARENT, LGUI(LCTL(KC_ENTER)), KC_NO, KC_UP, KC_NO, KC_PGUP, KC_TRANSPARENT,\
KC_LGUI, LALT(KC_LCTRL), KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN,\
KC_TRANSPARENT, LGUI(KC_LCTRL), 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_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_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\
)
#define LAYER_ARROWS_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_YELLOW, LC_OFF, LC_GREEN, LC_OFF, LC_ORANGE, \
LC_ORANGE, LC_GREEN, LC_GREEN, LC_GREEN, LC_ORANGE, \
LC_ORANGE, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -0,0 +1,10 @@
# EditorConfig is awesome: https://EditorConfig.org
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

View File

@ -0,0 +1,53 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(ARROWS)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_TRANSPARENT, LGUI(LCTL(KC_ENTER)), KC_NO, KC_UP, KC_NO, KC_PGUP, KC_TRANSPARENT,\
KC_LGUI, LALT(KC_LCTRL), KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN,\
KC_TRANSPARENT, LGUI(KC_LCTRL), 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_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_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\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_YELLOW, LC_OFF, LC_GREEN, LC_OFF, LC_ORANGE, \
LC_ORANGE, LC_GREEN, LC_GREEN, LC_GREEN, LC_ORANGE, \
LC_ORANGE, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,52 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(DESKTOP)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_TRANSPARENT, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), TO(LAYER_MAIN),\
KC_NO, KC_NO, LGUI(LCTL(KC_ENTER)), KC_NO, KC_NO, LGUI(KC_T), KC_NO,\
KC_NO, LGUI(KC_PLUS), LGUI(KC_MINUS), KC_NO, LGUI(KC_F), LGUI(KC_G),\
KC_NO, KC_NO, KC_NO, LGUI(LSFT(KC_C)), LGUI(KC_N), LGUI(KC_M), KC_NO,\
TO(LAYER_MAIN), KC_NO, KC_NO, KC_NO, KC_NO,\
\
KC_NO, M_RESETWM,\
KC_NO,\
LGUI(KC_ENTER), LGUI(KC_BSLASH), KC_NO,\
\
\
M_SHUTDOWN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LGUI(KC_P), KC_NO,\
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_NO, LGUI(KC_H), LGUI(KC_J), 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_AUDIO_VOL_UP,\
KC_AUDIO_VOL_DOWN, KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_PINK, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_GREEN, LC_OFF, LC_OFF, LC_CYAN, \
LC_GREEN, LC_GREEN, LC_OFF, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_ORANGE, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_ORANGE, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,53 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(FKEYS)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO,\
KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, 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_NO, KC_NO,\
KC_NO,\
KC_NO, KC_NO, KC_NO,\
\
\
KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, \
KC_NO, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, 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(LAYER_MAIN), \
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
\
KC_NO, KC_NO,\
KC_NO, \
KC_NO, KC_NO, KC_NO \
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,41 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(KEYBOARD)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
RGB_TOG, RGB_HUD, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO,\
TOGGLE_LAYER_COLOR, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, RGB_HUI,\
KC_NO, RGB_VAD, RGB_VAI, KC_NO, KC_NO, KC_NO,\
KC_NO, RGB_SPD, RGB_SPI, KC_NO, KC_NO, KC_NO, RGB_HUD,\
KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD,\
\
KC_NO, KC_NO,\
KC_NO,\
KC_NO, KC_NO, KC_NO,\
\
\
KC_NO, LIGHT_HUD, LIGHT_HUI, KC_NO, KC_NO, KC_NO, LIGHT_TOG,\
KC_NO, LIGHT_SAD, LIGHT_SAI, KC_NO, KC_NO, KC_NO, KC_NO,\
LIGHT_VAD, LIGHT_VAI, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, LIGHT_SPD, LIGHT_SPI, KC_NO, KC_NO, KC_NO, KC_NO,\
LIGHT_MOD, KC_NO, TO(LAYER_MAIN), KC_NO, KC_NO,\
\
KC_NO, RGB_TOG,\
KC_NO,\
RESET, KC_NO, KC_NO\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_INDICATORS
case BETA_LAYER_MAGIC_MACRO:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,9 @@
#include "main.h"
#include "symbols.h"
#include "arrows.h"
#include "desktop.h"
#include "fkeys.h"
#include "keyboard.h"
#include "numpad.h"
#include "russian.h"
#include "symbols_ru.h"

View File

@ -0,0 +1,34 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(MAIN)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, OSL(LAYER_DESKTOP),\
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI,\
KC_DELETE, KC_A, KC_S, KC_D, KC_F, KC_G,\
KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, TO(LAYER_NUMPAD),\
OSL(LAYER_DESKTOP), KC_NO, KC_LALT, KC_LSHIFT, MO(LAYER_ARROWS),\
\
KC_PSCREEN, KC_NO,\
TD(TD_WMLAYOUT),\
KC_SPACE, KC_BSPACE, LCTL(KC_BSPACE),\
\
\
KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, LGUI(KC_TAB),\
KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_NO, KC_LEAD,\
KC_H, KC_J, KC_K, MO(LAYER_SYMBOLS), KC_L, KC_NO,\
KC_NO, KC_N, KC_M, KC_P, KC_DOT, KC_COMMA, TT(LAYER_FKEYS),\
KC_RIGHT, KC_NO, TO(LAYER_KEYBOARD), TO(LAYER_RUSSIAN), LGUI(KC_SPACE),\
\
KC_NO, KC_NO,\
KC_NO,\
KC_NO, KC_RSHIFT, KC_ENTER\
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,62 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(NUMPAD)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_TRANSPARENT, KC_CIRC, KC_NO, KC_HASH, KC_DLR, KC_PERC, KC_NO,\
KC_TRANSPARENT, KC_NO, KC_7, KC_8, KC_9, KC_ASTR, KC_SLASH,\
KC_TRANSPARENT, KC_PLUS, KC_4, KC_5, KC_6, KC_0,\
KC_TRANSPARENT, KC_MINUS, KC_1, KC_2, KC_3, KC_DOT, TO(LAYER_MAIN),\
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_NO, KC_NO, KC_NO, KC_NO, KC_NO, 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\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_GREEN, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_INDICATORS
case BETA_LAYER_MAGIC_MACRO:
ergodox_right_led_1_on();
//ergodox_right_led_2_on();
//ergodox_right_led_3_on();
break;
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,53 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(RUSSIAN)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_TRANSPARENT, RU_1, RU_2, RU_3, RU_4, RU_5, KC_TRANSPARENT,\
KC_TRANSPARENT, RU_CHE, RU_SHA, RU_IE, RU_ER, RU_TE, RU_YO,\
KC_TRANSPARENT, RU_A, RU_ES, RU_DE, RU_EF, RU_GHE,\
M_RU_CTRL, RU_ZE, RU_YA, RU_TSE, RU_VE, RU_BE, RU_E,\
KC_TRANSPARENT, KC_TRANSPARENT, M_RU_ALT, KC_TRANSPARENT, KC_TRANSPARENT,\
\
KC_TRANSPARENT, KC_TRANSPARENT,\
KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,\
\
\
KC_NO, RU_6, RU_7, RU_8, RU_9, RU_0, KC_TRANSPARENT,\
RU_SOFT, RU_U, RU_YU, RU_I, RU_O, RU_SHCH, KC_NO,\
RU_HA, RU_ZHE, RU_KA, MO(LAYER_SYMBOLS_RU), RU_EL, KC_NO,\
RU_HARD, RU_EN, RU_EM, RU_PE, RU_YERU, RU_SHTI, KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(LAYER_MAIN), KC_TRANSPARENT,\
\
KC_TRANSPARENT, KC_TRANSPARENT,\
KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,110 @@
// Layers are defined in macros,
// so that all supporting code can be
// auto-generated by the preprocessor.
//
// When making a new layer, make sure you update EVERY
// reference to BETA_LAYER() with your layer's name!
// This macro isn't used anywhere else.
// It's here for convenience, so we only have to write
// the layer name in one place.
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(SYMBOLS)
// If BETA_LAYER_NAME is defined, the preprocessor is making
// enums for this layer. See keymap.h.
//
// IMPORTANT:
// Things will break if BETA_LAYER_MAGIC_MACRO is written outside #ifdef/#endif guards.
// If BETA_LAYER_KEYS is defined, the preprocessor is either...
// - making LAYER_* enums (see keymap.h)
// - filling the keymap array (see keymap.c)
//
// Every layer must have this section.
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO,\
KC_NO, KC_GRAVE, KC_LPRN, KC_RPRN, KC_QUES, KC_LCBR, KC_NO,\
KC_NO, KC_TILD, KC_QUOTE, KC_COMMA, KC_DOT, KC_DQUO,\
KC_NO, KC_NO, KC_LBRACKET, KC_RBRACKET, KC_EXLM, KC_RCBR, 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_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_LABK, KC_RABK, KC_SLASH, KC_NO, KC_BSLASH, KC_NO,\
KC_UNDS, KC_MINUS, KC_COLN, KC_TRANSPARENT, KC_PIPE, 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\
)
// This is important.d
// The magic macro MUST be here, AFTER the keymap data.
BETA_LAYER_MAGIC_MACRO
#endif
// If BETA_LAYER_KEYS is defined, the preprocessor is either...
// - making LAYER_*_LEDS enums (see keymap.h)
// - filling the ledmap array (see keymap.c)
// - building the layer color switch statement (see keymap.c)
//
// This section is optional. If it is missing, this layer will not have
// an RGBMatrix color.
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_ORANGE, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_ORANGE, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_GREEN, LC_GREEN, LC_CYAN, LC_OFF, LC_CYAN, \
LC_CYAN, LC_GREEN, LC_PINK, LC_ORANGE, LC_CYAN, \
LC_GREEN, LC_GREEN, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
// This is important.
// The magic macro MUST be here, AFTER the RGBMatrix data.
BETA_LAYER_MAGIC_MACRO
#endif
// If BETA_LAYER_INDICATORS is defined, the preprocessor is
// building the indicator led switch statement (see keymap.c)
//
// This should be a `case` statement that looks exactly like the following example.
//
// This section is optional. If it is missing, this layer will
// not set indicator leds.
/*
#ifdef BETA_LAYER_INDICATORS
case LAYER_MAGIC_MACRO:
ergodox_right_led_1_on();
//ergodox_right_led_2_on();
//ergodox_right_led_3_on();
break;
#endif
*/
// Cleanup.
// This is not optional,
// we MUST undef these here so the next layer
// we load can re-define them.
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -0,0 +1,54 @@
// See symbols.h for docs
#define BETA_LAYER_MAGIC_MACRO BETA_LAYER(SYMBOLS_RU)
#ifdef BETA_LAYER_KEYS
#define BETA_LAYER_CONTEXT_DATA LAYOUT_ergodox(\
KC_NO, RU_EXLM, RU_DQUO, RU_NUM, RU_SCLN, RU_PERC, KC_NO,\
KC_NO, KC_NO, RU_LPRN, RU_RPRN, RU_QUES, KC_NO, KC_NO,\
KC_NO, KC_NO, KC_NO, RU_COMM, RU_DOT, RU_DQUO,\
KC_NO, KC_NO, KC_NO, KC_NO, RU_EXLM, 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, RU_COLN, RU_QUES, RU_ASTR, RU_LPRN, RU_RPRN, KC_NO,\
KC_NO, KC_NO, KC_NO, RU_SLSH, KC_NO, RU_BSLS, KC_NO,\
RU_UNDS, RU_MINS, RU_COLN, KC_TRANSPARENT, KC_NO, KC_NO,\
KC_NO, RU_EQL, RU_PLUS, RU_SCLN, 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\
)
BETA_LAYER_MAGIC_MACRO
#endif
#ifdef BETA_LAYER_LEDS
#define BETA_LAYER_CONTEXT_DATA LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_CYAN, LC_CYAN, LC_PINK, LC_OFF, \
LC_OFF, LC_OFF, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_CYAN, LC_OFF, LC_CYAN, \
LC_CYAN, LC_GREEN, LC_PINK, LC_ORANGE, LC_OFF, \
LC_GREEN, LC_GREEN, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)
BETA_LAYER_MAGIC_MACRO
#endif
#undef BETA_LAYER_CONTEXT_DATA
#undef BETA_LAYER_MAGIC_MACRO

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_DESKTOP LAYOUT_ergodox(\
KC_TRANSPARENT, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), TO(LAYER_MAIN_IDX),\
KC_NO, KC_NO, LGUI(LCTL(KC_ENTER)), KC_NO, KC_NO, LGUI(KC_T), KC_NO,\
KC_NO, LGUI(KC_PLUS), LGUI(KC_MINUS), KC_NO, LGUI(KC_F), LGUI(KC_G),\
KC_NO, KC_NO, KC_NO, LGUI(LSFT(KC_C)), LGUI(KC_N), LGUI(KC_M), KC_NO,\
TO(LAYER_MAIN_IDX), KC_NO, KC_NO, KC_NO, KC_NO,\
\
KC_NO, M_RESETWM,\
KC_NO,\
LGUI(KC_ENTER), LGUI(KC_BSLASH), KC_NO,\
\
\
M_SHUTDOWN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LGUI(KC_P), KC_NO,\
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_NO, LGUI(KC_H), LGUI(KC_J), 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_AUDIO_VOL_UP,\
KC_AUDIO_VOL_DOWN, KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE\
)
#define LAYER_DESKTOP_LEDS LEDS_ergodox(\
LC_PINK, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_GREEN, LC_OFF, LC_OFF, LC_CYAN, \
LC_GREEN, LC_GREEN, LC_OFF, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_ORANGE, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_ORANGE, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_FKEYS LAYOUT_ergodox(\
KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO,\
KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, 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_NO, KC_NO,\
KC_NO,\
KC_NO, KC_NO, KC_NO,\
\
\
KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, \
KC_NO, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, 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(LAYER_MAIN_IDX), \
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
\
KC_NO, KC_NO,\
KC_NO, \
KC_NO, KC_NO, KC_NO \
)
#define LAYER_FKEYS_LEDS LEDS_ergodox(\
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -1,25 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_KEYBOARD LAYOUT_ergodox(\
RGB_TOG, RGB_HUD, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO,\
TOGGLE_LAYER_COLOR, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, RGB_HUI,\
KC_NO, RGB_VAD, RGB_VAI, KC_NO, KC_NO, KC_NO,\
KC_NO, RGB_SPD, RGB_SPI, KC_NO, KC_NO, KC_NO, RGB_HUD,\
KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD,\
\
KC_NO, KC_NO,\
KC_NO,\
KC_NO, KC_NO, KC_NO,\
\
\
KC_NO, LIGHT_HUD, LIGHT_HUI, KC_NO, KC_NO, KC_NO, LIGHT_TOG,\
KC_NO, LIGHT_SAD, LIGHT_SAI, KC_NO, KC_NO, KC_NO, KC_NO,\
LIGHT_VAD, LIGHT_VAI, KC_NO, KC_NO, KC_NO, KC_NO,\
KC_NO, LIGHT_SPD, LIGHT_SPI, KC_NO, KC_NO, KC_NO, KC_NO,\
LIGHT_MOD, KC_NO, TO(LAYER_MAIN_IDX), KC_NO, KC_NO,\
\
KC_NO, RGB_TOG,\
KC_NO,\
RESET, KC_NO, KC_NO\
)

View File

@ -0,0 +1,99 @@
#include "keymap.h"
#include "layers.h"
// Create keymap array
#define BETA_LAYER_KEYS
#define BETA_LAYER(name) [LAYER_##name] = BETA_LAYER_CONTEXT_DATA,
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#include LAYER_INCLUDE_FILE
};
#undef BETA_LAYER
#undef BETA_LAYER_KEYS
// Create led map array
#define BETA_LAYER_LEDS
#define BETA_LAYER(name) [LAYER_##name##_LEDS] = BETA_LAYER_CONTEXT_DATA,
const uint8_t PROGMEM ledmaps[][DRIVER_LED_TOTAL][3] = {
#include LAYER_INCLUDE_FILE
};
#undef BETA_LAYER
#undef BETA_LAYER_LEDS
void set_layer_color(int layer) {
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
HSV hsv = {
.h = pgm_read_byte(&ledmaps[layer][i][0]),
.s = pgm_read_byte(&ledmaps[layer][i][1]),
.v = pgm_read_byte(&ledmaps[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 (keyboard_config.disable_layer_led) {
return;
}
switch (biton32(layer_state)) {
// Load layer RGBMatrix colors
#define BETA_LAYER_LEDS
#define BETA_LAYER(name)\
case LAYER_##name:\
set_layer_color(LAYER_##name##_LEDS);\
break;
#include LAYER_INCLUDE_FILE
#undef BETA_LAYER
#undef BETA_LAYER_LEDS
default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE) {
rgb_matrix_set_color_all(0, 0, 0);
}
break;
}
}
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) {
// Load indicator LED cases
#define BETA_LAYER_INDICATORS
#define BETA_LAYER(name) LAYER_##name
#include LAYER_INCLUDE_FILE
#undef BETA_LAYER
#undef BETA_LAYER_INDICATORS
default:
break;
}
return state;
};

View File

@ -0,0 +1,36 @@
#define LAYER_INCLUDE_FILE "definitions/layers.inc"
// Generate layer ids
#define BETA_LAYER_KEYS
#define BETA_LAYER(name) LAYER_##name,
enum layer_indices {
#include LAYER_INCLUDE_FILE
X_LAYER_MAX
};
#undef BETA_LAYER
#undef BETA_LAYER_KEYS
// Generate RGBMatrix ids
// We don't use the same id for layers and layer colors
// to save memory. Not every layer has colors!
#define BETA_LAYER_LEDS
#define BETA_LAYER(name) LAYER_##name##_LEDS,
enum led_indices {
#include LAYER_INCLUDE_FILE
X_LAYER_LEDS_MAX
};
#undef BETA_LAYER
#undef BETA_LAYER_LEDS
// We don't need these in the header,
// they shouldn't be used anywhere else.
//const uint16_t PROGMEM keymaps[X_LAYER_MAX][MATRIX_ROWS][MATRIX_COLS];
//const uint8_t PROGMEM ledmaps[X_LAYER_LEDS_MAX][DRIVER_LED_TOTAL][3];
void set_layer_color(int layer);
void rgb_matrix_indicators_user(void);
uint32_t layer_state_set_user(uint32_t state);

View File

@ -1,25 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_MAIN LAYOUT_ergodox(\
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, OSL(LAYER_DESKTOP_IDX),\
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI,\
KC_DELETE, KC_A, KC_S, KC_D, KC_F, KC_G,\
KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, TO(LAYER_NUMPAD_IDX),\
OSL(LAYER_DESKTOP_IDX), KC_NO, KC_LALT, KC_LSHIFT, MO(LAYER_ARROWS_IDX),\
\
KC_PSCREEN, KC_NO,\
TD(TD_WMLAYOUT),\
KC_SPACE, KC_BSPACE, LCTL(KC_BSPACE),\
\
\
KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, LGUI(KC_TAB),\
KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_NO, KC_LEAD,\
KC_H, KC_J, KC_K, MO(LAYER_SYMBOLS_IDX), KC_L, KC_NO,\
KC_NO, KC_N, KC_M, KC_P, KC_DOT, KC_COMMA, TT(LAYER_FKEYS_IDX),\
KC_RIGHT, KC_NO, TO(LAYER_KEYBOARD_IDX), TO(LAYER_RUSSIAN_IDX), LGUI(KC_SPACE),\
\
KC_NO, KC_NO,\
KC_NO,\
KC_NO, KC_RSHIFT, KC_ENTER\
)

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_NUMPAD LAYOUT_ergodox(\
KC_TRANSPARENT, KC_CIRC, KC_NO, KC_HASH, KC_DLR, KC_PERC, KC_NO,\
KC_TRANSPARENT, KC_NO, KC_7, KC_8, KC_9, KC_ASTR, KC_SLASH,\
KC_TRANSPARENT, KC_PLUS, KC_4, KC_5, KC_6, KC_0,\
KC_TRANSPARENT, KC_MINUS, KC_1, KC_2, KC_3, KC_DOT, TO(LAYER_MAIN_IDX),\
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_NO, KC_NO, KC_NO, KC_NO, KC_NO, 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\
)
#define LAYER_NUMPAD_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_GREEN, \
LC_YELLOW, LC_GREEN, LC_GREEN, LC_GREEN, LC_YELLOW, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_RUSSIAN LAYOUT_ergodox(\
KC_TRANSPARENT, RU_1, RU_2, RU_3, RU_4, RU_5, KC_TRANSPARENT,\
KC_TRANSPARENT, RU_CHE, RU_SHA, RU_IE, RU_ER, RU_TE, RU_YO,\
KC_TRANSPARENT, RU_A, RU_ES, RU_DE, RU_EF, RU_GHE,\
M_RU_CTRL, RU_ZE, RU_YA, RU_TSE, RU_VE, RU_BE, RU_E,\
KC_TRANSPARENT, KC_TRANSPARENT, M_RU_ALT, KC_TRANSPARENT, KC_TRANSPARENT,\
\
KC_TRANSPARENT, KC_TRANSPARENT,\
KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,\
\
\
KC_NO, RU_6, RU_7, RU_8, RU_9, RU_0, KC_TRANSPARENT,\
RU_SOFT, RU_U, RU_YU, RU_I, RU_O, RU_SHCH, KC_NO,\
RU_HA, RU_ZHE, RU_KA, MO(LAYER_SYMBOLS_RU_IDX), RU_EL, KC_NO,\
RU_HARD, RU_EN, RU_EM, RU_PE, RU_YERU, RU_SHTI, KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TO(LAYER_MAIN_IDX), KC_TRANSPARENT,\
\
KC_TRANSPARENT, KC_TRANSPARENT,\
KC_TRANSPARENT,\
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT\
)
#define LAYER_RUSSIAN_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, LC_RU_B, \
LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, LC_RU_G, \
LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, LC_RU_K, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_SYMBOLS LAYOUT_ergodox(\
KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO,\
KC_NO, KC_GRAVE, KC_LPRN, KC_RPRN, KC_QUES, KC_LCBR, KC_NO,\
KC_NO, KC_TILD, KC_QUOTE, KC_COMMA, KC_DOT, KC_DQUO,\
KC_NO, KC_NO, KC_LBRACKET, KC_RBRACKET, KC_EXLM, KC_RCBR, 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_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_NO,\
KC_NO, KC_LABK, KC_RABK, KC_SLASH, KC_NO, KC_BSLASH, KC_NO,\
KC_UNDS, KC_MINUS, KC_COLN, KC_TRANSPARENT, KC_PIPE, 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\
)
#define LAYER_SYMBOLS_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_ORANGE, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_ORANGE, LC_PINK, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_CYAN, LC_CYAN, LC_PINK, LC_CYAN, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_GREEN, LC_GREEN, LC_CYAN, LC_OFF, LC_CYAN, \
LC_CYAN, LC_GREEN, LC_PINK, LC_ORANGE, LC_CYAN, \
LC_GREEN, LC_GREEN, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -1,39 +0,0 @@
#pragma once
#include "keymap.h"
#define LAYER_SYMBOLS_RU LAYOUT_ergodox(\
KC_NO, RU_EXLM, RU_DQUO, RU_NUM, RU_SCLN, RU_PERC, KC_NO,\
KC_NO, KC_NO, RU_LPRN, RU_RPRN, RU_QUES, KC_NO, KC_NO,\
KC_NO, KC_NO, KC_NO, RU_COMM, RU_DOT, RU_DQUO,\
KC_NO, KC_NO, KC_NO, KC_NO, RU_EXLM, 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, RU_COLN, RU_QUES, RU_ASTR, RU_LPRN, RU_RPRN, KC_NO,\
KC_NO, KC_NO, KC_NO, RU_SLSH, KC_NO, RU_BSLS, KC_NO,\
RU_UNDS, RU_MINS, RU_COLN, KC_TRANSPARENT, KC_NO, KC_NO,\
KC_NO, RU_EQL, RU_PLUS, RU_SCLN, 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\
)
#define LAYER_SYMBOLS_RU_LEDS LEDS_ergodox(\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_CYAN, LC_CYAN, LC_PINK, LC_OFF, \
LC_OFF, LC_OFF, LC_PINK, LC_PINK, LC_PINK, \
LC_OFF, LC_OFF, LC_OFF, LC_PINK, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
\
LC_OFF, LC_OFF, LC_OFF, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_CYAN, LC_OFF, LC_CYAN, \
LC_CYAN, LC_GREEN, LC_PINK, LC_ORANGE, LC_OFF, \
LC_GREEN, LC_GREEN, LC_PINK, LC_OFF, LC_OFF, \
LC_OFF, LC_OFF, LC_OFF, LC_OFF \
)

View File

@ -5,4 +5,5 @@ TAP_DANCE_ENABLE = yes
SRC += \
tapdance/wmlayout.c \
tapdance/tapdance.c
tapdance/tapdance.c \
layers/layers.c

View File

@ -19,3 +19,7 @@ uint8_t dance_step(qk_tap_dance_state_t *state) {
}
return MORE_TAPS;
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_WMLAYOUT] = ACTION_TAP_DANCE_FN_ADVANCED(td_wmlayout_dance, td_wmlayout_finished, td_wmlayout_reset),
};

View File

@ -1,6 +1,9 @@
#pragma once
#include "keymap.h"
enum tap_dance_codes {
TD_WMLAYOUT,
};
enum {
SINGLE_TAP = 1,