diff options
| author | Callum Oakley <hello@callumoakley.net> | 2020-08-17 11:12:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-17 03:12:40 -0700 |
| commit | c72c01afd4ce7c0b3a116034839d1bcc15b1e635 (patch) | |
| tree | da1e56f1dae67f580de8041a0962a0b2c384fe17 | |
| parent | cb87f5fbeb2f77179845f20c9d5179a35dceca41 (diff) | |
| download | qmk_firmware-c72c01afd4ce7c0b3a116034839d1bcc15b1e635.tar.gz qmk_firmware-c72c01afd4ce7c0b3a116034839d1bcc15b1e635.zip | |
[Keymap] Removing #4072 workaround! (#9995)
* move media keys in to move layer; rearragne f keys; use send_string for rev5 compatability
* remove send_string workaround for #4072
| -rw-r--r-- | keyboards/planck/keymaps/callum/keymap.c | 133 |
1 files changed, 43 insertions, 90 deletions
diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index d9fe43f00..50c0122a9 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c | |||
| @@ -46,20 +46,40 @@ | |||
| 46 | #define n8 KC_8 | 46 | #define n8 KC_8 |
| 47 | #define n9 KC_9 | 47 | #define n9 KC_9 |
| 48 | 48 | ||
| 49 | #define ampr KC_AMPR | ||
| 50 | #define astr KC_ASTR | ||
| 51 | #define at KC_AT | ||
| 52 | #define bsls KC_BSLS | ||
| 49 | #define bspc KC_BSPC | 53 | #define bspc KC_BSPC |
| 50 | #define caps KC_CAPS | 54 | #define caps KC_CAPS |
| 55 | #define circ KC_CIRC | ||
| 51 | #define comm KC_COMM | 56 | #define comm KC_COMM |
| 52 | #define dash A(KC_MINS) // en-dash (–); or with shift: em-dash (—) | 57 | #define dash A(KC_MINS) // en-dash (–); or with shift: em-dash (—) |
| 53 | #define scln KC_SCLN | ||
| 54 | #define slsh KC_SLSH | ||
| 55 | #define spc KC_SPC | ||
| 56 | #define tab KC_TAB | ||
| 57 | #define del KC_DEL | 58 | #define del KC_DEL |
| 59 | #define dlr KC_DLR | ||
| 58 | #define dot KC_DOT | 60 | #define dot KC_DOT |
| 59 | #define ent KC_ENT | 61 | #define ent KC_ENT |
| 62 | #define eql KC_EQL | ||
| 63 | #define esc KC_ESC | ||
| 64 | #define exlm KC_EXLM | ||
| 65 | #define grv KC_GRV | ||
| 66 | #define hash KC_HASH | ||
| 67 | #define lbrc KC_LBRC | ||
| 68 | #define lcbr KC_LCBR | ||
| 69 | #define lprn KC_LPRN | ||
| 60 | #define mins KC_MINS | 70 | #define mins KC_MINS |
| 71 | #define perc KC_PERC | ||
| 72 | #define pipe KC_PIPE | ||
| 73 | #define plus KC_PLUS | ||
| 61 | #define quot KC_QUOT | 74 | #define quot KC_QUOT |
| 62 | #define esc KC_ESC | 75 | #define rbrc KC_RBRC |
| 76 | #define rcbr KC_RCBR | ||
| 77 | #define rprn KC_RPRN | ||
| 78 | #define scln KC_SCLN | ||
| 79 | #define slsh KC_SLSH | ||
| 80 | #define spc KC_SPC | ||
| 81 | #define tab KC_TAB | ||
| 82 | #define tild KC_TILD | ||
| 63 | 83 | ||
| 64 | #define down KC_DOWN | 84 | #define down KC_DOWN |
| 65 | #define home G(KC_LEFT) | 85 | #define home G(KC_LEFT) |
| @@ -77,16 +97,14 @@ | |||
| 77 | #define slup S(A(KC_UP)) // Previous unread in Slack | 97 | #define slup S(A(KC_UP)) // Previous unread in Slack |
| 78 | #define sldn S(A(KC_DOWN)) // Next unread in Slack | 98 | #define sldn S(A(KC_DOWN)) // Next unread in Slack |
| 79 | 99 | ||
| 80 | #define ctl1 C(KC_1) | 100 | #define ctl1 C(KC_1) // Desktop 1 (6 with shift) |
| 81 | #define ctl2 C(KC_2) | 101 | #define ctl2 C(KC_2) // Desktop 2 (7 with shift) |
| 82 | #define ctl3 C(KC_3) | 102 | #define ctl3 C(KC_3) // Desktop 3 (8 with shift) |
| 83 | #define ctl4 C(KC_4) | 103 | #define ctl4 C(KC_4) // Desktop 4 (9 with shift) |
| 84 | #define ctl5 C(KC_5) | 104 | #define ctl5 C(KC_5) // Desktop 5 (10 with shift) |
| 85 | #define ctl6 C(KC_6) | 105 | #define ctl6 C(KC_6) // Screenshot |
| 86 | #define ctl7 C(KC_7) | 106 | #define ctl7 C(KC_7) // Brightness up |
| 87 | #define ctl8 C(KC_8) | 107 | #define ctl8 C(KC_8) // Brightness down |
| 88 | #define ctl9 C(KC_9) | ||
| 89 | #define ctl0 C(KC_0) | ||
| 90 | 108 | ||
| 91 | #define f1 KC_F1 | 109 | #define f1 KC_F1 |
| 92 | #define f2 KC_F2 | 110 | #define f2 KC_F2 |
| @@ -136,30 +154,8 @@ enum planck_layers { | |||
| 136 | }; | 154 | }; |
| 137 | 155 | ||
| 138 | enum planck_keycodes { | 156 | enum planck_keycodes { |
| 139 | // ASCII | ||
| 140 | ampr = SAFE_RANGE, | ||
| 141 | astr, | ||
| 142 | at, | ||
| 143 | bsls, | ||
| 144 | circ, | ||
| 145 | dlr, | ||
| 146 | eql, | ||
| 147 | exlm, | ||
| 148 | grv, | ||
| 149 | hash, | ||
| 150 | lbrc, | ||
| 151 | lcbr, | ||
| 152 | lprn, | ||
| 153 | perc, | ||
| 154 | pipe, | ||
| 155 | plus, | ||
| 156 | rbrc, | ||
| 157 | rcbr, | ||
| 158 | rprn, | ||
| 159 | tild, | ||
| 160 | |||
| 161 | // Curly quotes | 157 | // Curly quotes |
| 162 | lcqt, | 158 | lcqt = SAFE_RANGE, |
| 163 | rcqt, | 159 | rcqt, |
| 164 | 160 | ||
| 165 | // "Smart" mods | 161 | // "Smart" mods |
| @@ -182,17 +178,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 182 | ), | 178 | ), |
| 183 | 179 | ||
| 184 | [MOVE] = LAYOUT_planck_grid( | 180 | [MOVE] = LAYOUT_planck_grid( |
| 185 | esc, ctl1, ctl2, ctl3, ctl4, xxxx, xxxx, home, up, end, ctl7, caps, | 181 | esc, ctl1, ctl2, ctl3, ctl4, ctl5, ctl6, home, up, end, xxxx, xxxx, |
| 186 | del, ctl5, slup, tabl, tabr, xxxx, xxxx, left, down, rght, ctl8, xxxx, | 182 | del, play, volu, tabl, tabr, slup, ctl7, left, down, rght, caps, xxxx, |
| 187 | ____, ctl6, sldn, back, fwd, xxxx, xxxx, pgdn, pgup, ctl0, ctl9, ____, | 183 | ____, mute, vold, back, fwd, sldn, ctl8, pgdn, pgup, xxxx, xxxx, ____, |
| 188 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ | 184 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ |
| 189 | ), | 185 | ), |
| 190 | 186 | ||
| 191 | [FUNC] = LAYOUT_planck_grid( | 187 | [FUNC] = LAYOUT_planck_grid( |
| 192 | rset, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, volu, | 188 | rset, f7, f5, f3, f1, f9, f8, f10, f2, f4, f6, xxxx, |
| 193 | powr, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, vold, | 189 | xxxx, f17, f15, f13, f11, f19, f18, f20, f12, f14, f16, xxxx, |
| 194 | ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, ____, | 190 | ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, ____, |
| 195 | ____, ____, ____, ____, prev, mute, play, next, ____, ____, ____, ____ | 191 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ |
| 196 | ), | 192 | ), |
| 197 | }; | 193 | }; |
| 198 | 194 | ||
| @@ -205,13 +201,13 @@ bool send_string_if_keydown( | |||
| 205 | uint8_t shifts = get_mods() & MOD_MASK_SHIFT; | 201 | uint8_t shifts = get_mods() & MOD_MASK_SHIFT; |
| 206 | if (shifts) { | 202 | if (shifts) { |
| 207 | del_mods(shifts); | 203 | del_mods(shifts); |
| 208 | SEND_STRING(shifted); | 204 | send_string(shifted); |
| 209 | add_mods(shifts); | 205 | add_mods(shifts); |
| 210 | } else { | 206 | } else { |
| 211 | SEND_STRING(unshifted); | 207 | send_string(unshifted); |
| 212 | } | 208 | } |
| 213 | } else { | 209 | } else { |
| 214 | SEND_STRING(unshifted); | 210 | send_string(unshifted); |
| 215 | } | 211 | } |
| 216 | } | 212 | } |
| 217 | return true; | 213 | return true; |
| @@ -241,49 +237,6 @@ bool smart_cmd(keyrecord_t *record) { | |||
| 241 | 237 | ||
| 242 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 238 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 243 | switch (keycode) { | 239 | switch (keycode) { |
| 244 | // Override the defualt auto shifted symbols to use SEND_STRING See | ||
| 245 | // https://github.com/qmk/qmk_firmware/issues/4072 | ||
| 246 | case ampr: | ||
| 247 | return send_string_if_keydown(record, "&", NULL); | ||
| 248 | case astr: | ||
| 249 | return send_string_if_keydown(record, "*", NULL); | ||
| 250 | case at: | ||
| 251 | return send_string_if_keydown(record, "@", NULL); | ||
| 252 | case bsls: | ||
| 253 | return send_string_if_keydown(record, "\\", NULL); | ||
| 254 | case circ: | ||
| 255 | return send_string_if_keydown(record, "^", NULL); | ||
| 256 | case dlr: | ||
| 257 | return send_string_if_keydown(record, "$", NULL); | ||
| 258 | case eql: | ||
| 259 | return send_string_if_keydown(record, "=", NULL); | ||
| 260 | case exlm: | ||
| 261 | return send_string_if_keydown(record, "!", NULL); | ||
| 262 | case grv: | ||
| 263 | return send_string_if_keydown(record, "`", NULL); | ||
| 264 | case hash: | ||
| 265 | return send_string_if_keydown(record, "#", NULL); | ||
| 266 | case lbrc: | ||
| 267 | return send_string_if_keydown(record, "[", NULL); | ||
| 268 | case lcbr: | ||
| 269 | return send_string_if_keydown(record, "{", NULL); | ||
| 270 | case lprn: | ||
| 271 | return send_string_if_keydown(record, "(", NULL); | ||
| 272 | case perc: | ||
| 273 | return send_string_if_keydown(record, "%", NULL); | ||
| 274 | case pipe: | ||
| 275 | return send_string_if_keydown(record, "|", NULL); | ||
| 276 | case plus: | ||
| 277 | return send_string_if_keydown(record, "+", NULL); | ||
| 278 | case rbrc: | ||
| 279 | return send_string_if_keydown(record, "]", NULL); | ||
| 280 | case rcbr: | ||
| 281 | return send_string_if_keydown(record, "}", NULL); | ||
| 282 | case rprn: | ||
| 283 | return send_string_if_keydown(record, ")", NULL); | ||
| 284 | case tild: | ||
| 285 | return send_string_if_keydown(record, "~", NULL); | ||
| 286 | |||
| 287 | // The macOS shortcuts for curly quotes are horrible, so this rebinds | 240 | // The macOS shortcuts for curly quotes are horrible, so this rebinds |
| 288 | // them so that shift toggles single–double instead of left–right, and | 241 | // them so that shift toggles single–double instead of left–right, and |
| 289 | // then both varieties of left quote can share one key, and both | 242 | // then both varieties of left quote can share one key, and both |
