2 #include "action_layer.h"
52 #define dash A(KC_MINS)
74 #define tabl S(C(KC_TAB))
75 #define tabr C(KC_TAB)
76 #define fwd G(KC_RBRC)
77 #define back G(KC_LBRC)
78 #define dtl C(KC_LEFT)
79 #define dtr C(KC_RGHT)
80 #define slup S(A(KC_UP))
81 #define sldn S(A(KC_DOWN))
111 #define symb MO(SYMB)
112 #define move MO(MOVE)
113 #define func MO(FUNC)
116 #define powr KC_POWER
121 extern keymap_config_t keymap_config;
130 enum planck_keycodes {
155 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
156 [BASE] = LAYOUT_planck_grid(
157 tab, q, w, f, p, g, j, l, u, y, scln, mins,
158 bspc, a, r, s, t, d, h, n, e, i, o, quot,
159 lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft,
160 func, lctl, lalt, cmd, move, ent, spc, symb, cmd, ralt, rctl, func
163 [SYMB] = LAYOUT_planck_grid(
164 esc, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash,
165 del, bsls, hash, astr, eql, pipe, at, rprn, lprn, dlr, ampr, gbp,
166 caps, grv, exlm, lbrc, rbrc, circ, tild, rcbr, lcbr, plus, perc, caps,
167 ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
170 [MOVE] = LAYOUT_planck_grid(
171 esc, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, xxxx,
172 del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, xxxx,
173 ____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____,
174 ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____
177 [FUNC] = LAYOUT_planck_grid(
178 rset, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, volu,
179 powr, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, vold,
180 ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, ____,
181 ____, ____, ____, ____, prev, mute, play, next, ____, ____, ____, ____
185 bool send_string_if_keydown(keyrecord_t *record, const char *s) {
186 if (record->event.pressed) {
192 int cmd_keys_down = 0;
194 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
196 // Override the defualt auto shifted symbols to use SEND_STRING See
197 // https://github.com/qmk/qmk_firmware/issues/4072
199 return send_string_if_keydown(record, "&");
201 return send_string_if_keydown(record, "*");
203 return send_string_if_keydown(record, "@");
205 return send_string_if_keydown(record, "\\");
207 return send_string_if_keydown(record, "^");
209 return send_string_if_keydown(record, "$");
211 return send_string_if_keydown(record, "=");
213 return send_string_if_keydown(record, "!");
215 return send_string_if_keydown(record, "`");
217 return send_string_if_keydown(record, "#");
219 return send_string_if_keydown(record, "[");
221 return send_string_if_keydown(record, "{");
223 return send_string_if_keydown(record, "(");
225 return send_string_if_keydown(record, "%");
227 return send_string_if_keydown(record, "|");
229 return send_string_if_keydown(record, "+");
231 return send_string_if_keydown(record, "]");
233 return send_string_if_keydown(record, "}");
235 return send_string_if_keydown(record, ")");
237 return send_string_if_keydown(record, "~");
239 // cmd + cmd -> cmd + ctl
241 if (record->event.pressed) {
242 if (cmd_keys_down == 0) {
243 register_code(KC_LCMD);
245 register_code(KC_LCTL);
249 if (cmd_keys_down == 1) {
250 unregister_code(KC_LCMD);
252 unregister_code(KC_LCTL);