aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-08-29 20:16:20 -0400
committerGitHub <noreply@github.com>2016-08-29 20:16:20 -0400
commit8e00c464e6f488d86e0768a77a2ad5ee238dba6d (patch)
tree6499532bd19a39fbccef91dc8ed9bfb220633244
parent3301e2219fe771fdad3b8f851d4b4f7f2a49afc8 (diff)
parent6d7637ae3eb4b37ab7d294818aa92ea9562df4b9 (diff)
downloadqmk_firmware-8e00c464e6f488d86e0768a77a2ad5ee238dba6d.tar.gz
qmk_firmware-8e00c464e6f488d86e0768a77a2ad5ee238dba6d.zip
Merge pull request #703 from jhenahan/feature/jhenahan-keymap
jhenahan Planck layout
-rw-r--r--keyboards/planck/keymaps/jhenahan/Makefile25
-rw-r--r--keyboards/planck/keymaps/jhenahan/config.h9
-rw-r--r--keyboards/planck/keymaps/jhenahan/keymap.c314
-rw-r--r--keyboards/planck/keymaps/jhenahan/readme.md41
4 files changed, 389 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/jhenahan/Makefile b/keyboards/planck/keymaps/jhenahan/Makefile
new file mode 100644
index 000000000..de01ad240
--- /dev/null
+++ b/keyboards/planck/keymaps/jhenahan/Makefile
@@ -0,0 +1,25 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = yes # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23ifndef QUANTUM_DIR
24 include ../../../../Makefile
25endif
diff --git a/keyboards/planck/keymaps/jhenahan/config.h b/keyboards/planck/keymaps/jhenahan/config.h
new file mode 100644
index 000000000..cd3adc41c
--- /dev/null
+++ b/keyboards/planck/keymaps/jhenahan/config.h
@@ -0,0 +1,9 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define FORCE_NKRO
7#define WORKMAN_SOUND COLEMAK_SOUND
8
9#endif
diff --git a/keyboards/planck/keymaps/jhenahan/keymap.c b/keyboards/planck/keymaps/jhenahan/keymap.c
new file mode 100644
index 000000000..2bda4b695
--- /dev/null
+++ b/keyboards/planck/keymaps/jhenahan/keymap.c
@@ -0,0 +1,314 @@
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 _WORKMAN 0
18#define _DEAD 1
19#define _QWERTY 2
20#define _LOWER 3
21#define _RAISE 4
22#define _PLOVER 5
23#define _ADJUST 16
24
25enum planck_keycodes {
26 WORKMAN = SAFE_RANGE,
27 DEAD,
28 QWERTY,
29 LOWER,
30 RAISE,
31 PLOVER,
32 EXT_PLV,
33 TOG_PLV
34};
35
36// Fillers to make layering more clear
37#define _______ KC_TRNS
38#define XXXXXXX KC_NO
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41
42
43/* Workman
44 * ,-----------------------------------------------------------------------------------.
45 * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Esc | A | S | H | T | G | Y | N | E | O | I | " |
48 * |------+------+------+------+------+------|------+------+------+------+------+------|
49 * | Shift| Z | X | M | C | V | K | L | Dead | . | / |Enter |
50 * |------+------+------+------+------+------+------+------+------+------+------+------|
51 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
52 * `-----------------------------------------------------------------------------------'
53 */
54[_WORKMAN] = {
55 {KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC},
56 {MT(MOD_LCTL,KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT},
57 {KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, DEAD, KC_DOT, KC_SLSH, KC_ENT},
58 {KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
59},
60
61/* Workman Dead Layer
62 * ,-----------------------------------------------------------------------------------.
63 * | | % | & | ? | + | @ | $ | _ | [ | ] | ! | |
64 * |------+------+------+------+------+-------------+------+------+------+------+------|
65 * | | / | ( | = | 0 | { | } | 1 | * | ) | - | " |
66 * |------+------+------+------+------+------|------+------+------+------+------+------|
67 * | | 6 | 7 | 8 | 9 | | | \ | 2 | 3 | 4 | 5 | |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | | | < | ~ | ` | , | # | ^ | > | | |
70 * `-----------------------------------------------------------------------------------'
71 */
72[_DEAD] = {
73 {XXXXXXX, KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT, KC_DLR, KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, XXXXXXX},
74 {XXXXXXX, KC_SLSH, KC_LPRN, KC_EQL, KC_0, KC_LCBR, KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, XXXXXXX},
75 {XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_BSLS, KC_2, KC_3, KC_4, KC_5, XXXXXXX},
76 {XXXXXXX, XXXXXXX, KC_LT, KC_TILD, KC_GRV, KC_COMM, KC_COMM, KC_HASH, KC_CIRC, KC_GT, XXXXXXX, XXXXXXX}
77},
78
79/* Qwerty
80 * ,-----------------------------------------------------------------------------------.
81 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | Ctrl | RAlt | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_QWERTY] = {
91 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
92 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
93 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
94 {KC_LCTL, KC_RALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, 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 | | | Vol+ |Enter |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | | Prev | Next | Vol- | Play |
106 * `-----------------------------------------------------------------------------------'
107 */
108[_LOWER] = {
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_VOLU, _______},
112 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_MPLY}
113},
114
115/* Raise - KWM Interaction
116 * ,-----------------------------------------------------------------------------------.
117 * |Restrt| |TgSplt|Flotng|Parent|FlScrn|InsMrk| InsW | InsS | InsN | InsE | |
118 * |------+------+------+------+------+-------------+------+------+------+------+------|
119 * | | Mark |Rotate|Prefix| Term | BSP |SwpMrk|SwapW |SwapS |SwapN |SwapE | |
120 * |------+------+------+------+------+------|------+------+------+------+------+------|
121 * | |MarkW |MarkS |MarkN |MarkE |Monocl|Float |FocusW|FocusS|FocusN|FocusE| |
122 * |------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | | | | | | | | |
124 * `-----------------------------------------------------------------------------------'
125 */
126[_RAISE] = {
127 {LCAG(KC_Q), XXXXXXX, LCAG(KC_S), LCAG(KC_W), LCAG(KC_D), LCAG(KC_F), LCTL(S(KC_X)), LCTL(S(KC_H)), LCTL(S(KC_J)), LCTL(S(KC_K)), LCTL(S(KC_L)), XXXXXXX},
128 {XXXXXXX, LCAG(KC_M), LGUI(LCTL(KC_R)), LCAG(KC_DOT), LCAG(KC_T), LGUI(LCTL(KC_A)), LCTL(LALT(KC_M)), LCTL(LALT(KC_H)), LCTL(LALT(KC_J)), LCTL(LALT(KC_K)), LCTL(LALT(KC_L)), XXXXXXX},
129 {_______, LCAG(KC_H), LCAG(KC_J), LCAG(KC_K), LCAG(KC_L), LGUI(LCTL(KC_S)), LGUI(LCTL(KC_D)), LGUI(LALT(KC_H)), LGUI(LALT(KC_J)), LGUI(LALT(KC_K)), LGUI(LALT(KC_L)), _______},
130 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
131},
132
133/* Plover layer (http://opensteno.org)
134 * ,-----------------------------------------------------------------------------------.
135 * | # | # | # | # | # | # | # | # | # | # | # | # |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | S | T | P | H | * | * | F | P | L | T | D |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | Exit | | | A | O | | E | U | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144
145[_PLOVER] = {
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_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC},
148 {TOG_PLV, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT},
149 {EXT_PLV, XXXXXXX, XXXXXXX, KC_M, KC_C, XXXXXXX, XXXXXXX, KC_L, KC_COMM, XXXXXXX, XXXXXXX, XXXXXXX}
150},
151
152/* Adjust (Lower + Raise)
153 * ,-----------------------------------------------------------------------------------.
154 * | | Reset| | | | | | | | | | Del |
155 * |------+------+------+------+------+-------------+------+------+------+------+------|
156 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Workmn|Plover| | |
157 * |------+------+------+------+------+------|------+------+------+------+------+------|
158 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
159 * |------+------+------+------+------+------+------+------+------+------+------+------|
160 * | | | | | | | | | | | |
161 * `-----------------------------------------------------------------------------------'
162 */
163[_ADJUST] = {
164 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
165 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, WORKMAN, PLOVER, _______, _______},
166 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
167 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
168}
169
170
171};
172
173#ifdef AUDIO_ENABLE
174
175float tone_startup[][2] = SONG(STARTUP_SOUND);
176float tone_qwerty[][2] = SONG(QWERTY_SOUND);
177float tone_workman[][2] = SONG(WORKMAN_SOUND);
178float tone_plover[][2] = SONG(PLOVER_SOUND);
179float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
180float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
181
182float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
183#endif
184
185
186void persistant_default_layer_set(uint16_t default_layer) {
187 eeconfig_update_default_layer(default_layer);
188 default_layer_set(default_layer);
189}
190
191bool process_record_user(uint16_t keycode, keyrecord_t *record) {
192 switch (keycode) {
193 case WORKMAN:
194 if (record->event.pressed) {
195 #ifdef AUDIO_ENABLE
196 PLAY_NOTE_ARRAY(tone_workman, false, 0);
197 #endif
198 persistant_default_layer_set(1UL<<_WORKMAN);
199 }
200 return false;
201 break;
202 case DEAD:
203 if (record->event.pressed) {
204 layer_on(_DEAD);
205 set_oneshot_layer(_DEAD, ONESHOT_START);
206 clear_oneshot_layer_state(ONESHOT_PRESSED);
207 }
208 return false;
209 break;
210 case QWERTY:
211 if (record->event.pressed) {
212 #ifdef AUDIO_ENABLE
213 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
214 #endif
215 persistant_default_layer_set(1UL<<_QWERTY);
216 }
217 return false;
218 break;
219 case LOWER:
220 if (record->event.pressed) {
221 layer_on(_LOWER);
222 update_tri_layer(_LOWER, _RAISE, _ADJUST);
223 } else {
224 layer_off(_LOWER);
225 update_tri_layer(_LOWER, _RAISE, _ADJUST);
226 }
227 return false;
228 break;
229 case RAISE:
230 if (record->event.pressed) {
231 layer_on(_RAISE);
232 update_tri_layer(_LOWER, _RAISE, _ADJUST);
233 } else {
234 layer_off(_RAISE);
235 update_tri_layer(_LOWER, _RAISE, _ADJUST);
236 }
237 return false;
238 break;
239 case PLOVER:
240 if (record->event.pressed) {
241 #ifdef AUDIO_ENABLE
242 stop_all_notes();
243 PLAY_NOTE_ARRAY(tone_plover, false, 0);
244 #endif
245 layer_off(_RAISE);
246 layer_off(_LOWER);
247 layer_off(_ADJUST);
248 layer_on(_PLOVER);
249 if (!eeconfig_is_enabled()) {
250 eeconfig_init();
251 }
252 keymap_config.raw = eeconfig_read_keymap();
253 keymap_config.nkro = 1;
254 eeconfig_update_keymap(keymap_config.raw);
255 }
256 return false;
257 break;
258 case EXT_PLV:
259 if (record->event.pressed) {
260 #ifdef AUDIO_ENABLE
261 PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
262 #endif
263 layer_off(_PLOVER);
264 }
265 return false;
266 break;
267 case TOG_PLV:
268 if (record->event.pressed) {
269 register_code(KC_R);
270 register_code(KC_W);
271 register_code(KC_T);
272 register_code(KC_C);
273 register_code(KC_P);
274 register_code(KC_O);
275 clear_keyboard();
276 }
277 return false;
278 break;
279 }
280 return true;
281}
282
283void matrix_init_user(void) {
284 #ifdef AUDIO_ENABLE
285 startup_user();
286 #endif
287}
288
289#ifdef AUDIO_ENABLE
290
291void startup_user()
292{
293 _delay_ms(20); // gets rid of tick
294 PLAY_NOTE_ARRAY(tone_startup, false, 0);
295}
296
297void shutdown_user()
298{
299 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
300 _delay_ms(150);
301 stop_all_notes();
302}
303
304void music_on_user(void)
305{
306 music_scale_user();
307}
308
309void music_scale_user(void)
310{
311 PLAY_NOTE_ARRAY(music_scale, false, 0);
312}
313
314#endif
diff --git a/keyboards/planck/keymaps/jhenahan/readme.md b/keyboards/planck/keymaps/jhenahan/readme.md
new file mode 100644
index 000000000..a80506fc9
--- /dev/null
+++ b/keyboards/planck/keymaps/jhenahan/readme.md
@@ -0,0 +1,41 @@
1# jhenahan's layout
2
3## Layout
4
5The base layer is based on the
6[Workman Dead](https://github.com/ojbucao/Workman/tree/master/mac) layout. The
7primary interaction layer is a slightly modified Workman layout with a 'dead'
8key on the third row under the middle finger. The dead key activates a layer of
9special characters.
10
11## [Layers](http://www.keyboard-layout-editor.com/#/gists/2b875f7d5d76fe4408c0a5b3bd76ddae)
12### Function Layer
13
14This is very slightly modified from the default, mainly just to rearrange the media keys.
15
16### [KWM](https://github.com/koekeishiya/kwm) Interaction Layer
17
18`kwm` is a tiling window manager for OS X. The keys defined in my keymap
19correspond to the settings I use in
20[my `kwmrc` file](https://github.com/jhenahan/dotfiles/blob/master/kwm/kwmrc).
21
22### QWERTY
23
24Just in case.
25
26### [Plover](http://www.openstenoproject.org/plover/)
27
28This layout functions exactly as a Workman layout unless you're running the Plover
29application. Includes a key for toggling Plover while it's running.
30
31Add this in the appropriate section of your `plover.cfg` to allow this altered layout:
32
33``` ini
34[System: English Stenotype]
35keymap[keyboard] = [["#", ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "="]], ["S-", ["q", "a"]], ["T-", ["d"]], ["K-", ["s"]], ["P-", ["r"]], ["W-", ["h"]], ["H-", ["w"]], ["R-", ["t"]], ["A-", ["m"]], ["O-", ["c"]], ["*", ["y", "g", "j", "b"]], ["-E", ["l"]], ["-U", [","]], ["-F", ["f"]], ["-R", ["n"]], ["-P", ["u"]], ["-B", ["e"]], ["-L", ["p"]], ["-G", ["o"]], ["-T", [";"]], ["-S", ["i"]], ["-D", ["BackSpace"]], ["-Z", ["'"]], ["no-op", ["\\", "]", "x", ".", "/"]], ["arpeggiate", ["space"]]]
36```
37
38### Adjust Layer
39
40This layer is only slightly modified from the default to remove Dvorak and
41Colemak and replace them with Workman.