diff options
| author | Shay Merrill <shaymdev@gmail.com> | 2021-10-10 20:56:27 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-10 19:56:27 -0700 |
| commit | ae73df00ec1049db44b7ac1e882c38a5fbddb2bf (patch) | |
| tree | 76d996074750d18bbba952eb44cf40c407dbd4f6 | |
| parent | 5414e61f01b3524fb761f5508ba12bd1b218f83d (diff) | |
| download | qmk_firmware-ae73df00ec1049db44b7ac1e882c38a5fbddb2bf.tar.gz qmk_firmware-ae73df00ec1049db44b7ac1e882c38a5fbddb2bf.zip | |
[Keymap] orthodox keymap for shaymdev (#14660)
Co-authored-by: Ryan <fauxpark@gmail.com>
| -rw-r--r-- | keyboards/orthodox/keymaps/shaymdev/config.h | 60 | ||||
| -rw-r--r-- | keyboards/orthodox/keymaps/shaymdev/keymap.c | 196 | ||||
| -rw-r--r-- | keyboards/orthodox/keymaps/shaymdev/rules.mk | 6 |
3 files changed, 262 insertions, 0 deletions
diff --git a/keyboards/orthodox/keymaps/shaymdev/config.h b/keyboards/orthodox/keymaps/shaymdev/config.h new file mode 100644 index 000000000..749302284 --- /dev/null +++ b/keyboards/orthodox/keymaps/shaymdev/config.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | This is the c configuration file for the keymap | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | Copyright 2017 Art Ortenburger | ||
| 7 | |||
| 8 | This program is free software: you can redistribute it and/or modify | ||
| 9 | it under the terms of the GNU General Public License as published by | ||
| 10 | the Free Software Foundation, either version 2 of the License, or | ||
| 11 | (at your option) any later version. | ||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, | ||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | GNU General Public License for more details. | ||
| 17 | |||
| 18 | You should have received a copy of the GNU General Public License | ||
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #pragma once | ||
| 23 | |||
| 24 | /* Use I2C or Serial, not both */ | ||
| 25 | #define USE_SERIAL | ||
| 26 | // #define USE_I2C | ||
| 27 | |||
| 28 | #define EE_HANDS | ||
| 29 | |||
| 30 | #undef RGBLED_NUM | ||
| 31 | #define RGBLED_NUM 14 | ||
| 32 | // #define RGBLIGHT_ANIMATIONS | ||
| 33 | |||
| 34 | #define RGBLIGHT_EFFECT_BREATHING | ||
| 35 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
| 36 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
| 37 | #define RGBLIGHT_EFFECT_KNIGHT | ||
| 38 | |||
| 39 | // #define RGBLED_SPLIT { 5, 5 } | ||
| 40 | #undef RGB_DI_PIN | ||
| 41 | #define RGB_DI_PIN D3 | ||
| 42 | #define RGBLIGHT_LAYERS | ||
| 43 | #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF | ||
| 44 | #define RGBLIGHT_SLEEP | ||
| 45 | |||
| 46 | #ifdef AUDIO_ENABLE | ||
| 47 | #define STARTUP_SONG SONG(PLANCK_SOUND) | ||
| 48 | // #define STARTUP_SONG SONG(NO_SOUND) | ||
| 49 | |||
| 50 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ | ||
| 51 | SONG(COLEMAK_SOUND), \ | ||
| 52 | SONG(DVORAK_SOUND) \ | ||
| 53 | } | ||
| 54 | #endif | ||
| 55 | |||
| 56 | #define COMBO_COUNT 1 | ||
| 57 | |||
| 58 | #define IGNORE_MOD_TAP_INTERRUPT | ||
| 59 | #define TAPPING_TERM 220 | ||
| 60 | |||
diff --git a/keyboards/orthodox/keymaps/shaymdev/keymap.c b/keyboards/orthodox/keymaps/shaymdev/keymap.c new file mode 100644 index 000000000..54ae7e397 --- /dev/null +++ b/keyboards/orthodox/keymaps/shaymdev/keymap.c | |||
| @@ -0,0 +1,196 @@ | |||
| 1 | /* | ||
| 2 | This is the keymap for the keyboard | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | Copyright 2017 Art Ortenburger | ||
| 7 | |||
| 8 | This program is free software: you can redistribute it and/or modify | ||
| 9 | it under the terms of the GNU General Public License as published by | ||
| 10 | the Free Software Foundation, either version 2 of the License, or | ||
| 11 | (at your option) any later version. | ||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, | ||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | GNU General Public License for more details. | ||
| 17 | |||
| 18 | You should have received a copy of the GNU General Public License | ||
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include QMK_KEYBOARD_H | ||
| 23 | |||
| 24 | enum orthodox_layers | ||
| 25 | { | ||
| 26 | _DVORAK, | ||
| 27 | _QWERTY, | ||
| 28 | _LOWER, | ||
| 29 | _RAISE, | ||
| 30 | _ADJUST, | ||
| 31 | }; | ||
| 32 | |||
| 33 | enum combos //match combo_count in config.h | ||
| 34 | { | ||
| 35 | EU_ENT, | ||
| 36 | }; | ||
| 37 | |||
| 38 | const uint16_t PROGMEM eu_combo[] = {KC_E, KC_U, COMBO_END}; | ||
| 39 | |||
| 40 | combo_t key_combos[COMBO_COUNT] = { | ||
| 41 | [EU_ENT] = COMBO_ACTION(eu_combo), | ||
| 42 | }; | ||
| 43 | |||
| 44 | void process_combo_event(uint16_t combo_index, bool pressed) { | ||
| 45 | switch(combo_index) { | ||
| 46 | case EU_ENT: | ||
| 47 | if (pressed) { | ||
| 48 | tap_code16(KC_ENT); | ||
| 49 | } | ||
| 50 | break; | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | |||
| 55 | enum custom_keycodes { | ||
| 56 | DVORAK = SAFE_RANGE, | ||
| 57 | QWERTY, | ||
| 58 | VELOCI | ||
| 59 | }; | ||
| 60 | |||
| 61 | #define LOWER MO(_LOWER) | ||
| 62 | #define RAISE MO(_RAISE) | ||
| 63 | |||
| 64 | #define TO_DV TO(_DVORAK) | ||
| 65 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 66 | |||
| 67 | |||
| 68 | [_DVORAK] = LAYOUT( | ||
| 69 | KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, | ||
| 70 | KC_TAB, GUI_T(KC_A), ALT_T(KC_O), KC_E, KC_U, KC_I, KC_ENT, KC_LALT, KC_DEL, KC_LGUI, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, | ||
| 71 | KC_EQL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, TT(LOWER), KC_LSFT, KC_LCTL, KC_BSPC, ALT_T(KC_SPC), TT(RAISE), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSLS | ||
| 72 | ), | ||
| 73 | |||
| 74 | [_QWERTY] = LAYOUT( | ||
| 75 | KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 76 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
| 77 | KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, _______, _______, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT | ||
| 78 | ), | ||
| 79 | |||
| 80 | [_LOWER] = LAYOUT( | ||
| 81 | _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______, | ||
| 82 | _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_ASTR, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, | ||
| 83 | _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, _______, _______, _______, _______, _______, KC_KP_0, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______ | ||
| 84 | ), | ||
| 85 | |||
| 86 | [_RAISE] = LAYOUT( | ||
| 87 | _______, KC_PSCR, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_VOLU, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, | ||
| 88 | KC_CAPS, KC_INS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, KC_VOLD, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX, | ||
| 89 | _______, KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_F1, KC_F2, KC_F3, KC_F12, XXXXXXX | ||
| 90 | ), | ||
| 91 | |||
| 92 | [_ADJUST] = LAYOUT( | ||
| 93 | TO_DV, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLEP, | ||
| 94 | RGB_TOG, RGB_MOD, VLK_TOG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, QWERTY, DVORAK, _______, _______, _______, | ||
| 95 | RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
| 96 | ) | ||
| 97 | |||
| 98 | |||
| 99 | }; | ||
| 100 | |||
| 101 | const key_override_t delete_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPACE, KC_DELETE); | ||
| 102 | |||
| 103 | // This globally defines all key overrides to be used | ||
| 104 | const key_override_t **key_overrides = (const key_override_t *[]){ | ||
| 105 | &delete_key_override, | ||
| 106 | NULL // Null terminate the array of overrides! | ||
| 107 | }; | ||
| 108 | |||
| 109 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 110 | switch (keycode) { | ||
| 111 | case QWERTY: | ||
| 112 | if (record->event.pressed) { | ||
| 113 | set_single_persistent_default_layer(_QWERTY); | ||
| 114 | } | ||
| 115 | return false; | ||
| 116 | break; | ||
| 117 | case DVORAK: | ||
| 118 | if (record->event.pressed) { | ||
| 119 | set_single_persistent_default_layer(_DVORAK); | ||
| 120 | } | ||
| 121 | return false; | ||
| 122 | break; | ||
| 123 | // case VELOCI: | ||
| 124 | // #ifdef VELOCIKEY_ENABLE | ||
| 125 | // velocikey_toggle(); | ||
| 126 | // return false; | ||
| 127 | // #endif | ||
| 128 | // break; | ||
| 129 | } | ||
| 130 | return true; | ||
| 131 | } | ||
| 132 | |||
| 133 | #ifdef RGBLIGHT_ENABLE | ||
| 134 | |||
| 135 | const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 136 | {4, 6, HSV_RED} // Light 6 LEDs, starting with LED 4 | ||
| 137 | ); | ||
| 138 | |||
| 139 | const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 140 | {0, 3, HSV_CHARTREUSE} // Light 3 LEDs, starting with LED 0 | ||
| 141 | ); | ||
| 142 | |||
| 143 | const rgblight_segment_t PROGMEM my_lower_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 144 | {4, 3, HSV_BLUE} // Light LEDs 5-6 | ||
| 145 | ); | ||
| 146 | |||
| 147 | const rgblight_segment_t PROGMEM my_raise_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 148 | {7, 3, HSV_ORANGE} // Light LEDs 7-8 | ||
| 149 | ); | ||
| 150 | |||
| 151 | const rgblight_segment_t PROGMEM my_adjust_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
| 152 | {4, 6, HSV_GREEN} // Light 10 LEDs, starting with LED 0 | ||
| 153 | ); | ||
| 154 | |||
| 155 | |||
| 156 | // Later layers take precedence. This array corresponds to the magic numbers used in rgblight_set_layer_state(i, onOff) | ||
| 157 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( | ||
| 158 | my_capslock_layer, | ||
| 159 | my_qwerty_layer, // Overrides other layers | ||
| 160 | my_lower_layer, // Overrides other layers | ||
| 161 | my_raise_layer, // Overrides other layers | ||
| 162 | my_adjust_layer // Overrides other layers | ||
| 163 | ); | ||
| 164 | |||
| 165 | void keyboard_post_init_user(void) { | ||
| 166 | // Enable the LED layers | ||
| 167 | rgblight_layers = my_rgb_layers; | ||
| 168 | rgblight_enable_noeeprom(); // Enables RGB, without saving settings | ||
| 169 | //rgblight_sethsv_noeeprom(HSV_CYAN); | ||
| 170 | //rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 171 | rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); | ||
| 172 | } | ||
| 173 | |||
| 174 | bool led_update_user(led_t led_state) { | ||
| 175 | rgblight_set_layer_state(0, led_state.caps_lock); | ||
| 176 | return true; | ||
| 177 | } | ||
| 178 | |||
| 179 | layer_state_t default_layer_state_set_user(layer_state_t state) { | ||
| 180 | rgblight_set_layer_state(1, layer_state_cmp(state, _QWERTY)); | ||
| 181 | return state; | ||
| 182 | } | ||
| 183 | |||
| 184 | #endif | ||
| 185 | |||
| 186 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 187 | state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); | ||
| 188 | |||
| 189 | #ifdef RGBLIGHT_ENABLE | ||
| 190 | rgblight_set_layer_state(2, layer_state_cmp(state, _LOWER)); | ||
| 191 | rgblight_set_layer_state(3, layer_state_cmp(state, _RAISE)); | ||
| 192 | rgblight_set_layer_state(4, layer_state_cmp(state, _ADJUST)); | ||
| 193 | #endif | ||
| 194 | |||
| 195 | return state; | ||
| 196 | } | ||
diff --git a/keyboards/orthodox/keymaps/shaymdev/rules.mk b/keyboards/orthodox/keymaps/shaymdev/rules.mk new file mode 100644 index 000000000..c6ecb2372 --- /dev/null +++ b/keyboards/orthodox/keymaps/shaymdev/rules.mk | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | MOUSEKEY_ENABLE = no | ||
| 2 | RGBLIGHT_ENABLE = yes | ||
| 3 | VELOCIKEY_ENABLE = yes | ||
| 4 | KEY_OVERRIDE_ENABLE = yes | ||
| 5 | COMBO_ENABLE = yes | ||
| 6 | LTO_ENABLE = yes | ||
