3 #include "action_layer.h"
6 #define BASE 0 // default layer
7 #define SYMB 1 // symbols
8 #define MDIA 2 // media keys
11 #define CTL_SFT_T 100 // open type
12 #define CTL_SFT_G 101 // find references
13 #define CTL_ALT_H 102 // open call hierarchy
14 #define CTL_SFT_R 103 // open resource
16 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap 0: Basic layer
19 * ,--------------------------------------------------. ,--------------------------------------------------.
20 * | = | 1 | 2 | 3 | 4 | 5 | ESC | |M100/3| 6 | 7 | 8 | 9 | 0 | - |
21 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
22 * |TAB /Alt| Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P |\ / ALT |
23 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
24 * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / CTL |
25 * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------|
26 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
27 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
28 * | WIN | ` | M 102| M 101|AltShf| |AltShf| Left | Down | Up | Right |
29 * `----------------------------------' `----------------------------------'
30 * ,-------------. ,-------------.
31 * | App | LALT | | Alt | CAPS |
32 * ,------|------|------| |------+--------+------.
33 * | | | Home | | PgUp | | |
34 * | Space|Backsp|------| |------| Delete |Enter |
35 * | |ace | End | | PgDn | | |
36 * `--------------------' `----------------------'
38 // If it accepts an argument (i.e, is a function), it doesn't need KC_.
39 // Otherwise, it needs KC_*
40 [BASE] = KEYMAP( // layer 0 : default
42 LT(MDIA, KC_EQL),KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
43 ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO),
44 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G,
45 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB),
46 KC_LGUI, KC_GRV, M(CTL_ALT_H),M(CTL_SFT_G),LALT(KC_LSFT),
47 CTL_T(KC_APP), KC_LALT,
49 KC_SPC,KC_BSPC,KC_END,
52 M(CTL_SFT_R)),KC_6, KC_7, KC_8, KC_9, KC_0, LT(MDIA, KC_MINS),
53 MEH_T(KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
54 KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), CTL_T(KC_QUOT),
55 MO(SYMB), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,
56 LALT(KC_LSFT),KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT,
59 KC_PGDN,KC_DEL, KC_ENT
61 /* Keymap 1: Symbol Layer
63 * ,--------------------------------------------------. ,--------------------------------------------------.
64 * |Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | CALC |
65 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
66 * | | ! | @ | { | } | | | | | | | | | | | |
67 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
68 * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | |
69 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
70 * | | % | ^ | [ | ] | ~ | | | | | | | | | |
71 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
72 * | | | | | | | | | | | |
73 * `----------------------------------' `----------------------------------'
74 * ,-------------. ,-------------.
76 * ,------|------|------| |------+------+------.
78 * | | |------| |------| | |
80 * `--------------------' `--------------------'
85 M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
86 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
87 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
88 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
89 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
92 KC_TRNS,KC_TRNS,KC_TRNS,
94 KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_CALC,
95 KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
96 KC_LEFT, KC_DOWN,KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS,
97 KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
98 KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
101 KC_TRNS, KC_TRNS, KC_TRNS
103 /* Keymap 2: Media and mouse keys
105 * ,--------------------------------------------------. ,--------------------------------------------------.
106 * | | | | | | |RESET | |RESET | | | | | | |
107 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
108 * | | | | MsUp | | | | | | | | | | | |
109 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
110 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
111 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
112 * | | | | | | | | | | | | Prev | Next | | |
113 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
114 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
115 * `----------------------------------' `----------------------------------'
116 * ,-------------. ,-------------.
118 * ,------|------|------| |------+------+------.
119 * | | | | | | |Brwser|
120 * | | |------| |------| |Back |
122 * `--------------------' `--------------------'
126 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
127 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
128 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
133 KC_TRNS, KC_TRNS, KC_TRNS,
135 RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
136 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
137 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
138 KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
139 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
142 KC_TRNS, KC_TRNS, KC_WBAK
146 const uint16_t PROGMEM fn_actions[] = {
147 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
150 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
152 // MACRODOWN only works in this function
155 if (record->event.pressed) {
156 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
160 if (record->event.pressed) {
161 return MACRO(D(LCTL), D(LSFT), T(T), END);
163 return MACRO(U(LCTL), U(LSFT), END);
166 if (record->event.pressed) {
167 return MACRO(D(LCTL), D(LSFT), T(G), END);
169 return MACRO(U(LCTL), U(LSFT), END);
172 if (record->event.pressed) {
173 return MACRO(D(LCTL), D(LALT), T(H), END);
175 return MACRO(U(LCTL), U(LALT), END);
178 if (record->event.pressed) {
179 return MACRO(D(LCTL), D(LSFT), T(R), END);
181 return MACRO(U(LCTL), U(LSFT), END);
187 // Runs just one time when the keyboard initializes.
188 void matrix_init_user(void) {
192 // Runs constantly in the background, in a loop.
193 void matrix_scan_user(void) {
195 uint8_t layer = biton32(layer_state);
197 ergodox_board_led_off();
198 ergodox_right_led_1_off();
199 ergodox_right_led_2_off();
200 ergodox_right_led_3_off();
202 // TODO: Make this relevant to the ErgoDox EZ.
204 ergodox_right_led_1_on();
207 ergodox_right_led_2_on();