1 #include "ergodox_ez.h"
3 #include "action_layer.h"
5 #define BASE 0 // default layer
6 #define SYMB 1 // symbols
7 #define ARRW 2 // arrow keys
8 #define MDIA 3 // media keys, including mouse
10 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11 /* Keymap 0: Basic layer
13 * ,--------------------------------------------------. ,--------------------------------------------------.
14 * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
15 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
16 * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
17 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
18 * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
19 * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
20 * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
21 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
22 * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
23 * `----------------------------------' `----------------------------------'
24 * ,-------------. ,-------------.
25 * | App | LGui | | Alt |Ctrl/Esc|
26 * ,------|------|------| |------+--------+------.
27 * | | | Home | | PgUp | | |
28 * | Space| Bksp |------| |------| Tab |Enter |
29 * | ctrl | gui | Alt | | Alt | gui | ctrl |
30 * `--------------------' `----------------------'
32 // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations
33 // TODO: maybe make almost identical layers but for wintdows and mac
34 // TODO: find a do nothing key, so you aren't tempted by useless keys
35 // TODO: add vi layer for arrow keys and shit on hjkl?
36 // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue
37 // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing
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 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
43 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
44 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G,
45 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
46 LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,LT(ARRW, KC_RGHT),
47 ALT_T(KC_APP), KC_LGUI,
49 CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT,
51 KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
52 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
53 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
54 MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
55 LT(MDIA, KC_UP), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1,
58 KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT)
60 /* Keymap 1: Symbol Layer
62 * ,--------------------------------------------------. ,--------------------------------------------------.
63 * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
64 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
65 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
66 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
67 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
68 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
69 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
70 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
71 * | | | | | | | | . | 0 | = | |
72 * `----------------------------------' `----------------------------------'
73 * ,-------------. ,-------------.
75 * ,------|------|------| |------+------+------.
77 * | | |------| |------| | |
79 * `--------------------' `--------------------'
84 KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
85 KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
86 KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
87 KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
88 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
91 KC_TRNS,KC_TRNS,KC_TRNS,
93 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
94 KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
95 KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
96 KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
97 KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
100 KC_TRNS, KC_TRNS, KC_TRNS
102 /* Keymap 2: Arrow keys
104 * ,--------------------------------------------------. ,--------------------------------------------------.
105 * | | | | | | | | | | | | | | | |
106 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
107 * | | | | | | | | | | | | | | | |
108 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
109 * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | |
110 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
111 * | | | | | | | | | | | | | | | |
112 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
113 * | | | | | | | | | | | |
114 * `----------------------------------' `----------------------------------'
115 * ,-------------. ,-------------.
117 * ,------|------|------| |------+------+------.
119 * | | |------| |------| | |
121 * `--------------------' `--------------------'
126 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
130 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
133 KC_TRNS, KC_TRNS, KC_TRNS,
135 KC_TRNS, 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_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS,
138 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
139 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
142 KC_TRNS, KC_TRNS, KC_TRNS
144 /* Keymap 3: Media and mouse keys
146 * ,--------------------------------------------------. ,--------------------------------------------------.
147 * | | | | | | | | | | | | | | | |
148 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
149 * | | | | MsUp | | | | | | | | | | | |
150 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
151 * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | |
152 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
153 * | | |Mute |VolDn | VolUp| | | | | | | | | | |
154 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
155 * | | | Prev | Play | Next | | | | | | |
156 * `----------------------------------' `----------------------------------'
157 * ,-------------. ,-------------.
159 * ,------|------|------| |------+------+------.
160 * |Brwser| | | | | | |
161 * |Back | |------| |------| | |
163 * `--------------------' `--------------------'
167 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
168 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
169 KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
170 KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS,
171 KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT,
174 KC_WBAK, KC_TRNS, KC_TRNS,
176 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
177 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
178 KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY,
179 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
180 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
183 KC_TRNS, KC_TRNS, KC_TRNS
187 const uint16_t PROGMEM fn_actions[] = {
188 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
191 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
193 // MACRODOWN only works in this function
196 if (record->event.pressed) {
197 register_code(KC_RSFT);
199 unregister_code(KC_RSFT);
206 // Runs just one time when the keyboard initializes.
207 void matrix_init_user(void) {
211 // Runs constantly in the background, in a loop.
212 void matrix_scan_user(void) {
214 uint8_t layer = biton32(layer_state);
216 ergodox_board_led_off();
217 ergodox_right_led_1_off();
218 ergodox_right_led_2_off();
219 ergodox_right_led_3_off();
221 // TODO: Make this relevant to the ErgoDox EZ.
223 ergodox_right_led_1_on();
226 ergodox_right_led_2_on();