diff options
Diffstat (limited to 'keyboards/zen/rev1/keymaps/xyverz/keymap.c')
| -rw-r--r-- | keyboards/zen/rev1/keymaps/xyverz/keymap.c | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/keyboards/zen/rev1/keymaps/xyverz/keymap.c b/keyboards/zen/rev1/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..6250086ed --- /dev/null +++ b/keyboards/zen/rev1/keymaps/xyverz/keymap.c | |||
| @@ -0,0 +1,172 @@ | |||
| 1 | /* This is the Zen keyboard layout by Xyverz aka u/Zrevyx on r/mk. | ||
| 2 | This is pretty much a direct port of my Atreus62 keymap. | ||
| 3 | |||
| 4 | The bottom row is fairly Kinesis-ish since the Contour and Advantage | ||
| 5 | keyboards have been my daily drivers for the last 17 years. I hope | ||
| 6 | You can get some enjoyment out of this layout should you chose it! | ||
| 7 | |||
| 8 | CHANGELOG: | ||
| 9 | |||
| 10 | 0.1 - Initial commit. Based off of Profet's default keymap. | ||
| 11 | |||
| 12 | TODO: | ||
| 13 | |||
| 14 | * Figure out how to make the bottom row work best for me. | ||
| 15 | * Add legends in comments for each layer. Maybe. | ||
| 16 | |||
| 17 | */ | ||
| 18 | |||
| 19 | #include QMK_KEYBOARD_H | ||
| 20 | |||
| 21 | extern keymap_config_t keymap_config; | ||
| 22 | |||
| 23 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 24 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 25 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 26 | // entirely and just use numbers. | ||
| 27 | #define _DVORAK 0 | ||
| 28 | #define _QWERTY 1 | ||
| 29 | #define _COLEMAK 2 | ||
| 30 | #define _WOW 3 | ||
| 31 | #define _LOWER 4 | ||
| 32 | #define _RAISE 5 | ||
| 33 | #define _ADJUST 16 | ||
| 34 | |||
| 35 | enum atreus52_keycodes { | ||
| 36 | DVORAK = SAFE_RANGE, | ||
| 37 | QWERTY, | ||
| 38 | COLEMAK, | ||
| 39 | WOW, | ||
| 40 | LOWER, | ||
| 41 | RAISE | ||
| 42 | }; | ||
| 43 | |||
| 44 | // Aliases to make the keymap clearer. | ||
| 45 | #define CTLBSPC CTL_T(KC_BSPC) // CTRL when held, BSPC when tapped. | ||
| 46 | #define RGB_SWR RGB_M_SW // Swirl Animation alias | ||
| 47 | #define RGB_SNK RGB_M_SN // Snake Animation alias | ||
| 48 | #define ADJUST MO(_ADJUST) | ||
| 49 | |||
| 50 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 51 | |||
| 52 | [_DVORAK] = LAYOUT( \ | ||
| 53 | KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ | ||
| 54 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ | ||
| 55 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ | ||
| 56 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ | ||
| 57 | LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ | ||
| 58 | ), | ||
| 59 | |||
| 60 | [_QWERTY] = LAYOUT( \ | ||
| 61 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ | ||
| 62 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ | ||
| 63 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 64 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ | ||
| 65 | LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ | ||
| 66 | ), | ||
| 67 | |||
| 68 | [_COLEMAK] = LAYOUT( \ | ||
| 69 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ | ||
| 70 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ | ||
| 71 | KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
| 72 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ | ||
| 73 | LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ | ||
| 74 | ), | ||
| 75 | |||
| 76 | [_WOW] = LAYOUT( \ | ||
| 77 | KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ | ||
| 78 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \ | ||
| 79 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ | ||
| 80 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ | ||
| 81 | LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, CTLBSPC, KC_LALT, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ | ||
| 82 | ), | ||
| 83 | |||
| 84 | [_LOWER] = LAYOUT( \ | ||
| 85 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ | ||
| 86 | KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ | ||
| 87 | KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ | ||
| 88 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ | ||
| 89 | _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ | ||
| 90 | ), | ||
| 91 | |||
| 92 | [_RAISE] = LAYOUT( \ | ||
| 93 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ | ||
| 94 | KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ | ||
| 95 | KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ | ||
| 96 | _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ | ||
| 97 | _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ | ||
| 98 | ), | ||
| 99 | |||
| 100 | [_ADJUST] = LAYOUT( \ | ||
| 101 | RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 102 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 103 | _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_SNK, _______, QWERTY, COLEMAK, DVORAK, WOW, _______, \ | ||
| 104 | RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ | ||
| 105 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 106 | ), | ||
| 107 | |||
| 108 | }; | ||
| 109 | |||
| 110 | |||
| 111 | void persistent_default_layer_set(uint16_t default_layer) { | ||
| 112 | eeconfig_update_default_layer(default_layer); | ||
| 113 | default_layer_set(default_layer); | ||
| 114 | } | ||
| 115 | |||
| 116 | void matrix_init_user(void) { | ||
| 117 | // This will disable the red LEDs on the ProMicros | ||
| 118 | DDRD &= ~(1<<5); | ||
| 119 | PORTD &= ~(1<<5); | ||
| 120 | DDRB &= ~(1<<0); | ||
| 121 | PORTB &= ~(1<<0); | ||
| 122 | } | ||
| 123 | |||
| 124 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 125 | switch (keycode) { | ||
| 126 | case DVORAK: | ||
| 127 | if (record->event.pressed) { | ||
| 128 | persistent_default_layer_set(1UL<<_DVORAK); | ||
| 129 | } | ||
| 130 | return false; | ||
| 131 | break; | ||
| 132 | case QWERTY: | ||
| 133 | if (record->event.pressed) { | ||
| 134 | persistent_default_layer_set(1UL<<_QWERTY); | ||
| 135 | } | ||
| 136 | return false; | ||
| 137 | break; | ||
| 138 | case COLEMAK: | ||
| 139 | if (record->event.pressed) { | ||
| 140 | persistent_default_layer_set(1UL<<_COLEMAK); | ||
| 141 | } | ||
| 142 | return false; | ||
| 143 | break; | ||
| 144 | case WOW: | ||
| 145 | if (record->event.pressed) { | ||
| 146 | persistent_default_layer_set(1UL<<_WOW); | ||
| 147 | } | ||
| 148 | return false; | ||
| 149 | break; | ||
| 150 | case LOWER: | ||
| 151 | if (record->event.pressed) { | ||
| 152 | layer_on(_LOWER); | ||
| 153 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 154 | } else { | ||
| 155 | layer_off(_LOWER); | ||
| 156 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 157 | } | ||
| 158 | return false; | ||
| 159 | break; | ||
| 160 | case RAISE: | ||
| 161 | if (record->event.pressed) { | ||
| 162 | layer_on(_RAISE); | ||
| 163 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 164 | } else { | ||
| 165 | layer_off(_RAISE); | ||
| 166 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 167 | } | ||
| 168 | return false; | ||
| 169 | break; | ||
| 170 | } | ||
| 171 | return true; | ||
| 172 | }; | ||
