]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/atreus62/keymaps/xyverz/keymap.c
Merge branch 'master' of github.com:qmk/qmk_firmware into hf/shinydox
[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 // Fillers to make layering more clear
67 #define _______ KC_TRNS
68 #define XXXXXXX KC_NO
69
70 // Aliases to make the keymap clearer.
71 #define CTL_ENT CTL_T(KC_ENT)
72
73 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
74   [_DVORAK] = LAYOUT ( /* dvorak */
75     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSLS,
76     KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,                      KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_SLSH,
77     KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,                      KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_MINS,
78     KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,                      KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_RSFT,
79     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
80   ),
81
82   [_QWERTY] = LAYOUT ( /* qwerty */
83     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,
84     KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,                      KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_DEL,
85     KC_ESC,  KC_A,    KC_S,    KC_D,    KC_F,    KC_G,                      KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,
86     KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                      KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
87     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
88   ),
89
90   [_COLEMAK] = LAYOUT ( /* colemak */
91     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS,
92     KC_TAB,  KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,                      KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN, KC_DEL,
93     KC_ESC,  KC_A,    KC_R,    KC_S,    KC_T,    KC_D,                      KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT,
94     KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                      KC_K,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
95     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
96   ),
97
98   [_WOW] = LAYOUT ( /* Dvorak with minor modifications for playing World of Warcraft */
99     KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,                      KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSLS,
100     KC_TAB,  KC_QUOT, KC_COMM, KC_DOT,  KC_P,    KC_Y,                      KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_SLSH,
101     KC_ESC,  KC_A,    KC_O,    KC_E,    KC_U,    KC_I,                      KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_MINS,
102     KC_LSFT, KC_SCLN, KC_Q,    KC_J,    KC_K,    KC_X,                      KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    KC_RSFT,
103     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
104   ),
105
106   [_LOWER] = LAYOUT (
107     KC_F11,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,                     KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F12,
108     KC_TILD, KC_GRV,  _______, _______, _______, _______,                   _______, _______, _______, _______, _______, KC_PIPE,
109     KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,                   _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______,
110     _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,                   _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
111     _______, _______, KC_HOME, KC_END,  _______, KC_DEL,  _______, _______, KC_INS,  _______, KC_PGUP, KC_PGDN, _______, _______
112   ),
113   [_RAISE] = LAYOUT (
114     KC_F11,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,                     KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F12,
115     KC_TILD, KC_GRV,  _______, _______, _______, _______,                   _______, _______, _______, _______, _______, KC_BSLS,
116     KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______,                   _______, _______, KC_EQL,  KC_LBRC, KC_RBRC, _______,
117     _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,                   _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
118     _______, _______, KC_HOME, KC_END,  _______, KC_DEL,  _______, _______, KC_INS,  _______, KC_PGUP, KC_PGDN, _______, _______
119   ),
120   [_ADJUST] = LAYOUT (
121     _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
122     _______, RESET,   _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
123     _______, _______, _______, _______, _______, _______,                   _______, QWERTY,  COLEMAK, DVORAK,  _______, WOW,
124     _______, _______, _______, _______, _______, _______,                   _______, _______, _______, _______, _______, _______,
125     _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
126   ),
127
128 };
129
130 const uint16_t PROGMEM fn_actions[] = {
131
132 };
133
134 void persistent_default_layer_set(uint16_t default_layer) {
135   eeconfig_update_default_layer(default_layer);
136   default_layer_set(default_layer);
137 }
138
139 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
140   switch (keycode) {
141         case QWERTY:
142           if (record->event.pressed) {
143             persistent_default_layer_set(1UL<<_QWERTY);
144           }
145           return false;
146           break;
147         case COLEMAK:
148           if (record->event.pressed) {
149             persistent_default_layer_set(1UL<<_COLEMAK);
150           }
151           return false;
152           break;
153         case DVORAK:
154           if (record->event.pressed) {
155             persistent_default_layer_set(1UL<<_DVORAK);
156           }
157           return false;
158           break;
159         case WOW:
160           if (record->event.pressed) {
161             persistent_default_layer_set(1UL<<_WOW);
162           }
163           return false;
164           break;
165         case LOWER:
166           if (record->event.pressed) {
167             layer_on(_LOWER);
168             update_tri_layer(_LOWER, _RAISE, _ADJUST);
169           } else {
170             layer_off(_LOWER);
171             update_tri_layer(_LOWER, _RAISE, _ADJUST);
172           }
173           return false;
174           break;
175         case RAISE:
176           if (record->event.pressed) {
177             layer_on(_RAISE);
178             update_tri_layer(_LOWER, _RAISE, _ADJUST);
179           } else {
180             layer_off(_RAISE);
181             update_tri_layer(_LOWER, _RAISE, _ADJUST);
182           }
183           return false;
184           break;
185       }
186     return true;
187 };