diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index 66fdebb50b..4471b9caf3 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -12,49 +12,129 @@ extern keymap_config_t keymap_config; // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _DV 0 -#define _QW 1 -#define _CM 2 -#define _L1 3 -#define _L2 4 +#define _DVORAK 0 +#define _QWERTY 1 +#define _COLEMAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 -// Macro name shortcuts -#define DVORAK M(_DV) -#define QWERTY M(_QW) -#define COLEMAK M(_CM) +enum planck_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, + COLEMAK, + LOWER, + RAISE, + BACKLIT +}; +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DV] = { /* Dvorak */ - {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, - {KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, - {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, - {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} +/* Dvorak Layer + ,----------------------------------. ,----------------------------------. + | ' | , | . | P | Y | | F | G | C | R | L | + |------+------+------+------+------| |------+------+------+------+------| + | A | O | E | U | I | | D | H | T | N | S | + |------+------+------+------+------|------.,------|------+------+------+------+------| + |SFT/ ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |SFT/ Z| + |------+------+------+------+------| ||Enter |------+------+------+------+------| + | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ | + `----------------------------------' `----------------------------------' */ + [_DVORAK] = { + {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L }, + {KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S }, + {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, KC_LCTL, KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z)}, + {KC_ESC, KC_TAB, KC_LGUI, LOWER, KC_BSPC, ALT_T(KC_ENT), KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS } }, - [_QW] = { /* Qwerty */ - {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, - {KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, - {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, - {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_EQL} + +/* QWERTY Layer + ,----------------------------------. ,----------------------------------. + | Q | W | E | R | T | | Y | U | I | O | P | + |------+------+------+------+------| |------+------+------+------+------| + | A | S | D | F | G | | H | J | K | L | ; | + |------+------+------+------+------|------.,------|------+------+------+------+------| + |SFT/ Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |SFT/ /| + |------+------+------+------+------| ||Enter |------+------+------+------+------| + | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ | + `----------------------------------' `----------------------------------' */ + [_QWERTY] = { + {KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH)}, + {KC_ESC, KC_TAB, KC_LGUI, LOWER, KC_BSPC, ALT_T(KC_ENT), KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS } }, - [_CM] = { /* Colemak */ - {KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, - {KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, - {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, - {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_EQL} + +/* Colemak Layer + ,----------------------------------. ,----------------------------------. + | Q | W | F | P | G | | J | L | U | Y | L | + |------+------+------+------+------| |------+------+------+------+------| + | A | R | S | T | D | | H | N | E | I | S | + |------+------+------+------+------|------.,------|------+------+------+------+------| + |SFT/ Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |SFT/ /| + |------+------+------+------+------| ||Enter |------+------+------+------+------| + | Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | RGUI | + `----------------------------------' `----------------------------------'*/ + [_COLEMAK] = { + {KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, + {KC_A, KC_R, KC_S, KC_T, KC_D, XXXXXXX, KC_H, KC_N, KC_E, KC_I, KC_O }, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH)}, + {KC_ESC, KC_TAB, KC_LGUI, LOWER, KC_BSPC, ALT_T(KC_ENT), KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS } }, - [_L1] = { /* LAYER 1 */ - {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, - {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS}, - {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, - {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } + +/* LOWER Layer + ,----------------------------------. ,----------------------------------. + | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + |------+------+------+------+------| |------+------+------+------+------| + | CAPS | | UP | | Home | | PgDn | | + | { | } | + |------+------+------+------+------|------.,------|------+------+------+------+------| + | | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | | + |------+------+------+------+------| || |------+------+------+------+------| + | ~ | | | | Del |------'`------| Ins | | | | | + `----------------------------------' `----------------------------------'*/ + [_LOWER] = { + {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_PLUS, KC_LCBR, KC_RCBR}, + {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, _______}, + {KC_TILD, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______} }, - [_L2] = { /* LAYER 2 */ - {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PIPE}, - {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} + +/* RAISE Layer + ,----------------------------------. ,----------------------------------. + | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | + |------+------+------+------+------| |------+------+------+------+------| + | CAPS | | UP | | Home | | PgDn | | = | [ | ] | + |------+------+------+------+------|------.,------|------+------+------+------+------| + | | Left | Down | Right| End | || | PgUp | Prev | Play | Next | | + |------+------+------+------+------| || |------+------+------+------+------| + | ` | | | | Del |------'`------| Ins | | | | | + `----------------------------------' `----------------------------------'*/ + [_RAISE] = { + {KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0 }, + {KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_EQL, KC_LBRC, KC_RBRC}, + {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, _______}, + {KC_GRV, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______} + }, + +/* ADJUST Layer + ,----------------------------------. ,----------------------------------. + | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + |------+------+------+------+------| |------+------+------+------+------| + | F11 | | | | | | | | | | F12 | + |------+------+------+------+------|------.,------|------+------+------+------+------| + | |QWERTY|COLEMK|DVORAK| | || | | | | | | + |------+------+------+------+------| || |------+------+------+------+------| + | | | | | |------'`------| | | | | RESET| + `----------------------------------' `----------------------------------'*/ + [_ADJUST] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, + {KC_F11, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, KC_F12 }, + {_______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } } + }; const uint16_t PROGMEM fn_actions[] = { @@ -66,24 +146,46 @@ void persistant_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DV: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_DV); + persistant_default_layer_set(1UL<<_QWERTY); } + return false; break; - case _QW: + case COLEMAK: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QW); + persistant_default_layer_set(1UL<<_COLEMAK); } + return false; break; - case _CM: + case DVORAK: if (record->event.pressed) { - persistant_default_layer_set(1UL<<_CM); + persistant_default_layer_set(1UL<<_DVORAK); } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; } - return MACRO_NONE; + return true; };