diff options
| author | Jordan Egstad <jordanegstad@gmail.com> | 2020-11-09 11:54:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 11:54:15 -0800 |
| commit | 84ca67f1583ec1cc3689bd92a602bd8fdc6ad2a6 (patch) | |
| tree | 13b5a625c65e8ecb6b48b9207adf23186e261e12 /keyboards/idobo | |
| parent | cb80b59e9343c014389d56317e93f4de71d07a9a (diff) | |
| download | qmk_firmware-84ca67f1583ec1cc3689bd92a602bd8fdc6ad2a6.tar.gz qmk_firmware-84ca67f1583ec1cc3689bd92a602bd8fdc6ad2a6.zip | |
[Keymap] idobo:egstad (#10783)
* feat: new keymapping for idobo
* fix: added licenses. converted int to uint8_t where applicable
* fix: addressed zvecr stylistic enhancements
* fix: replaced rgblight_sethsv with rgblight_sethsv_noeeprom
Diffstat (limited to 'keyboards/idobo')
| -rw-r--r-- | keyboards/idobo/keymaps/egstad/config.h | 68 | ||||
| -rw-r--r-- | keyboards/idobo/keymaps/egstad/keymap.c | 267 | ||||
| -rw-r--r-- | keyboards/idobo/keymaps/egstad/readme.md | 17 | ||||
| -rw-r--r-- | keyboards/idobo/keymaps/egstad/rules.mk | 3 |
4 files changed, 355 insertions, 0 deletions
diff --git a/keyboards/idobo/keymaps/egstad/config.h b/keyboards/idobo/keymaps/egstad/config.h new file mode 100644 index 000000000..45dbd3df8 --- /dev/null +++ b/keyboards/idobo/keymaps/egstad/config.h | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | /* Copyright 2020 Jordan Egstad | ||
| 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 | #define TAPPING_TERM 200 | ||
| 19 | #define IGNORE_MOD_TAP_INTERRUPT | ||
| 20 | #define RGBLIGHT_SLEEP | ||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | /* Leader Key | ||
| 25 | ========================================================================== */ | ||
| 26 | |||
| 27 | // Activates the leader key | ||
| 28 | // #define LEADER_PER_KEY_TIMING | ||
| 29 | // resets the timeout after each key is tapped | ||
| 30 | // #define LEADER_TIMEOUT 240 | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | /* Autoshifting | ||
| 38 | ========================================================================== */ | ||
| 39 | |||
| 40 | // This controls how long you have to hold a key before you get the shifted state. | ||
| 41 | #define AUTO_SHIFT_TIMEOUT 150 | ||
| 42 | |||
| 43 | // Do not Auto Shift special keys -_, =+, [{, ]}, ;:, '", ,<, .>, and /? | ||
| 44 | // #define NO_AUTO_SHIFT_SPECIAL | ||
| 45 | |||
| 46 | // Do not Auto Shift numeric keys, zero through nine. | ||
| 47 | #define NO_AUTO_SHIFT_NUMERIC | ||
| 48 | |||
| 49 | // Do not Auto Shift alpha characters, which include A through Z. | ||
| 50 | // #define NO_AUTO_SHIFT_ALPHA | ||
| 51 | |||
| 52 | // Lower the Auto Shift timeout variable (down) | ||
| 53 | // KC_ASDN | ||
| 54 | |||
| 55 | // Raise the Auto Shift timeout variable (up) | ||
| 56 | // KC_ASUP | ||
| 57 | |||
| 58 | // Report your current Auto Shift timeout value | ||
| 59 | // KC_ASRP | ||
| 60 | |||
| 61 | // Turns on the Auto Shift Function | ||
| 62 | // KC_ASON | ||
| 63 | |||
| 64 | // Turns off the Auto Shift Function | ||
| 65 | // KC_ASOFF | ||
| 66 | |||
| 67 | // Toggles the state of the Auto Shift feature | ||
| 68 | // KC_ASTG | ||
diff --git a/keyboards/idobo/keymaps/egstad/keymap.c b/keyboards/idobo/keymaps/egstad/keymap.c new file mode 100644 index 000000000..febbad7c6 --- /dev/null +++ b/keyboards/idobo/keymaps/egstad/keymap.c | |||
| @@ -0,0 +1,267 @@ | |||
| 1 | /* Copyright 2020 Jordan Egstad | ||
| 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 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | /* ========================================================================== | ||
| 25 | LAYERS | ||
| 26 | ========================================================================== */ | ||
| 27 | |||
| 28 | // qwerty | ||
| 29 | #define _QW 0 | ||
| 30 | // functions | ||
| 31 | #define _FN 1 | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | /* ========================================================================== | ||
| 39 | CUSTOM KEYS | ||
| 40 | ========================================================================== */ | ||
| 41 | |||
| 42 | // Tap dances | ||
| 43 | #define TD_ESCP TD(TD_GV_ESC) // Tap for grave, twice for escape | ||
| 44 | #define TD_MINS TD(TD_MIN) // Tap for minus, twice for equal | ||
| 45 | #define TD_BRAC TD(TD_BRC) // Tap for open brace, twice for close | ||
| 46 | |||
| 47 | // Layers | ||
| 48 | #define FN_SPC LT(_FN, KC_SPC) // Tap for space, hold for _FN | ||
| 49 | |||
| 50 | // Modifiers | ||
| 51 | #define LG_ZMIN LGUI(KC_EQUAL) // Command + plus (zoom in) | ||
| 52 | #define LG_ZMOT LGUI(KC_MINUS) // Command + minus (zoom out) | ||
| 53 | #define MT_SHFT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for shift | ||
| 54 | |||
| 55 | // Tap Dances | ||
| 56 | enum { | ||
| 57 | TD_BRC = 0, | ||
| 58 | TD_MIN, | ||
| 59 | TD_GV_ESC, | ||
| 60 | TD_BS | ||
| 61 | }; | ||
| 62 | |||
| 63 | // Tap Dance Definitions | ||
| 64 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 65 | // Tap once for Left Brace, twice for Right Brace | ||
| 66 | [TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC), | ||
| 67 | //Tap once for Minus, twice for Equal | ||
| 68 | [TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_MINUS, KC_EQUAL), | ||
| 69 | // Tap once for Grave, tap twice for Escape | ||
| 70 | [TD_GV_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRAVE, KC_ESCAPE) | ||
| 71 | }; | ||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | /* ========================================================================== | ||
| 79 | KEYMAPS | ||
| 80 | ========================================================================== */ | ||
| 81 | |||
| 82 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 83 | |||
| 84 | /* QWERTY (_QW) | ||
| 85 | * .--------------------------------------------------------------------------------------------------------------------------------------. | ||
| 86 | * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | \| | 6 | 7 | 8 | 9 | 0 | - + | | ||
| 87 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| | ||
| 88 | * | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | [ ] | | ||
| 89 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| | ||
| 90 | * | CAP LK | A | S | D | F | G | | | | H | J | K | L | ; | ' | | ||
| 91 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| | ||
| 92 | * | LSHIFT | Z | X | C | V | B | | | | N | M | , | . | / | RSHIFT | | ||
| 93 | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| | ||
| 94 | * | ZOOM- | ZOOM+ | LALT | FN | CMD | BSPC | | | FN | SPACE | ENTER | LEFT | UP | DOWN | RIGHT | | ||
| 95 | * '--------------------------------------------------------------------------------------------------------------------------------------' | ||
| 96 | */ | ||
| 97 | |||
| 98 | [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ | ||
| 99 | TD_ESCP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_PIPE, KC_6, KC_7, KC_8, KC_9, KC_0, TD_MINS, \ | ||
| 100 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_BRAC, \ | ||
| 101 | _______, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 102 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_SHFT, \ | ||
| 103 | LG_ZMOT, LG_ZMIN, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, _______, RESET, _______, FN_SPC, KC_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ | ||
| 104 | ), | ||
| 105 | |||
| 106 | |||
| 107 | /* FUNCTION (_FN) | ||
| 108 | * .--------------------------------------------------------------------------------------------------------------------------------------. | ||
| 109 | * | F1 | F2 | F3 | F4 | F5 | F6 | | P | | F7 | F8 | F9 | F10 | F11 | F12 | | ||
| 110 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
| 111 | * | | | | | | | RGB HD | RGB HI | | | | | | | | | ||
| 112 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
| 113 | * | A-SFT | | | | | | RGB SD | RGB SI | | | LEFT | UP | DOWN | RIGHT | | | ||
| 114 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
| 115 | * | RGB | | | | | | RGB VD | RGB VI | | | | | | | | | ||
| 116 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
| 117 | * | RESET | | | | | | RGB RMD| RGB MD | | | PLAY | PREV | VOL UP | VOL DN | NEXT | | ||
| 118 | * '--------------------------------------------------------------------------------------------------------------------------------------' | ||
| 119 | */ | ||
| 120 | |||
| 121 | [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ | ||
| 122 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ | ||
| 123 | _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 124 | KC_ASTG, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, _______, \ | ||
| 125 | RGB_TOG, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 126 | RESET, _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, KC_MPLY, KC_MRWD, KC_VOLU, KC_VOLD, KC_MFFD \ | ||
| 127 | ), | ||
| 128 | }; | ||
| 129 | |||
| 130 | |||
| 131 | |||
| 132 | |||
| 133 | |||
| 134 | |||
| 135 | /* ========================================================================== | ||
| 136 | LEDs | ||
| 137 | ========================================================================== */ | ||
| 138 | |||
| 139 | // RGB MODES | ||
| 140 | // 1 = Static | ||
| 141 | // 2-5 = Breathing | ||
| 142 | // 6-8 = Rainbow | ||
| 143 | // 9-14 = Swirl | ||
| 144 | // 15-20 = Snake | ||
| 145 | // 21-24 = Nightrider | ||
| 146 | // 25 = Christmas | ||
| 147 | // 26-30 = Static Gradient | ||
| 148 | |||
| 149 | // Default LED colors | ||
| 150 | uint8_t h = 170; | ||
| 151 | uint8_t s = 255; | ||
| 152 | uint8_t v; | ||
| 153 | |||
| 154 | // default animation | ||
| 155 | uint8_t rgbMode = RGBLIGHT_MODE_STATIC_LIGHT; | ||
| 156 | // boot animation | ||
| 157 | uint8_t rgbBootMode = RGBLIGHT_MODE_SNAKE; | ||
| 158 | // boot timeout vars | ||
| 159 | uint8_t bootComplete = 0; | ||
| 160 | int bootTimeoutDuration = 2000; | ||
| 161 | int bootTimeout; | ||
| 162 | |||
| 163 | |||
| 164 | void init_hsv(void) { | ||
| 165 | // fetch what the brightness was last sesion | ||
| 166 | v = rgblight_get_val(); | ||
| 167 | rgblight_sethsv(h,s,v); | ||
| 168 | } | ||
| 169 | |||
| 170 | // fetch current HSV vals | ||
| 171 | void get_hsv(void) { | ||
| 172 | h = rgblight_get_hue(); | ||
| 173 | s = rgblight_get_sat(); | ||
| 174 | v = rgblight_get_val(); | ||
| 175 | } | ||
| 176 | |||
| 177 | // reset HSV vals | ||
| 178 | void reset_hsv(void) { | ||
| 179 | int currentV = rgblight_get_val(); | ||
| 180 | rgblight_sethsv(h,s,currentV); | ||
| 181 | } | ||
| 182 | |||
| 183 | // deterimes when to stop bootup animation | ||
| 184 | void bootupAnimation(void) { | ||
| 185 | bootComplete = (timer_elapsed(bootTimeout) > bootTimeoutDuration) ? 1 : 0; | ||
| 186 | |||
| 187 | if (bootComplete) { | ||
| 188 | rgblight_mode(rgbMode); | ||
| 189 | } | ||
| 190 | } | ||
| 191 | |||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | |||
| 196 | |||
| 197 | /* ========================================================================== | ||
| 198 | INITIALIZATION FUNCTION | ||
| 199 | ========================================================================== */ | ||
| 200 | |||
| 201 | void keyboard_post_init_user(void) { | ||
| 202 | // start a timeout | ||
| 203 | bootTimeout = timer_read(); | ||
| 204 | // set rgb color | ||
| 205 | init_hsv(); | ||
| 206 | // init rgb | ||
| 207 | rgblight_enable(); | ||
| 208 | // animate in snake ledGreende | ||
| 209 | rgblight_mode(rgbBootMode); | ||
| 210 | }; | ||
| 211 | |||
| 212 | |||
| 213 | |||
| 214 | |||
| 215 | |||
| 216 | |||
| 217 | /* ========================================================================== | ||
| 218 | ALWAYS RUNNING | ||
| 219 | ========================================================================== */ | ||
| 220 | void matrix_scan_user(void) { | ||
| 221 | // keep an eye on these layers | ||
| 222 | uint8_t layer = get_highest_layer(layer_state); | ||
| 223 | // handle boot-up sequence | ||
| 224 | bootupAnimation(); | ||
| 225 | // watch the brightness for changes | ||
| 226 | v = rgblight_get_val(); | ||
| 227 | |||
| 228 | switch (layer) { | ||
| 229 | case _FN: | ||
| 230 | // set leds to white | ||
| 231 | rgblight_sethsv_noeeprom(h,0,v); | ||
| 232 | break; | ||
| 233 | default: | ||
| 234 | break; | ||
| 235 | } | ||
| 236 | }; | ||
| 237 | |||
| 238 | |||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | |||
| 243 | /* ========================================================================== | ||
| 244 | KEYPRESS CALLBACKS | ||
| 245 | ========================================================================== */ | ||
| 246 | |||
| 247 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 248 | // keep an eye on these layers | ||
| 249 | uint8_t layer = get_highest_layer(layer_state); | ||
| 250 | |||
| 251 | switch (keycode) { | ||
| 252 | case FN_SPC: | ||
| 253 | // stash and pop color on key down and key up | ||
| 254 | (record->event.pressed) ? get_hsv() : reset_hsv(); | ||
| 255 | return true; | ||
| 256 | default: | ||
| 257 | switch (layer) { | ||
| 258 | case _QW: | ||
| 259 | // tick the hue up with each keypress | ||
| 260 | rgblight_increase_hue(); | ||
| 261 | break; | ||
| 262 | default: | ||
| 263 | break; | ||
| 264 | } | ||
| 265 | return true; // Process all other keycodes normally | ||
| 266 | } | ||
| 267 | } | ||
diff --git a/keyboards/idobo/keymaps/egstad/readme.md b/keyboards/idobo/keymaps/egstad/readme.md new file mode 100644 index 000000000..2de44ad9c --- /dev/null +++ b/keyboards/idobo/keymaps/egstad/readme.md | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Egstad's Idobo | ||
| 2 | |||
| 3 | ## LEDs | ||
| 4 | By default, LEDs are enabled. There is a short bootup animation (`bootupAnimation()`) to indicate that the keyboard has powered up correctly. | ||
| 5 | |||
| 6 | On each keypress, the LEDs hue increases. This increase is determined the the `RGBLIGHT_HUE_STEP` value, which is assigned in `../config.h` (parent idobo directory). My local copy has this value set to `1`, so the incremental color shift is rather slow. | ||
| 7 | |||
| 8 | |||
| 9 | ## Keeping up to date | ||
| 10 | To update your fork’s master, run the following, hitting the Enter key after each line: | ||
| 11 | |||
| 12 | ```bash | ||
| 13 | git checkout master | ||
| 14 | git fetch upstream | ||
| 15 | git pull upstream master | ||
| 16 | git push origin master | ||
| 17 | ``` | ||
diff --git a/keyboards/idobo/keymaps/egstad/rules.mk b/keyboards/idobo/keymaps/egstad/rules.mk new file mode 100644 index 000000000..ca3becc38 --- /dev/null +++ b/keyboards/idobo/keymaps/egstad/rules.mk | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | TAP_DANCE_ENABLE = yes | ||
| 2 | AUTO_SHIFT_ENABLE = yes | ||
| 3 | RGBLIGHT_ENABLE = yes | ||
