diff options
| author | Kevin Hartley <kevin.s.hartley@gmail.com> | 2022-01-12 15:20:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-12 14:20:54 -0800 |
| commit | b79e329ab8e16c5b791591b44e04fd1b40d6bccc (patch) | |
| tree | 4297a29995358a84cf87acd4f2926de56d347e3b | |
| parent | 6d06e7ce84f5e7133bf75764abdb012122468d7c (diff) | |
| download | qmk_firmware-b79e329ab8e16c5b791591b44e04fd1b40d6bccc.tar.gz qmk_firmware-b79e329ab8e16c5b791591b44e04fd1b40d6bccc.zip | |
[Keymap] Planck Keymap: Inkwell (#14311)
Co-authored-by: Ryan <fauxpark@gmail.com>
| -rw-r--r-- | keyboards/planck/keymaps/inkwell/config.h | 50 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/inkwell/keymap.c | 182 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/inkwell/readme.md | 19 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/inkwell/rules.mk | 3 |
4 files changed, 254 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/inkwell/config.h b/keyboards/planck/keymaps/inkwell/config.h new file mode 100644 index 000000000..0396720df --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/config.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* Copyright 2021 Kevin Hartley | ||
| 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(PLANCK_SOUND) | ||
| 21 | // #define STARTUP_SONG SONG(NO_SOUND) | ||
| 22 | |||
| 23 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ | ||
| 24 | SONG(COLEMAK_SOUND), \ | ||
| 25 | SONG(DVORAK_SOUND) \ | ||
| 26 | } | ||
| 27 | #endif | ||
| 28 | |||
| 29 | /* | ||
| 30 | * MIDI options | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* enable basic MIDI features: | ||
| 34 | - MIDI notes can be sent when in Music mode is on | ||
| 35 | */ | ||
| 36 | |||
| 37 | #define MIDI_BASIC | ||
| 38 | |||
| 39 | /* enable advanced MIDI features: | ||
| 40 | - MIDI notes can be added to the keymap | ||
| 41 | - Octave shift and transpose | ||
| 42 | - Virtual sustain, portamento, and modulation wheel | ||
| 43 | - etc. | ||
| 44 | */ | ||
| 45 | //#define MIDI_ADVANCED | ||
| 46 | |||
| 47 | // Most tactile encoders have detents every 4 stages | ||
| 48 | #define ENCODER_RESOLUTION 4 | ||
| 49 | #define MOUSEKEY_WHEEL_TIME_TO_MAX 10 | ||
| 50 | #define MOUSEKEY_MAX_SPEED 12 | ||
diff --git a/keyboards/planck/keymaps/inkwell/keymap.c b/keyboards/planck/keymaps/inkwell/keymap.c new file mode 100644 index 000000000..f5192d0bb --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/keymap.c | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | /* Copyright 2015-2017 Jack Humbert | ||
| 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 | |||
| 21 | enum planck_layers { | ||
| 22 | _QWERTY, | ||
| 23 | _LOWER, | ||
| 24 | _RAISE, | ||
| 25 | _ADJUST | ||
| 26 | }; | ||
| 27 | |||
| 28 | #define LOWER MO(_LOWER) | ||
| 29 | #define RAISE MO(_RAISE) | ||
| 30 | |||
| 31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 32 | |||
| 33 | /* Qwerty | ||
| 34 | * ,-----------------------------------------------------------------------------------. | ||
| 35 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 36 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 37 | * | Esc | A | S | D | F | G | H | J | K | L | ; | " | | ||
| 38 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 39 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 40 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 41 | * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | | ||
| 42 | * `-----------------------------------------------------------------------------------' | ||
| 43 | */ | ||
| 44 | [_QWERTY] = LAYOUT_planck_grid( | ||
| 45 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 46 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
| 47 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, | ||
| 48 | RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 49 | ), | ||
| 50 | |||
| 51 | /* Lower | ||
| 52 | * v-------NUM PAD------v | ||
| 53 | * ,-----------------------------------------------------------------------------------. | ||
| 54 | * | ` | ! | @ | # | * | / | 7 | 8 | 9 | ( | ) | Bksp | | ||
| 55 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 56 | * | Del | $ | % | ^ | + | - | 4 | 5 | 6 | [ | ] | = | | ||
| 57 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 58 | * |Shift | & | ? | : | ~ | . | 1 | 2 | 3 | < | > |Enter | | ||
| 59 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 60 | * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise | 0 | Left | Down | Up |Right | | ||
| 61 | * `-----------------------------------------------------------------------------------' | ||
| 62 | */ | ||
| 63 | [_LOWER] = LAYOUT_planck_grid( | ||
| 64 | KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_ASTR, KC_PSLS, KC_7, KC_8, KC_9, KC_LPRN, KC_RPRN, KC_BSPC, | ||
| 65 | KC_ESC, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, KC_MINS, KC_4, KC_5, KC_6, KC_LBRC, KC_RBRC, KC_PEQL, | ||
| 66 | KC_LSFT, KC_AMPR, KC_QUES, KC_COLN, KC_TILD, KC_DOT, KC_1, KC_2, KC_3, KC_LABK, KC_RABK, KC_ENT, | ||
| 67 | RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 68 | ), | ||
| 69 | |||
| 70 | /* Raise | ||
| 71 | * ,-----------------------------------------------------------------------------------. | ||
| 72 | * |SLEEP | BR- | BR+ | << | PLAY | >> | MUTE | VOL- | VOL+ | ( | ) | Bksp | | ||
| 73 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 74 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | " | \ | [ | ] | = | | ||
| 75 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 76 | * |Shift | F7 | F8 | F9 | F10 | F11 | F12 | ? | : | < | > |Enter | | ||
| 77 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 78 | * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | | ||
| 79 | * `-----------------------------------------------------------------------------------' | ||
| 80 | */ | ||
| 81 | [_RAISE] = LAYOUT_planck_grid( | ||
| 82 | KC_SLEP, KC_BRID, KC_BRIU, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC__VOLDOWN, KC__VOLUP, KC_LPRN, KC_RPRN, KC_BSPC, | ||
| 83 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_DQT, KC_BSLS, KC_LBRC, KC_RBRC, KC_PEQL, | ||
| 84 | KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_QUES, KC_COLN, KC_LABK, KC_RABK, KC_ENT, | ||
| 85 | RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 86 | ), | ||
| 87 | |||
| 88 | /* Adjust (Lower + Raise) | ||
| 89 | * v--------MOUSE CONTROL------v | ||
| 90 | * ,-----------------------------------------------------------------------------------. | ||
| 91 | * |Reset | | | | | | |MSE-1 |MSE-2 |MSE-S0|MSE-S1| Bksp | | ||
| 92 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 93 | * | | CALC | MAIL | MDIA |Debug | | |MSE-L |MSE-D |MSE-U |MSE-R |RGB-TG| | ||
| 94 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 95 | * |Shift | | | | | | | | | | |Enter | | ||
| 96 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 97 | * | ECDR | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right | | ||
| 98 | * `-----------------------------------------------------------------------------------' | ||
| 99 | */ | ||
| 100 | [_ADJUST] = LAYOUT_planck_grid( | ||
| 101 | RESET, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_MS_BTN2, KC_ACL1, KC_ACL2, KC_BSPC , | ||
| 102 | _______, KC_CALC, KC_MAIL, KC_MSEL, DEBUG, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, RGB_TOG, | ||
| 103 | KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, | ||
| 104 | RSFT_T(KC_MPLY), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT | ||
| 105 | ) | ||
| 106 | |||
| 107 | }; | ||
| 108 | |||
| 109 | #ifdef AUDIO_ENABLE | ||
| 110 | float plover_song[][2] = SONG(PLOVER_SOUND); | ||
| 111 | float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
| 112 | #endif | ||
| 113 | |||
| 114 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 115 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 116 | } | ||
| 117 | |||
| 118 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 119 | if (IS_LAYER_ON(_RAISE)) { | ||
| 120 | if (get_mods() & MOD_BIT(KC_RSFT)) { | ||
| 121 | // ZOOM | ||
| 122 | // Store which mods are held | ||
| 123 | uint8_t mod_state = get_mods(); | ||
| 124 | // Ignore all shift keys | ||
| 125 | del_mods(MOD_MASK_SHIFT); | ||
| 126 | if (clockwise) { | ||
| 127 | tap_code16(LGUI(KC_PPLS)); | ||
| 128 | } else { | ||
| 129 | tap_code16(LGUI(KC_PMNS)); | ||
| 130 | } | ||
| 131 | // Add back shift keys | ||
| 132 | set_mods(mod_state); | ||
| 133 | } else if (get_mods() & MOD_BIT(KC_LSFT)) { | ||
| 134 | // SCROLL X | ||
| 135 | uint8_t mod_state = get_mods(); | ||
| 136 | del_mods(MOD_MASK_SHIFT); | ||
| 137 | if (clockwise) { | ||
| 138 | tap_code16(KC_WH_L); | ||
| 139 | } else { | ||
| 140 | tap_code16(KC_WH_R); | ||
| 141 | } | ||
| 142 | set_mods(mod_state); | ||
| 143 | } else { | ||
| 144 | // SCROLL Y | ||
| 145 | if (clockwise) { | ||
| 146 | tap_code(KC_WH_U); | ||
| 147 | } else { | ||
| 148 | tap_code(KC_WH_D); | ||
| 149 | } | ||
| 150 | } | ||
| 151 | } else { | ||
| 152 | if (get_mods() & MOD_BIT(KC_RSFT)) { | ||
| 153 | // ZOOM | ||
| 154 | uint8_t mod_state = get_mods(); | ||
| 155 | del_mods(MOD_MASK_SHIFT); | ||
| 156 | if (clockwise) { | ||
| 157 | tap_code16(LGUI(KC_PPLS)); | ||
| 158 | } else { | ||
| 159 | tap_code16(LGUI(KC_PMNS)); | ||
| 160 | } | ||
| 161 | set_mods(mod_state); | ||
| 162 | } else if (get_mods() & MOD_BIT(KC_LSFT)) { | ||
| 163 | // BRIGHTNESS | ||
| 164 | uint8_t mod_state = get_mods(); | ||
| 165 | del_mods(MOD_MASK_SHIFT); | ||
| 166 | if (clockwise) { | ||
| 167 | tap_code16(KC_PAUSE); | ||
| 168 | } else { | ||
| 169 | tap_code16(KC_SCROLLLOCK); | ||
| 170 | } | ||
| 171 | set_mods(mod_state); | ||
| 172 | } else { | ||
| 173 | // VOLUME | ||
| 174 | if (clockwise) { | ||
| 175 | tap_code(KC__VOLUP); | ||
| 176 | } else { | ||
| 177 | tap_code(KC__VOLDOWN); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | } | ||
| 181 | return true; | ||
| 182 | } | ||
diff --git a/keyboards/planck/keymaps/inkwell/readme.md b/keyboards/planck/keymaps/inkwell/readme.md new file mode 100644 index 000000000..8a158783c --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/readme.md | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | # The Inkwell Planck Layout | ||
| 2 | |||
| 3 | */ | ||
| 4 | Plank keymap with Base, Lower, Raise, and Adjust layers, and 1 encoder. | ||
| 5 | |||
| 6 | Features: | ||
| 7 | - Number Pad | ||
| 8 | - Symbol Pad | ||
| 9 | - Function Pad | ||
| 10 | - Programming utilities: ()[]{}<> | ||
| 11 | - Mouse Control | ||
| 12 | - Encoder: | ||
| 13 | - Volume (default turn) | ||
| 14 | - Brightness (shift+turn) | ||
| 15 | - Scroll Y(RSE+turn) | ||
| 16 | - Scroll X (RSE+shift+turn) | ||
| 17 | - Zoom (push+turn) | ||
| 18 | - Play/Pause (double click) | ||
| 19 | /* | ||
diff --git a/keyboards/planck/keymaps/inkwell/rules.mk b/keyboards/planck/keymaps/inkwell/rules.mk new file mode 100644 index 000000000..afd8d7a8c --- /dev/null +++ b/keyboards/planck/keymaps/inkwell/rules.mk | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | SRC += muse.c | ||
| 2 | ENCODER_ENABLE = yes | ||
| 3 | EXTRAKEY_ENABLE = yes | ||
