#include QMK_KEYBOARD_H
#include "version.h"
enum layers {
BASE, // default layer
SYMB, // symbols
MDIA, // media keys
};
enum custom_keycodes {
#ifdef ORYX_CONFIGURATOR
VRSN = EZ_SAFE_RANGE,
#else
VRSN = SAFE_RANGE,
#endif
RGB_SLD
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | µ | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | Del |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | Y | | U | I | O | P | [ | ] | BkSp |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | CapsLk | A | S | D | F | G |------| |------| J | K | L | ; | ' | Enter |
* |--------+------+------+------+------+------| B | | H |------+------+------+------+------+--------|
* | LShift |</Ctrl| Z | X | C | V | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | L1 | Home | PgUp | PgDn | End | | Left | Up | Down | Right| L2 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | Alt | | App |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Alt | | AltGr| | |
* | Space|Backsp|------| |------| Tab |Enter |
* | |ace | LGui | | RGui | | |
* `--------------------' `----------------------'
*/
[BASE] = LAYOUT_ergodox_pretty(
KC_BSLS, 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_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_H, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
KC_LSFT, CTL_T(KC_NUBS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_J, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_T(KC_GRV), KC_RSFT,
DF(SYMB), KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,DF(MDIA),
ALT_T(KC_APP), KC_LALT, KC_APP, CTL_T(KC_ESC),
KC_LALT, KC_RALT,
KC_SPC, KC_BSPC, KC_LGUI, KC_RGUI, KC_TAB, KC_ENT
), /*note: KC_GRAVE ? */
/* Keymap 1: Symbol Layer
*
* ,---------------------------------------------------. ,--------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | | ! | @ | { | } | | | | | | = | 7 | 8 | 9 | * | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | # | $ | ( | ) | ` |------| |------| . | 4 | 5 | 6 | + | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | % | ^ | [ | ] | ~ | | | | 0 | 1 | 2 | 3 | / | |
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | L0 | | | | | | | | | | L2 |
* `-----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | Alt | | App |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Alt | | AltGr| | |
* | Space|Backsp|------| |------| Tab |Enter |
* | |ace | LGui | | RGui | | |
* `--------------------' `----------------------'
*/
[SYMB] = LAYOUT_ergodox_pretty(
KC_NO, 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_TRNS,
KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_NO, KC_NO, KC_SLSH, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, KC_TRNS,
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_PDOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_TRNS,
KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_NO, KC_NO, KC_KP_0, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS,
DF(BASE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DF(MDIA),
ALT_T(KC_APP), KC_LALT, KC_APP, CTL_T(KC_ESC),
KC_LALT, KC_RALT,
KC_SPC, KC_BSPC, KC_LGUI, KC_RGUI, KC_TAB, KC_ENT
),
/* Keymap 2: Media and mouse keys
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | MsBt3| MsBt4| MsBt5| | | | Mute | | MsBt3| MsBt4| MsBt5| | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | WhlLf| Lclk | MsUp | Rclk |WhlUp |Bright| | Vol+ |WhlUp | Lclk | MsUp | Rclk |WhlLf | Prev |
* |--------+------+------+------+------+------| + | | |------+------+------+------+------+--------|
* | | WhlRt|MsLeft|MsDown|MsRght|WhlDn |------| |------|WhlDn |MsLeft|MsDown|MsRght|WhlRt | Next |
* |--------+------+------+------+------+------|Bright| | Vol- |------+------+------+------+------+--------|
* | | | | | | | - | | | | | | | | Play |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | L0 | | | | | | | | | | L1 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | App | Alt | | App |Ctrl/Esc|
* ,------|------|------| |------+--------+------.
* | | | Alt | | AltGr| | |
* | Space|Backsp|------| |------| Tab |Enter |
* | |ace | LGui | | RGui | | |
* `--------------------' `----------------------'
*/
[MDIA] = LAYOUT_ergodox_pretty(
KC_NO, KC_NO, KC_BTN3, KC_BTN4, KC_BTN5, KC_NO, KC_NO, KC_MUTE, KC_NO, KC_BTN3, KC_BTN4, KC_BTN5, KC_NO, KC_NO,
KC_NO, KC_WH_L, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_BRIU, KC_VOLU, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_L, KC_MPRV,
KC_NO, KC_WH_R, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_R, KC_MNXT,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BRID, KC_VOLD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPLY,
DF(BASE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DF(SYMB),
ALT_T(KC_APP), KC_LALT, KC_APP, CTL_T(KC_ESC),
KC_LALT, KC_RALT,
KC_SPC, KC_BSPC, KC_LGUI, KC_RGUI, KC_TAB, KC_ENT
),
};
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);
return false;
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
rgblight_mode(1);
return false;
#endif
}
}
return true;
}
// Runs just one time when the keyboard initializes.
void keyboard_post_init_user(void) {
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif
};
// Runs whenever there is a layer state change.
layer_state_t layer_state_set_user(layer_state_t state) {
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
uint8_t layer = get_highest_layer(state);
switch (layer) {
case 0:
#ifdef RGBLIGHT_COLOR_LAYER_0
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0);
#endif
break;
case 1:
ergodox_right_led_1_on();
#ifdef RGBLIGHT_COLOR_LAYER_1
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_1);
#endif
break;
case 2:
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_2
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_2);
#endif
break;
case 3:
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_3
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_3);
#endif
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
#ifdef RGBLIGHT_COLOR_LAYER_4
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_4);
#endif
break;
case 5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_5
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_5);
#endif
break;
case 6:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_6
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6);
#endif
break;
case 7:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
#ifdef RGBLIGHT_COLOR_LAYER_7
rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7);
#endif
break;
default:
break;
}
return state;
};