diff options
| author | Sean Johnson <sean@skj.dev> | 2021-05-08 22:00:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-08 20:00:11 -0700 |
| commit | df57590ec64f1fc6d3c4163ba60be96305339113 (patch) | |
| tree | bf3c4f5de7167f2e348afef46fdf4cdb05d3f702 /keyboards/planck | |
| parent | b7fe24923e29218b15233163d9fe0ac5f332d3fc (diff) | |
| download | qmk_firmware-df57590ec64f1fc6d3c4163ba60be96305339113.tar.gz qmk_firmware-df57590ec64f1fc6d3c4163ba60be96305339113.zip | |
add ttys0's planck and preonic keymaps (#10560)
* resynced with upstream, and adjusted keymap layout for planck
* updated keyboard layout
Signed-off-by: Sean Johnson <sean@ttys0.net>
* swapped out bspc for del on symb layer
Signed-off-by: Sean Johnson <sean@ttys0.net>
* fixed typo with brightness media keys
* turns out my brightness config was correct, it was macOS that had gone sideways
* updated to bring in line with requirements for merging into upstream
* removed redundant config from rules.mk
moved media controls to FUNC layer for Planck layout
* added GPL2+ compatible license header
Signed-off-by: Sean Johnson <sean@skj.dev>
* removed unused MIDI comment
Signed-off-by: Sean Johnson <sean@skj.dev>
* removed extraneous MIDI comments
* removed extraneous comments
Diffstat (limited to 'keyboards/planck')
| -rw-r--r-- | keyboards/planck/keymaps/ttys0/config.h | 24 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/ttys0/keymap.c | 280 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/ttys0/readme.md | 5 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/ttys0/rules.mk | 4 |
4 files changed, 313 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/ttys0/config.h b/keyboards/planck/keymaps/ttys0/config.h new file mode 100644 index 000000000..2c7d3aeec --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/config.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* Copyright 2021 Sean Johnson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #ifdef AUDIO_ENABLE | ||
| 20 | #define STARTUP_SONG SONG(COLEMAK_SOUND) | ||
| 21 | #endif | ||
| 22 | |||
| 23 | // Most tactile encoders have detents every 4 stages | ||
| 24 | #define ENCODER_RESOLUTION 4 | ||
diff --git a/keyboards/planck/keymaps/ttys0/keymap.c b/keyboards/planck/keymaps/ttys0/keymap.c new file mode 100644 index 000000000..ed392bfb9 --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/keymap.c | |||
| @@ -0,0 +1,280 @@ | |||
| 1 | /* Copyright 2021 Sean Johnson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | #include "muse.h" | ||
| 19 | |||
| 20 | #define a KC_A | ||
| 21 | #define b KC_B | ||
| 22 | #define c KC_C | ||
| 23 | #define d KC_D | ||
| 24 | #define e KC_E | ||
| 25 | #define f KC_F | ||
| 26 | #define g KC_G | ||
| 27 | #define h KC_H | ||
| 28 | #define i KC_I | ||
| 29 | #define j KC_J | ||
| 30 | #define k KC_K | ||
| 31 | #define l KC_L | ||
| 32 | #define m KC_M | ||
| 33 | #define n KC_N | ||
| 34 | #define o KC_O | ||
| 35 | #define p KC_P | ||
| 36 | #define q KC_Q | ||
| 37 | #define r KC_R | ||
| 38 | #define s KC_S | ||
| 39 | #define t KC_T | ||
| 40 | #define u KC_U | ||
| 41 | #define v KC_V | ||
| 42 | #define w KC_W | ||
| 43 | #define x KC_X | ||
| 44 | #define y KC_Y | ||
| 45 | #define z KC_Z | ||
| 46 | |||
| 47 | #define lopt KC_LALT | ||
| 48 | #define lctl KC_LCTL | ||
| 49 | #define lsft KC_LSFT | ||
| 50 | #define ropt KC_RALT | ||
| 51 | #define rctl KC_RCTL | ||
| 52 | #define rsft KC_RSFT | ||
| 53 | |||
| 54 | #define n0 KC_0 | ||
| 55 | #define n1 KC_1 | ||
| 56 | #define n2 KC_2 | ||
| 57 | #define n3 KC_3 | ||
| 58 | #define n4 KC_4 | ||
| 59 | #define n5 KC_5 | ||
| 60 | #define n6 KC_6 | ||
| 61 | #define n7 KC_7 | ||
| 62 | #define n8 KC_8 | ||
| 63 | #define n9 KC_9 | ||
| 64 | |||
| 65 | #define bspc KC_BSPC | ||
| 66 | #define caps KC_CAPS | ||
| 67 | #define comm KC_COMM | ||
| 68 | #define dash A(KC_MINS) | ||
| 69 | #define scln KC_SCLN | ||
| 70 | #define slsh KC_SLSH | ||
| 71 | #define spc KC_SPC | ||
| 72 | #define tab KC_TAB | ||
| 73 | #define del KC_DEL | ||
| 74 | #define dot KC_DOT | ||
| 75 | #define ent KC_ENT | ||
| 76 | #define mins KC_MINS | ||
| 77 | #define quot KC_QUOT | ||
| 78 | #define esc KC_ESC | ||
| 79 | #define escg KC_GESC | ||
| 80 | |||
| 81 | #define down KC_DOWN | ||
| 82 | #define home G(KC_LEFT) | ||
| 83 | #define end G(KC_RGHT) | ||
| 84 | #define up KC_UP | ||
| 85 | #define pgdn KC_PGDN | ||
| 86 | #define pgup KC_PGUP | ||
| 87 | #define left KC_LEFT | ||
| 88 | #define rght KC_RGHT | ||
| 89 | |||
| 90 | #define tabl G(S(KC_LBRC)) | ||
| 91 | #define tabr G(S(KC_RBRC)) | ||
| 92 | #define fwd G(KC_RBRC) | ||
| 93 | #define back G(KC_LBRC) | ||
| 94 | #define dtl C(KC_LEFT) | ||
| 95 | #define dtr C(KC_RGHT) | ||
| 96 | #define slup S(A(KC_UP)) | ||
| 97 | #define sldn S(A(KC_DOWN)) | ||
| 98 | |||
| 99 | #define f1 KC_F1 | ||
| 100 | #define f2 KC_F2 | ||
| 101 | #define f3 KC_F3 | ||
| 102 | #define f4 KC_F4 | ||
| 103 | #define f5 KC_F5 | ||
| 104 | #define f6 KC_F6 | ||
| 105 | #define f7 KC_F7 | ||
| 106 | #define f8 KC_F8 | ||
| 107 | #define f9 KC_F9 | ||
| 108 | #define f10 KC_F10 | ||
| 109 | #define f11 KC_F11 | ||
| 110 | #define f12 KC_F12 | ||
| 111 | #define f13 KC_F13 | ||
| 112 | #define f14 KC_F14 | ||
| 113 | #define f15 KC_F15 | ||
| 114 | #define f16 KC_F16 | ||
| 115 | #define f17 KC_F17 | ||
| 116 | #define f18 KC_F18 | ||
| 117 | #define f19 KC_F19 | ||
| 118 | #define f20 KC_F20 | ||
| 119 | |||
| 120 | #define mute KC_MUTE | ||
| 121 | #define next KC_MNXT | ||
| 122 | #define play KC_MPLY | ||
| 123 | #define prev KC_MPRV | ||
| 124 | #define vold KC_VOLD | ||
| 125 | #define volu KC_VOLU | ||
| 126 | |||
| 127 | #define symb MO(SYMB) | ||
| 128 | #define move MO(MOVE) | ||
| 129 | #define func MO(FUNC) | ||
| 130 | |||
| 131 | #define rset RESET | ||
| 132 | #define powr KC_POWER | ||
| 133 | |||
| 134 | #define ____ KC_TRNS | ||
| 135 | #define xxxx KC_NO | ||
| 136 | |||
| 137 | #define emji LCMD(LCTL(KC_SPC)) | ||
| 138 | #define hypr OSM(MOD_HYPR) | ||
| 139 | #define brup KC_BRMU | ||
| 140 | #define brdn KC_BRMD | ||
| 141 | #define escf LT(FUNC,KC_ESC) | ||
| 142 | |||
| 143 | enum planck_layers { | ||
| 144 | BASE, | ||
| 145 | SYMB, | ||
| 146 | MOVE, | ||
| 147 | FUNC, | ||
| 148 | }; | ||
| 149 | |||
| 150 | enum planck_keycodes { | ||
| 151 | ampr = SAFE_RANGE, | ||
| 152 | astr, | ||
| 153 | at, | ||
| 154 | bsls, | ||
| 155 | circ, | ||
| 156 | dlr, | ||
| 157 | eql, | ||
| 158 | exlm, | ||
| 159 | grv, | ||
| 160 | hash, | ||
| 161 | lbrc, | ||
| 162 | lcbr, | ||
| 163 | lprn, | ||
| 164 | perc, | ||
| 165 | pipe, | ||
| 166 | plus, | ||
| 167 | rbrc, | ||
| 168 | rcbr, | ||
| 169 | rprn, | ||
| 170 | tild, | ||
| 171 | cmd, | ||
| 172 | }; | ||
| 173 | |||
| 174 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 175 | [BASE] = LAYOUT_planck_grid( | ||
| 176 | tab, q, w, f, p, g, j, l, u, y, scln, mins, | ||
| 177 | bspc, a, r, s, t, d, h, n, e, i, o, quot, | ||
| 178 | lsft, z, x, c, v, b, k, m, comm, dot, slsh, rsft, | ||
| 179 | hypr, lctl, lopt, cmd, move, ent, spc, symb, cmd, ropt, rctl, func | ||
| 180 | ), | ||
| 181 | |||
| 182 | [SYMB] = LAYOUT_planck_grid( | ||
| 183 | esc, n7, n5, n3, n1, n9, n8, n0, n2, n4, n6, dash, | ||
| 184 | bspc, lbrc, lcbr, lprn, hash, pipe, astr, dlr, rprn, rcbr, rbrc, at, | ||
| 185 | ____, grv, exlm, circ, tild, perc, ampr, plus, mins, eql, bsls, ____, | ||
| 186 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ | ||
| 187 | ), | ||
| 188 | |||
| 189 | [MOVE] = LAYOUT_planck_grid( | ||
| 190 | esc, xxxx, slup, dtl, dtr, xxxx, xxxx, home, up, end, xxxx, ____, | ||
| 191 | del, xxxx, sldn, tabl, tabr, xxxx, xxxx, left, down, rght, xxxx, ____, | ||
| 192 | ____, xxxx, xxxx, back, fwd, xxxx, xxxx, pgdn, pgup, xxxx, xxxx, ____, | ||
| 193 | ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ | ||
| 194 | ), | ||
| 195 | |||
| 196 | [FUNC] = LAYOUT_planck_grid( | ||
| 197 | rset, f7, f5, f3, f1, f9, f8, f10, f2, f4, f6, volu, | ||
| 198 | powr, f17, f15, f13, f11, f19, f18, f20, f12, f14, f16, vold, | ||
| 199 | brup, ____, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, xxxx, mute, | ||
| 200 | brdn, caps, ____, ____, ____, ____, ____, ____, prev, next, play, ____ | ||
| 201 | ), | ||
| 202 | }; | ||
| 203 | |||
| 204 | |||
| 205 | bool send_string_if_keydown(keyrecord_t *record, const char *s) { | ||
| 206 | if (record->event.pressed) { | ||
| 207 | send_string(s); | ||
| 208 | } | ||
| 209 | return true; | ||
| 210 | } | ||
| 211 | |||
| 212 | int cmd_keys_down = 0; | ||
| 213 | |||
| 214 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 215 | switch (keycode) { | ||
| 216 | // Override the default auto shifted symbols to use SEND_STRING See | ||
| 217 | // https://github.com/qmk/qmk_firmware/issues/4072 | ||
| 218 | case ampr: | ||
| 219 | return send_string_if_keydown(record, "&"); | ||
| 220 | case astr: | ||
| 221 | return send_string_if_keydown(record, "*"); | ||
| 222 | case at: | ||
| 223 | return send_string_if_keydown(record, "@"); | ||
| 224 | case bsls: | ||
| 225 | return send_string_if_keydown(record, "\\"); | ||
| 226 | case circ: | ||
| 227 | return send_string_if_keydown(record, "^"); | ||
| 228 | case dlr: | ||
| 229 | return send_string_if_keydown(record, "$"); | ||
| 230 | case eql: | ||
| 231 | return send_string_if_keydown(record, "="); | ||
| 232 | case exlm: | ||
| 233 | return send_string_if_keydown(record, "!"); | ||
| 234 | case grv: | ||
| 235 | return send_string_if_keydown(record, "`"); | ||
| 236 | case hash: | ||
| 237 | return send_string_if_keydown(record, "#"); | ||
| 238 | case lbrc: | ||
| 239 | return send_string_if_keydown(record, "["); | ||
| 240 | case lcbr: | ||
| 241 | return send_string_if_keydown(record, "{"); | ||
| 242 | case lprn: | ||
| 243 | return send_string_if_keydown(record, "("); | ||
| 244 | case perc: | ||
| 245 | return send_string_if_keydown(record, "%"); | ||
| 246 | case pipe: | ||
| 247 | return send_string_if_keydown(record, "|"); | ||
| 248 | case plus: | ||
| 249 | return send_string_if_keydown(record, "+"); | ||
| 250 | case rbrc: | ||
| 251 | return send_string_if_keydown(record, "]"); | ||
| 252 | case rcbr: | ||
| 253 | return send_string_if_keydown(record, "}"); | ||
| 254 | case rprn: | ||
| 255 | return send_string_if_keydown(record, ")"); | ||
| 256 | case tild: | ||
| 257 | return send_string_if_keydown(record, "~"); | ||
| 258 | |||
| 259 | // cmd + cmd -> cmd + ctl | ||
| 260 | case cmd: | ||
| 261 | if (record->event.pressed) { | ||
| 262 | if (cmd_keys_down == 0) { | ||
| 263 | register_code(KC_LCMD); | ||
| 264 | } else { | ||
| 265 | register_code(KC_LCTL); | ||
| 266 | } | ||
| 267 | cmd_keys_down++; | ||
| 268 | } else { | ||
| 269 | if (cmd_keys_down == 1) { | ||
| 270 | unregister_code(KC_LCMD); | ||
| 271 | } else { | ||
| 272 | unregister_code(KC_LCTL); | ||
| 273 | } | ||
| 274 | cmd_keys_down--; | ||
| 275 | } | ||
| 276 | return true; | ||
| 277 | } | ||
| 278 | return true; | ||
| 279 | } | ||
| 280 | |||
diff --git a/keyboards/planck/keymaps/ttys0/readme.md b/keyboards/planck/keymaps/ttys0/readme.md new file mode 100644 index 000000000..9684d1042 --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/readme.md | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # Sean's Planck Config | ||
| 2 | |||
| 3 | This is basically a copy of the `callum` layout with a few minor adjustments to better fit my style. | ||
| 4 | |||
| 5 | [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/7fef3554143712e2317b466c09a73a27) | ||
diff --git a/keyboards/planck/keymaps/ttys0/rules.mk b/keyboards/planck/keymaps/ttys0/rules.mk new file mode 100644 index 000000000..faa09801b --- /dev/null +++ b/keyboards/planck/keymaps/ttys0/rules.mk | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | # Make some noise | ||
| 2 | SRC += muse.c | ||
| 3 | |||
| 4 | |||
