aboutsummaryrefslogtreecommitdiff
path: root/layouts/community/ergodox/zweihander-osx
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/community/ergodox/zweihander-osx')
-rw-r--r--layouts/community/ergodox/zweihander-osx/keymap.c233
-rw-r--r--layouts/community/ergodox/zweihander-osx/readme.markdown47
-rw-r--r--layouts/community/ergodox/zweihander-osx/rules.mk2
3 files changed, 282 insertions, 0 deletions
diff --git a/layouts/community/ergodox/zweihander-osx/keymap.c b/layouts/community/ergodox/zweihander-osx/keymap.c
new file mode 100644
index 000000000..2ace33ee2
--- /dev/null
+++ b/layouts/community/ergodox/zweihander-osx/keymap.c
@@ -0,0 +1,233 @@
1#include QMK_KEYBOARD_H
2#include "debug.h"
3#include "action_layer.h"
4
5#define BASE 0 // default layer
6#define SYMB 1 // symbols
7#define MDIA 2 // media keys
8
9#define SGWK 0 // "sagewick", ⌘S ⌘⇥
10#define SGWF 1 // "sagewick freshly", ⌘S ⌘⇥ ⌘R
11#define BBED 2 // BBEdit
12#define TMNL 3 // Terminal
13#define SAFA 4 // Safari
14#define ALFRED_LEAD_TIME 250 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17/* Keymap 0: Basic layer
18 *
19 * ,--------------------------------------------------. ,--------------------------------------------------.
20 * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - |
21 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
22 * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ |
23 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
24 * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ |
25 * |--------+------+------+------+------+------| L⌘ | | L⌘ |------+------+------+------+------+--------|
26 * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ |
27 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
28 * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | |
29 * `----------------------------------' `----------------------------------'
30 * ,-------------. ,---------------.
31 * | `~ | '" | | ⎋ | ⌫ |
32 * ,------|------|------| |------+--------+------.
33 * | | | PgUp | | PgDn | | |
34 * | | ⇥ |------| |------| ⇥ |Enter |
35 * | | | R⌥ | | R⌃ | | |
36 * `--------------------' `----------------------'
37 */
38// If it accepts an argument (i.e, is a function), it doesn't need KC_.
39// Otherwise, it needs KC_*
40[BASE] = LAYOUT_ergodox( // layer 0 : default
41 // left hand
42 KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB),
43 KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB),
44 KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G,
45 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI,
46 KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT,
47 KC_GRV, KC_QUOT,
48 KC_PGUP,
49 KC_SPC,KC_TAB ,KC_RALT,
50 // right hand
51 TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
52 MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
53 KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
54 KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
55 KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC ,
56 KC_ESC, KC_BSPC,
57 KC_PGDN,
58 KC_RCTL, KC_TAB, KC_ENT
59 ),
60/* Keymap 1: Symbol Layer
61 *
62 * ,--------------------------------------------------. ,--------------------------------------------------.
63 * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
64 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
65 * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 |
66 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
67 * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | |
68 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
69 * | | | | | | = | | | | : | 1 | 2 | 3 | = | |
70 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
71 * | | | | | | | 0 | . | ← | → | |
72 * `----------------------------------' `----------------------------------'
73 * ,-------------. ,-------------.
74 * | | | | | |
75 * ,------|------|------| |------+------+------.
76 * | | | | | | | |
77 * | | |------| |------| | |
78 * | | | | | | | |
79 * `--------------------' `--------------------'
80 */
81// SYMBOLS
82[SYMB] = LAYOUT_ergodox(
83 // left hand
84 KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
85 KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS,
86 KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT,
87 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS,
88 KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
89 KC_TRNS,KC_TRNS,
90 KC_TRNS,
91 KC_TRNS,KC_TRNS,KC_TRNS,
92 // right hand
93 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
94 KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
95 KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
96 KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS,
97 KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS,
98 KC_TRNS, KC_TRNS,
99 KC_TRNS,
100 KC_TRNS, KC_TRNS, KC_TRNS
101),
102/* Keymap 2: Media keys
103 *
104 * ,--------------------------------------------------. ,--------------------------------------------------.
105 * | | F14 | F15 |PrtScr|SclLck| Pause| | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power |
106 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
107 * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | |
108 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
109 * | | |Safari| PgDn | | |------| |------| ⌘[ | ← | ↓ | → | | ⏯ |
110 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
111 * | | | | | |BBEdit| | | | | ⏯ | ⏮ | ⏭ | | |
112 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
113 * | | | | | | |VolUp |VolDn | Mute | | |
114 * `----------------------------------' `----------------------------------'
115 * ,-------------. ,-------------.
116 * | | | | | |
117 * ,------|------|------| |------+------+------.
118 * | | | Home | | End | | |
119 * | | |------| |------| ⌘C | ⌘V |
120 * | | | | | ⌘X | | |
121 * `--------------------' `--------------------'
122 */
123// MEDIA AND MOUSE
124[MDIA] = LAYOUT_ergodox(
125 KC_TRNS, KC_F14 , KC_F15 , KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, /* F14 dims screen, F15 brightens */
126 KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, M(SGWF), M(TMNL), KC_TRNS,
127 KC_TRNS, KC_TRNS, M(SAFA), KC_PGDN, KC_TRNS, KC_TRNS,
128 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(BBED), KC_TRNS,
129 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
130 KC_TRNS, KC_TRNS,
131 KC_HOME,
132 KC_TRNS, KC_TRNS, KC_TRNS,
133 // right hand
134 LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR ,
135 KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS,
136 LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY,
137 KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
138 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
139 KC_TRNS, KC_TRNS,
140 KC_END ,
141 LGUI(KC_X), LGUI(KC_C), LGUI(KC_V)
142),
143};
144
145const uint16_t PROGMEM fn_actions[] = {
146 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
147};
148
149const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
150{
151 // MACRODOWN only works in this function
152 switch(id) {
153 case SGWK:
154 if (record->event.pressed) {
155 return MACRO(
156 I(10),
157 D(LGUI), T(S), U(LGUI),
158 D(LGUI), T(TAB), U(LGUI),
159 END);
160 }
161 break;
162 case SGWF:
163 if (record->event.pressed) {
164 return MACRO(
165 I(10),
166 D(LGUI), T(S), U(LGUI),
167 D(LGUI), T(TAB), U(LGUI),
168 D(LGUI), T(R), U(LGUI),
169 END);
170 }
171 break;
172 case BBED:
173 if (record->event.pressed) {
174 return MACRO(
175 I(10),
176 D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME),
177 T(B), T(B), T(E), T(D), T(I), T(T),
178 T(ENT),
179 END);
180 }
181 break;
182 case TMNL:
183 if (record->event.pressed) {
184 return MACRO(
185 I(10),
186 D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME),
187 T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L),
188 T(ENT),
189 END);
190 }
191 break;
192 case SAFA:
193 if (record->event.pressed) {
194 return MACRO(
195 I(10),
196 D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME),
197 T(S), T(A), T(F), T(A), T(R), T(I),
198 T(ENT),
199 END);
200 }
201 break;
202 }
203 return MACRO_NONE;
204};
205
206// Runs just one time when the keyboard initializes.
207void matrix_init_user(void) {
208
209};
210
211// Runs constantly in the background, in a loop.
212void matrix_scan_user(void) {
213
214 uint8_t layer = biton32(layer_state);
215
216 ergodox_board_led_off();
217 ergodox_right_led_1_off();
218 ergodox_right_led_2_off();
219 ergodox_right_led_3_off();
220 switch (layer) {
221 // TODO: Make this relevant to the ErgoDox EZ.
222 case 1:
223 ergodox_right_led_1_on();
224 break;
225 case 2:
226 ergodox_right_led_2_on();
227 break;
228 default:
229 // none
230 break;
231 }
232
233};
diff --git a/layouts/community/ergodox/zweihander-osx/readme.markdown b/layouts/community/ergodox/zweihander-osx/readme.markdown
new file mode 100644
index 000000000..5125a12ee
--- /dev/null
+++ b/layouts/community/ergodox/zweihander-osx/readme.markdown
@@ -0,0 +1,47 @@
1# The Zweihander Layout
2
3NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “command-backtick”, not “command-backslash-backtick”.
4
5This layout is tuned for people who…
6
7
8## use OS X
9
10While this layout should work fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout.
11
12
13## mouse left-handed while doing other things with the right hand
14
15I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the media layer to speed up browsing in Safari and Finder:
16
17- Close Window (⌘W)
18- Back (⌘[)
19- Forward (⌘])
20- Open and Close Parent Folder (⌥⌘↓)
21- Go Up and Close Just-Left Folder (⌥⌘↑)
22- Cycle through open windows in current application (⌘\` and ⌘⇧\`)
23- Cycle through tabs in current window (⌥⇥ and ⌥⇧⇥)
24
25Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word.
26
27
28## use lots of modifier keys in OS X menu-item shortcuts
29
30I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include:
31
32- Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫)
33- Shut Down Without Asking for Confirmation (⇧⌥⌘ power)
34
35⇧⌥⌘⌫, when you press the backspace on the right half of the keyboard, is much more satisfying than if you curl your left hand into a claw to press all the keys on the left. Try both; you’ll agree.
36
37
38## use Emacs-style shortcuts
39
40I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the control key on the bottom left and I’m too quick on the draw for the control function on the / key to work reliably, so the bottommost thumb button on the right side is another control key.
41
42Having trouble remembering which thumb key is alt and which is ctrl? It’s like on the lower right of a normal keyboard — leftmost is alt, rightmost is ctrl.
43
44
45## use spreadsheets
46
47All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. There’s also a colon there for entering times and maybe IPv6 addresses. Not that I expect people to type IPv6 addresses into a spreadsheet, but, y’know.
diff --git a/layouts/community/ergodox/zweihander-osx/rules.mk b/layouts/community/ergodox/zweihander-osx/rules.mk
new file mode 100644
index 000000000..6e3d088a4
--- /dev/null
+++ b/layouts/community/ergodox/zweihander-osx/rules.mk
@@ -0,0 +1,2 @@
1# Don’t do a tricolor wave when the computer is shut down in Windows
2SLEEP_LED_ENABLE = no