]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/atreus62/keymaps/xyverz/keymap.c
[Keyboard] Add QMK configurator JSON for Alice PCB (#6397)
[qmk_firmware.git] / keyboards / atreus62 / keymaps / xyverz / keymap.c
1 /* This is the Atreus62 keyboard layout by Xyverz aka u/Zrevyx on r/mk
2    I've blatantly stolen what works for me from the Planck and Preonic
3    layouts and modified this file to fit me. Initial credet goes to
4    u/profet23 for the doing all the work and adding this keyboard to
5    QMK in the first place.
6
7    I've got Dvorak, Qwerty, and Colemak layouts at this time, with the
8    possibility of adding more in the future.
9
10    The bottom row is fairly Kinesis-ish since the Contour and Advantage
11    keyboards have been my daily drivers for the last 17 years. I hope
12    You can get some enjoyment out of this layout should you chose it!
13
14 CHANGELOG:
15
16  0.1 - Initial commit. Based off of Profet's default keymap.
17  0.2 - Converted to a more Planck/Preonic keymap style file with 
18        persistent layers enabled. Renamed layers to reflect OLKB maps.
19        Added a TODO list.
20  0.3 - Moved location of media & volume keys. Added Print Screen, 
21        Scroll Lock and Pause keys. Added a WOW gaming layer that
22        changes the location of Ctrl & Alt to the thumb keys. Added
23        readme.
24  0.4 - After more useage, I realized that the ESC key was in the way 
25        of my muscle memory (gee, thanks, Planck!) so I moved it to
26        the normal Caps Lock position, and moved Caps Lock to the same
27        position on the RAISE and LOWER layers. Added code to turn off
28        the Pro Micro LEDs after flashing.
29  0.5 - Converted keymap to LAYOUT standard.
30
31 TODO:
32
33  * Make the layout more efficient, even if it means changing the RAISE
34    and LOWER functionality.
35  * Add legends in comments for each layer. Maybe.
36
37 */
38
39 // this is the style you want to emulate.
40 // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
41 #include QMK_KEYBOARD_H
42 #include "action_layer.h"
43 #include "eeconfig.h"
44
45 // Each layer gets a name for readability, which is then used in the keymap matrix below.
46 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
47 // Layer names don't all need to be of the same length, obviously, and you can also skip them
48 // entirely and just use numbers.
49 #define _DVORAK 0
50 #define _QWERTY 1
51 #define _COLEMAK 2
52 #define _WOW 3
53 #define _LOWER 4
54 #define _RAISE 5
55 #define _ADJUST 16
56
57 enum atreus52_keycodes {
58   DVORAK = SAFE_RANGE,
59   QWERTY,
60   COLEMAK,
61   WOW,
62   LOWER,
63   RAISE
64 };
65
66 // Aliases to make the keymap clearer.
67 #define CTL_ENT CTL_T(KC_ENT)
68
69 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
70   [_DVORAK] = LAYOUT ( /* dvorak */
71     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSLS,
72     KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,                      KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_SLSH,
73     KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,                      KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_MINS,
74     KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,                      KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_RSFT,
75     KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER,   KC_BSPC, KC_LGUI, KC_ENT,  KC_SPC,  RAISE,   KC_UP,   KC_DOWN, KC_RGUI, KC_RCTL
76   ),
77
78   [_QWERTY] = LAYOUT ( /* qwerty */
79     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,
80     KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,                      KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_DEL,
81     KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,                      KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,
82     KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                      KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
83     KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER,   KC_BSPC, KC_LGUI, KC_ENT,  KC_SPC,  RAISE,   KC_UP,   KC_DOWN, KC_RGUI, KC_RCTL
84   ),
85
86   [_COLEMAK] = LAYOUT ( /* colemak */
87     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,
88     KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,                      KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_DEL,
89     KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,                      KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT,
90     KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                      KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
91     KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER,   KC_BSPC, KC_LGUI, KC_ENT,  KC_SPC,  RAISE,   KC_UP,   KC_DOWN, KC_RGUI, KC_RCTL
92   ),
93
94   [_WOW] = LAYOUT ( /* Dvorak with minor modifications for playing World of Warcraft */
95     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSLS,
96     KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,                      KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_SLSH,
97     KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,                      KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_MINS,
98     KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,                      KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_RSFT,
99     KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER,   KC_BSPC, KC_LALT, CTL_ENT, KC_SPC,  RAISE,   KC_UP,   KC_DOWN, KC_RGUI, KC_ENT
100   ),
101
102   [_LOWER] = LAYOUT (
103     KC_F11,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,                     KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F12,
104     KC_TILD, KC_GRV,  _______, _______, _______, _______,                   _______, _______, _______, _______, _______, KC_PIPE,
105     KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,                   _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______,
106     _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,                   _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
107     _______, _______, KC_HOME, KC_END,  _______, KC_DEL,  _______, _______, KC_INS,  _______, KC_PGUP, KC_PGDN, _______, _______
108   ),
109   [_RAISE] = LAYOUT (
110     KC_F11,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,                     KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F12,
111     KC_TILD, KC_GRV,  _______, _______, _______, _______,                   _______, _______, _______, _______, _______, KC_BSLS,
112     KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,                   _______, _______, KC_EQL,  KC_LBRC, KC_RBRC, _______,
113     _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,                   _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
114     _______, _______, KC_HOME, KC_END,  _______, KC_DEL,  _______, _______, KC_INS,  _______, KC_PGUP, KC_PGDN, _______, _______
115   ),
116   [_ADJUST] = LAYOUT (
117     _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
118     _______, RESET,   _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
119     _______, _______, _______, _______, _______, _______,                   _______, QWERTY,  COLEMAK, DVORAK,  _______, WOW,
120     _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
121     _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
122   ),
123
124 };
125
126 void matrix_init_user(void) {
127 #ifdef BOOTLOADER_CATERINA
128    // This will disable the red LEDs on the ProMicros
129    DDRD &= ~(1<<5);
130    PORTD &= ~(1<<5);
131    DDRB &= ~(1<<0);
132    PORTB &= ~(1<<0);
133 #endif
134 };
135
136 void persistent_default_layer_set(uint16_t default_layer) {
137   eeconfig_update_default_layer(default_layer);
138   default_layer_set(default_layer);
139 }
140
141 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
142   switch (keycode) {
143         case QWERTY:
144           if (record->event.pressed) {
145             persistent_default_layer_set(1UL<<_QWERTY);
146           }
147           return false;
148           break;
149         case COLEMAK:
150           if (record->event.pressed) {
151             persistent_default_layer_set(1UL<<_COLEMAK);
152           }
153           return false;
154           break;
155         case DVORAK:
156           if (record->event.pressed) {
157             persistent_default_layer_set(1UL<<_DVORAK);
158           }
159           return false;
160           break;
161         case WOW:
162           if (record->event.pressed) {
163             persistent_default_layer_set(1UL<<_WOW);
164           }
165           return false;
166           break;
167         case LOWER:
168           if (record->event.pressed) {
169             layer_on(_LOWER);
170             update_tri_layer(_LOWER, _RAISE, _ADJUST);
171           } else {
172             layer_off(_LOWER);
173             update_tri_layer(_LOWER, _RAISE, _ADJUST);
174           }
175           return false;
176           break;
177         case RAISE:
178           if (record->event.pressed) {
179             layer_on(_RAISE);
180             update_tri_layer(_LOWER, _RAISE, _ADJUST);
181           } else {
182             layer_off(_RAISE);
183             update_tri_layer(_LOWER, _RAISE, _ADJUST);
184           }
185           return false;
186           break;
187       }
188     return true;
189 };