aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThat-Canadian <Poole.Chris.11@gmail.com>2018-03-08 07:31:27 -0800
committerJack Humbert <jack.humb@gmail.com>2018-03-08 10:31:27 -0500
commit2bdf1731c38cdd730c5e21c60d2b9253138f81cc (patch)
treecbfa8862c3bff59607f2a3efe73bd65f48abab8e
parent955b17189ac9c744ebdda01988e20a54b2b00d91 (diff)
downloadqmk_firmware-2bdf1731c38cdd730c5e21c60d2b9253138f81cc.tar.gz
qmk_firmware-2bdf1731c38cdd730c5e21c60d2b9253138f81cc.zip
Canadian planck (#2463)
* Line ending stuff again * Added my personal Planck layout (finally)
-rw-r--r--keyboards/planck/keymaps/that_canadian/keymap.c217
-rw-r--r--keyboards/planck/keymaps/that_canadian/readme.md2
2 files changed, 219 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/that_canadian/keymap.c b/keyboards/planck/keymaps/that_canadian/keymap.c
new file mode 100644
index 000000000..993a0d686
--- /dev/null
+++ b/keyboards/planck/keymaps/that_canadian/keymap.c
@@ -0,0 +1,217 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "planck.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8#endif
9#include "eeconfig.h"
10
11extern keymap_config_t keymap_config;
12
13// Each layer gets a name for readability, which is then used in the keymap matrix below.
14// The underscores don't mean anything - you can have a layer called STUFF or any other name.
15// Layer names don't all need to be of the same length, obviously, and you can also skip them
16// entirely and just use numbers.
17#define _QWERTY 0
18
19#define _LOWER 2
20#define _RAISE 3
21
22#define _FUNCTION 15
23#define _ADJUST 16
24
25enum planck_keycodes {
26 QWERTY = SAFE_RANGE,
27 LOWER,
28 RAISE
29};
30
31// Fillers to make layering more clear
32#define _______ KC_TRNS
33#define XXXXXXX KC_NO
34
35// Defines for task manager and such
36#define CALTDEL LCTL(LALT(KC_DEL))
37#define TSKMGR LCTL(LSFT(KC_ESC))
38
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40
41/* Qwerty
42 * ,-----------------------------------------------------------------------------------.
43 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
44 * |------+------+------+------+------+-------------+------+------+------+------+------|
45 * | Func | A | S | D | F | G | H | J | K | L | ; | Enter|
46 * |------+------+------+------+------+------|------+------+------+------+------+------|
47 * | Shift| Z | X | C | V | B | N | M | , | . | / | ' |
48 * |------+------+------+------+------+------+------+------+------+------+------+------|
49 * | Ctrl | ` | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
50 * `-----------------------------------------------------------------------------------'
51 */
52[_QWERTY] = {
53 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
54 {MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT},
55 {OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT},
56 {KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
57},
58
59/* Lower
60 * ,-----------------------------------------------------------------------------------.
61 * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
62 * |------+------+------+------+------+-------------+------+------+------+------+------|
63 * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter |
64 * |------+------+------+------+------+------|------+------+------+------+------+------|
65 * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | |
66 * |------+------+------+------+------+------+------+------+------+------+------+------|
67 * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play |
68 * `-----------------------------------------------------------------------------------'
69 */
70[_LOWER] = {
71 {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
72 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______},
73 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE},
74 {_______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
75},
76
77/* Raise
78 * ,-----------------------------------------------------------------------------------.
79 * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
80 * |------+------+------+------+------+-------------+------+------+------+------+------|
81 * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter |
82 * |------+------+------+------+------+------|------+------+------+------+------+------|
83 * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ |
84 * |------+------+------+------+------+------+------+------+------+------+------+------|
85 * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play |
86 * `-----------------------------------------------------------------------------------'
87 */
88[_RAISE] = {
89 {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
90 {_______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______},
91 {KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS},
92 {_______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
93},
94
95/* Adjust (Lower + Raise)
96 * ,-----------------------------------------------------------------------------------.
97 * |Taskmg| | | | | | | | | | |caltde|
98 * |------+------+------+------+------+-------------+------+------+------+------+------|
99 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | |
100 * |------+------+------+------+------+------|------+------+------+------+------+------|
101 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
102 * |------+------+------+------+------+------+------+------+------+------+------+------|
103 * | | | | | | | | | | | | RESET|
104 * `-----------------------------------------------------------------------------------'
105 */
106[_ADJUST] = {
107 {TSKMGR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CALTDEL},
108 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______},
109 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
110 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET}
111},
112
113/* Function
114 * ,-----------------------------------------------------------------------------------.
115 * | | | | | | | | | Up | | | |
116 * |------+------+------+------+------+-------------+------+------+------+------+------|
117 * | | | | | | | | Left | Down |Right | | |
118 * |------+------+------+------+------+------|------+------+------+------+------+------|
119 * | Caps | | | | | | | | | | | |
120 * |------+------+------+------+------+------+------+------+------+------+------+------|
121 * | | | | | | | | | | | |
122 * `-----------------------------------------------------------------------------------'
123 */
124[_FUNCTION] = {
125 {_______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______},
126 {_______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______},
127 {KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
128 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
129}
130
131
132};
133
134#ifdef AUDIO_ENABLE
135
136float tone_startup[][2] = SONG(STARTUP_SOUND);
137float tone_qwerty[][2] = SONG(QWERTY_SOUND);
138float tone_dvorak[][2] = SONG(DVORAK_SOUND);
139float tone_colemak[][2] = SONG(COLEMAK_SOUND);
140float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
141
142float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
143#endif
144
145
146void persistant_default_layer_set(uint16_t default_layer) {
147 eeconfig_update_default_layer(default_layer);
148 default_layer_set(default_layer);
149}
150
151bool process_record_user(uint16_t keycode, keyrecord_t *record) {
152 switch (keycode) {
153 case QWERTY:
154 if (record->event.pressed) {
155 #ifdef AUDIO_ENABLE
156 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
157 #endif
158 persistant_default_layer_set(1UL<<_QWERTY);
159 }
160 return false;
161 break;
162 case LOWER:
163 if (record->event.pressed) {
164 layer_on(_LOWER);
165 update_tri_layer(_LOWER, _RAISE, _ADJUST);
166 } else {
167 layer_off(_LOWER);
168 update_tri_layer(_LOWER, _RAISE, _ADJUST);
169 }
170 return false;
171 break;
172 case RAISE:
173 if (record->event.pressed) {
174 layer_on(_RAISE);
175 update_tri_layer(_LOWER, _RAISE, _ADJUST);
176 } else {
177 layer_off(_RAISE);
178 update_tri_layer(_LOWER, _RAISE, _ADJUST);
179 }
180 return false;
181 break;
182 }
183 return true;
184}
185
186void matrix_init_user(void) {
187 #ifdef AUDIO_ENABLE
188 startup_user();
189 #endif
190}
191
192#ifdef AUDIO_ENABLE
193
194void startup_user()
195{
196 _delay_ms(20); // gets rid of tick
197 PLAY_NOTE_ARRAY(tone_startup, false, 0);
198}
199
200void shutdown_user()
201{
202 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
203 _delay_ms(150);
204 stop_all_notes();
205}
206
207void music_on_user(void)
208{
209 music_scale_user();
210}
211
212void music_scale_user(void)
213{
214 PLAY_NOTE_ARRAY(music_scale, false, 0);
215}
216
217#endif
diff --git a/keyboards/planck/keymaps/that_canadian/readme.md b/keyboards/planck/keymaps/that_canadian/readme.md
new file mode 100644
index 000000000..267b4f94f
--- /dev/null
+++ b/keyboards/planck/keymaps/that_canadian/readme.md
@@ -0,0 +1,2 @@
1# That-Canadian personal planck layout
2