aboutsummaryrefslogtreecommitdiff
path: root/keyboards/contra/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/contra/keymaps/default/keymap.c')
-rw-r--r--keyboards/contra/keymaps/default/keymap.c260
1 files changed, 260 insertions, 0 deletions
diff --git a/keyboards/contra/keymaps/default/keymap.c b/keyboards/contra/keymaps/default/keymap.c
new file mode 100644
index 000000000..6a653d9ce
--- /dev/null
+++ b/keyboards/contra/keymaps/default/keymap.c
@@ -0,0 +1,260 @@
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
20enum planck_layers {
21 _QWERTY,
22 _COLEMAK,
23 _DVORAK,
24 _LOWER,
25 _RAISE,
26 _PLOVER,
27 _ADJUST
28};
29
30enum planck_keycodes {
31 QWERTY = SAFE_RANGE,
32 COLEMAK,
33 DVORAK,
34 PLOVER,
35 LOWER,
36 RAISE,
37 BACKLIT,
38 EXT_PLV
39};
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43 /* Qwerty
44 * ,-----------------------------------------------------------------------------------.
45 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
48 * |------+------+------+------+------+------|------+------+------+------+------+------|
49 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
50 * |------+------+------+------+------+------+------+------+------+------+------+------|
51 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
52 * `-----------------------------------------------------------------------------------'
53 */
54 [_QWERTY] = LAYOUT_planck_mit(
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
56 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
58 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
59 ),
60
61 /* Colemak
62 * ,-----------------------------------------------------------------------------------.
63 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
64 * |------+------+------+------+------+-------------+------+------+------+------+------|
65 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
66 * |------+------+------+------+------+------|------+------+------+------+------+------|
67 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
70 * `-----------------------------------------------------------------------------------'
71 */
72 [_COLEMAK] = LAYOUT_planck_mit(
73 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
74 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
75 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
76 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
77 ),
78
79 /* Dvorak
80 * ,-----------------------------------------------------------------------------------.
81 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
88 * `-----------------------------------------------------------------------------------'
89 */
90 [_DVORAK] = LAYOUT_planck_mit(
91 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
92 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
93 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
94 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
95 ),
96
97 /* Lower
98 * ,-----------------------------------------------------------------------------------.
99 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
100 * |------+------+------+------+------+-------------+------+------+------+------+------|
101 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
102 * |------+------+------+------+------+------|------+------+------+------+------+------|
103 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | | Next | Vol- | Vol+ | Play |
106 * `-----------------------------------------------------------------------------------'
107 */
108 [_LOWER] = LAYOUT_planck_mit(
109 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
110 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
111 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
112 _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
113 ),
114
115 /* Raise
116 * ,-----------------------------------------------------------------------------------.
117 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
118 * |------+------+------+------+------+-------------+------+------+------+------+------|
119 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
120 * |------+------+------+------+------+------|------+------+------+------+------+------|
121 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
122 * |------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | | | | | Next | Vol- | Vol+ | Play |
124 * `-----------------------------------------------------------------------------------'
125 */
126 [_RAISE] = LAYOUT_planck_mit(
127 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
128 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
129 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
130 _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
131 ),
132
133 /* Plover layer (http://opensteno.org)
134 * ,-----------------------------------------------------------------------------------.
135 * | # | # | # | # | # | # | # | # | # | # | # | # |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | S | T | P | H | * | * | F | P | L | T | D |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * | | S | K | W | R | * | * | R | B | G | S | Z |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | Exit | | | A | O | | E | U | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144
145 [_PLOVER] = LAYOUT_planck_mit(
146 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
147 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
148 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
149 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
150 ),
151
152 /* Adjust (Lower + Raise)
153 * ,-----------------------------------------------------------------------------------.
154 * | | Reset| | | | | | | | | | Del |
155 * |------+------+------+------+------+-------------+------+------+------+------+------|
156 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
157 * |------+------+------+------+------+------|------+------+------+------+------+------|
158 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
159 * |------+------+------+------+------+------+------+------+------+------+------+------|
160 * | | | | | | | | | | | |
161 * `-----------------------------------------------------------------------------------'
162 */
163 [_ADJUST] = LAYOUT_planck_mit(
164 _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
165 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
166 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
167 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
168 )
169
170};
171
172
173#ifdef AUDIO_ENABLE
174 float plover_song[][2] = SONG(PLOVER_SOUND);
175 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
176#endif
177
178bool process_record_user(uint16_t keycode, keyrecord_t *record) {
179 switch (keycode) {
180 case QWERTY:
181 if (record->event.pressed) {
182 print("mode just switched to qwerty and this is a huge string\n");
183 set_single_persistent_default_layer(_QWERTY);
184 }
185 return false;
186 break;
187 case COLEMAK:
188 if (record->event.pressed) {
189 set_single_persistent_default_layer(_COLEMAK);
190 }
191 return false;
192 break;
193 case DVORAK:
194 if (record->event.pressed) {
195 set_single_persistent_default_layer(_DVORAK);
196 }
197 return false;
198 break;
199 case LOWER:
200 if (record->event.pressed) {
201 layer_on(_LOWER);
202 update_tri_layer(_LOWER, _RAISE, _ADJUST);
203 } else {
204 layer_off(_LOWER);
205 update_tri_layer(_LOWER, _RAISE, _ADJUST);
206 }
207 return false;
208 break;
209 case RAISE:
210 if (record->event.pressed) {
211 layer_on(_RAISE);
212 update_tri_layer(_LOWER, _RAISE, _ADJUST);
213 } else {
214 layer_off(_RAISE);
215 update_tri_layer(_LOWER, _RAISE, _ADJUST);
216 }
217 return false;
218 break;
219 case BACKLIT:
220 if (record->event.pressed) {
221 register_code(KC_RSFT);
222 #ifdef BACKLIGHT_ENABLE
223 backlight_step();
224 #endif
225 } else {
226 unregister_code(KC_RSFT);
227 }
228 return false;
229 break;
230 case PLOVER:
231 if (record->event.pressed) {
232 #ifdef AUDIO_ENABLE
233 stop_all_notes();
234 PLAY_SONG(plover_song);
235 #endif
236 layer_off(_RAISE);
237 layer_off(_LOWER);
238 layer_off(_ADJUST);
239 layer_on(_PLOVER);
240 if (!eeconfig_is_enabled()) {
241 eeconfig_init();
242 }
243 keymap_config.raw = eeconfig_read_keymap();
244 keymap_config.nkro = 1;
245 eeconfig_update_keymap(keymap_config.raw);
246 }
247 return false;
248 break;
249 case EXT_PLV:
250 if (record->event.pressed) {
251 #ifdef AUDIO_ENABLE
252 PLAY_SONG(plover_gb_song);
253 #endif
254 layer_off(_PLOVER);
255 }
256 return false;
257 break;
258 }
259 return true;
260}