1 #include QMK_KEYBOARD_H
3 #include "action_layer.h"
5 #define BASE 0 // default layer
6 #define SYMB 1 // symbols
7 #define MDIA 2 // media keys
9 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 /* Keymap 0: Basic layer
12 * ,--------------------------------------------------. ,--------------------------------------------------.
13 * | Grv | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = |
14 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
15 * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - |
16 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
17 * | \/LCtrl| A | S | D | F | G |------| |------| H | J | K | L | ; |'/RCtrl |
18 * |--------+------+------+------+------+------| RAlt | | RAlt |------+------+------+------+------+--------|
19 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
20 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
21 * | ~L1 | LCtrl| Left| Right| LAlt | | LAlt | Up | Down | RCtrl| ~L2 |
22 * `----------------------------------' `----------------------------------'
23 * ,-------------. ,-------------.
24 * | Del | Ins | | Esc | App |
25 * ,------|------|------| |------+--------+------.
26 * | | | Home | | PgUp | | |
27 * | Space|Backsp|------| |------| LGui |Enter |
28 * | |ace | End | | PgDn | | |
29 * `--------------------' `----------------------'
31 // If it accepts an argument (i.e, is a function), it doesn't need KC_.
32 // Otherwise, it needs KC_*
33 [BASE] = LAYOUT_ergodox( // layer 0 : default
35 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB),
36 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC,
37 CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G,
38 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_RALT,
39 MO(SYMB), KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT,
42 KC_SPC,KC_BSPC,KC_END,
44 TG(MDIA), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
45 KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
46 KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT),
47 KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,
48 KC_LALT,KC_UP, KC_DOWN,KC_RCTRL, MO(MDIA),
51 KC_PGDN, KC_LGUI, KC_ENT
53 /* Keymap 1: Symbol Layer
55 * ,--------------------------------------------------. ,--------------------------------------------------.
56 * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
57 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
58 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
59 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
60 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
61 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
62 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
63 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
64 * | | | | | | | 0 | 0 | . | = | |
65 * `----------------------------------' `----------------------------------'
66 * ,-------------. ,-------------.
68 * ,------|------|------| |------+------+------.
70 * | | |------| |------| | |
72 * `--------------------' `--------------------'
75 [SYMB] = LAYOUT_ergodox(
77 KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
78 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
79 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
80 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
81 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
84 KC_TRNS,KC_TRNS,KC_TRNS,
86 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
87 KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
88 KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
89 KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
90 KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS,
93 KC_TRNS, KC_TRNS, KC_TRNS
95 /* Keymap 2: Media and mouse keys
97 * ,--------------------------------------------------. ,--------------------------------------------------.
98 * | | | | | | | | | | | | | | | |
99 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
100 * | | | | MsUp | | | | | | | | | | | |
101 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
102 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
103 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
104 * | | | | | | | | | | | | Prev | Next | | |
105 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
106 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
107 * `----------------------------------' `----------------------------------'
108 * ,-------------. ,-------------.
110 * ,------|------|------| |------+------+------.
111 * | | | | | | |Brwser|
112 * | | |------| |------| |Back |
114 * `--------------------' `--------------------'
117 [MDIA] = LAYOUT_ergodox(
118 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
119 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
120 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
121 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
122 KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
125 KC_TRNS, KC_TRNS, KC_TRNS,
127 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
128 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
131 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
134 KC_TRNS, KC_TRNS, KC_WBAK
138 const uint16_t PROGMEM fn_actions[] = {
139 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
142 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
144 // MACRODOWN only works in this function
147 if (record->event.pressed) {
148 register_code(KC_RSFT);
150 unregister_code(KC_RSFT);
157 // Runs just one time when the keyboard initializes.
158 void matrix_init_user(void) {
162 // Runs constantly in the background, in a loop.
163 void matrix_scan_user(void) {
165 uint8_t layer = biton32(layer_state);
167 ergodox_board_led_off();
168 ergodox_right_led_1_off();
169 ergodox_right_led_2_off();
170 ergodox_right_led_3_off();
172 // TODO: Make this relevant to the ErgoDox EZ.
174 ergodox_right_led_1_on();
177 ergodox_right_led_2_on();