This commit is contained in:
Tom Willemse 2021-03-25 21:44:46 -07:00
parent cac39771e2
commit c7c0839401

View file

@ -19,7 +19,8 @@ enum custom_keycodes {
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
// clang-format off
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | L4 | | L3 | 6 | 7 | 8 | 9 | 0 | DEL |
@ -40,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | PgDn | | Down | | |
* `--------------------' `----------------------'
*/
[BASE] = LAYOUT_ergodox_pretty(
[BASE] = LAYOUT_ergodox_pretty(
// left hand
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, TG(GAME), TG(UPPER), KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_APP, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS,
@ -50,8 +51,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_HOME, KC_END, KC_LEFT, KC_RIGHT,
KC_PGUP, KC_UP,
KC_SPC, KC_LGUI, KC_PGDN, KC_DOWN, KC_RGUI, KC_ENT
),
/* Keymap 1: Symbol and numbers layer
),
/* Keymap 1: Symbol and numbers layer
*
* ,---------------------------------------------------. ,--------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 |
@ -72,7 +73,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `--------------------'
*/
[SYMNUM] = LAYOUT_ergodox_pretty(
[SYMNUM] = LAYOUT_ergodox_pretty(
// left hand
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
KC_TRNS, KC_MINUS, KC_EQUAL, S(KC_LBRACKET), S(KC_RBRACKET), KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_7), S(KC_8), S(KC_9), KC_TRNS, KC_TRNS,
@ -82,8 +83,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Movement mouse keys
),
/* Keymap 2: Movement mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | | | | | |
@ -104,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `--------------------'
*/
[MOVEMENT] = LAYOUT_ergodox_pretty(
[MOVEMENT] = LAYOUT_ergodox_pretty(
// left hand
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_MS_BTN1, KC_MS_U, KC_MS_BTN2, KC_MS_WH_UP, KC_TRNS, KC_TRNS, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS,
@ -115,8 +116,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK
),
/* Keymap 3: UPPER layer
),
/* Keymap 3: UPPER layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | L0 | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
@ -137,7 +138,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `----------------------'
*/
[UPPER] = LAYOUT_ergodox_pretty(
[UPPER] = LAYOUT_ergodox_pretty(
// left hand
TO(BASE), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), KC_TRNS, KC_TRNS, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_TRNS,
KC_TRNS, S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), KC_TRNS, KC_TRNS, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), KC_TRNS, KC_TRNS,
@ -147,8 +148,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 4: Game layer
),
/* Keymap 4: Game layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | L4 | | | | | | | | |
@ -169,7 +170,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | |
* `--------------------' `----------------------'
*/
[GAME] = LAYOUT_ergodox_pretty(
[GAME] = LAYOUT_ergodox_pretty(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(GAME), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_R, KC_SCLN, KC_L, KC_I, KC_O, KC_TRNS, KC_TRNS, KC_F, KC_S, KC_K, KC_W, KC_Q, KC_TRNS,
@ -179,20 +180,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
),
// clang-format on
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
case VRSN:
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
return false;
#ifdef RGBLIGHT_ENABLE
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
rgblight_mode(1);
return false;
#endif
#endif
}
}
return true;
@ -215,56 +217,56 @@ layer_state_t layer_state_set_user(layer_state_t state) {
uint8_t layer = get_highest_layer(state);
switch (layer) {
case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif
#endif
break;
case 1:
ergodox_right_led_1_on();
#ifdef RGBLIGHT_COLOR_LAYER_1
#ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif
#endif
break;
case 2:
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_2
#ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif
#endif
break;
case 3:
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_3
#ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif
#endif
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_4
#ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif
#endif
break;
case 5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_5
#ifdef RGBLIGHT_COLOR_LAYER_5
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
#endif
#endif
break;
case 6:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_6
#ifdef RGBLIGHT_COLOR_LAYER_6
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
#endif
#endif
break;
case 7:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_7
#ifdef RGBLIGHT_COLOR_LAYER_7
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
#endif
#endif
break;
default:
break;