diff options
Diffstat (limited to 'keyboards/contra/keymaps/basic/keymap.c')
-rw-r--r-- | keyboards/contra/keymaps/basic/keymap.c | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/keyboards/contra/keymaps/basic/keymap.c b/keyboards/contra/keymaps/basic/keymap.c new file mode 100644 index 000000000..1b5336b8e --- /dev/null +++ b/keyboards/contra/keymaps/basic/keymap.c | |||
@@ -0,0 +1,167 @@ | |||
1 | /* Copyright 2015-2017 Jack Humbert | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | extern keymap_config_t keymap_config; | ||
20 | |||
21 | enum planck_layers { | ||
22 | _QWERTY, | ||
23 | _COLEMAK, | ||
24 | _LOWER, | ||
25 | _RAISE, | ||
26 | _ADJUST | ||
27 | }; | ||
28 | |||
29 | enum planck_keycodes { | ||
30 | QWERTY = SAFE_RANGE, | ||
31 | COLEMAK, | ||
32 | LOWER, | ||
33 | RAISE | ||
34 | }; | ||
35 | |||
36 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
37 | |||
38 | /* Qwerty | ||
39 | * ,-----------------------------------------------------------------------------------. | ||
40 | * | ` | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
41 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
42 | * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | | ||
43 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
44 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
45 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
46 | * | Esc | Tab | Alt | GUI |Lower | Space |Raise | Left |Right | Up |Down | | ||
47 | * `-----------------------------------------------------------------------------------' | ||
48 | */ | ||
49 | [_QWERTY] = LAYOUT_planck_mit( | ||
50 | KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
51 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
52 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , | ||
53 | KC_ESC, KC_TAB, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_RGHT, KC_UP, KC_DOWN | ||
54 | ), | ||
55 | |||
56 | /* Colemak | ||
57 | * ,-----------------------------------------------------------------------------------. | ||
58 | * | ` | Q | W | F | P | G | J | L | U | Y | ; | Bksp | | ||
59 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
60 | * | Ctrl | A | R | S | T | D | H | N | E | I | O | ' | | ||
61 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
62 | * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | ||
63 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
64 | * | Esc | Tab | Alt | GUI |Lower | Space |Raise | Left |Right | Up |Down | | ||
65 | * `-----------------------------------------------------------------------------------' | ||
66 | */ | ||
67 | [_COLEMAK] = LAYOUT_planck_mit( | ||
68 | KC_GRV, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, | ||
69 | KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, | ||
70 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , | ||
71 | KC_ESC, KC_TAB, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_RGHT, KC_UP, KC_DOWN | ||
72 | ), | ||
73 | |||
74 | /* Lower | ||
75 | * ,-----------------------------------------------------------------------------------. | ||
76 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
77 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
78 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | ||
79 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
80 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | | ||
81 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
82 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
83 | * `-----------------------------------------------------------------------------------' | ||
84 | */ | ||
85 | [_LOWER] = LAYOUT_planck_mit( | ||
86 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, | ||
87 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
88 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, | ||
89 | _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
90 | ), | ||
91 | |||
92 | /* Raise | ||
93 | * ,-----------------------------------------------------------------------------------. | ||
94 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
95 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
96 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
97 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
98 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | | ||
99 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
100 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
101 | * `-----------------------------------------------------------------------------------' | ||
102 | */ | ||
103 | [_RAISE] = LAYOUT_planck_mit( | ||
104 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
105 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, | ||
106 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, | ||
107 | _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY | ||
108 | ), | ||
109 | |||
110 | /* Adjust (Lower + Raise) | ||
111 | * ,-----------------------------------------------------------------------------------. | ||
112 | * | | | | | | | | | | | | Del | | ||
113 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
114 | * | | | | | |AGnorm|AGswap|Qwerty|Colemk| | | | | ||
115 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
116 | * | | | | | | | | | | | | | | ||
117 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
118 | * | | | | | | | | | | | | | ||
119 | * `-----------------------------------------------------------------------------------' | ||
120 | */ | ||
121 | [_ADJUST] = LAYOUT_planck_mit( | ||
122 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , | ||
123 | _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, | ||
124 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
125 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
126 | ) | ||
127 | |||
128 | }; | ||
129 | |||
130 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
131 | switch (keycode) { | ||
132 | case QWERTY: | ||
133 | if (record->event.pressed) { | ||
134 | print("mode just switched to qwerty and this is a huge string\n"); | ||
135 | set_single_persistent_default_layer(_QWERTY); | ||
136 | } | ||
137 | return false; | ||
138 | break; | ||
139 | case COLEMAK: | ||
140 | if (record->event.pressed) { | ||
141 | set_single_persistent_default_layer(_COLEMAK); | ||
142 | } | ||
143 | return false; | ||
144 | break; | ||
145 | case LOWER: | ||
146 | if (record->event.pressed) { | ||
147 | layer_on(_LOWER); | ||
148 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
149 | } else { | ||
150 | layer_off(_LOWER); | ||
151 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
152 | } | ||
153 | return false; | ||
154 | break; | ||
155 | case RAISE: | ||
156 | if (record->event.pressed) { | ||
157 | layer_on(_RAISE); | ||
158 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
159 | } else { | ||
160 | layer_off(_RAISE); | ||
161 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
162 | } | ||
163 | return false; | ||
164 | break; | ||
165 | } | ||
166 | return true; | ||
167 | } | ||