aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Gebhart <e.a.gebhart@gmail.com>2018-06-08 19:06:25 +0200
committerDrashna Jaelre <drashna@live.com>2018-06-08 10:06:25 -0700
commit984621835d929b79a22ef33c0a4e602adb1ecc5b (patch)
tree11637c54105b229f3127b019ff0cc962926fb770
parent03c9deb7456d84a8d8cc31496ae2736305bbafd3 (diff)
downloadqmk_firmware-984621835d929b79a22ef33c0a4e602adb1ecc5b.tar.gz
qmk_firmware-984621835d929b79a22ef33c0a4e602adb1ecc5b.zip
Keyboard that works on Qwerty or Bepo OS keyboards. (#3149)
* New layout. * new dvorak bepo layout. * first commit of new ergodox_ez dvorak keyboard for qwerty and bepo.
-rw-r--r--keyboards/ergodox_ez/keymaps/ericgebhart/keymap.c354
-rw-r--r--keyboards/ergodox_ez/keymaps/ericgebhart/readme.md5
-rwxr-xr-xusers/ericgebhart/config.h33
-rw-r--r--users/ericgebhart/ericgebhart.c637
-rw-r--r--users/ericgebhart/ericgebhart.h429
-rwxr-xr-xusers/ericgebhart/flash-ergodox1
-rw-r--r--users/ericgebhart/readme.md124
-rwxr-xr-xusers/ericgebhart/rules.mk18
-rwxr-xr-xusers/ericgebhart/switch-kbd74
9 files changed, 1675 insertions, 0 deletions
diff --git a/keyboards/ergodox_ez/keymaps/ericgebhart/keymap.c b/keyboards/ergodox_ez/keymaps/ericgebhart/keymap.c
new file mode 100644
index 000000000..bafa30eaf
--- /dev/null
+++ b/keyboards/ergodox_ez/keymaps/ericgebhart/keymap.c
@@ -0,0 +1,354 @@
1/*
2 Copyright 2018 Eric Gebhart <e.a.gebhart@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include "keymap_bepo.h"
18#include "ericgebhart.h"
19
20
21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22
23 [DVORAK] = LAYOUT_wrapper (
24 // left hand
25 KC_GRV, ___NUMBER_L___, DEF_OS_LAYER_SW,
26 KC_LOCK, ___DVORAK_L1___, KC_LBRC,
27 TAB_BKTAB, ___DVORAK_L2___,
28 KC_LSFT, ___DVORAK_L3___, KC_LPRN,
29
30 ___ERGODOX_BOTTOM_LEFT___,
31 ___ERGODOX_THUMB_LEFT___,
32
33 // right hand
34 MDIA_SYMB, ___NUMBER_R___, KC_EQL,
35 KC_RBRC, ___DVORAK_R1___, KC_SLASH,
36 /* */ ___DVORAK_R2___, KC_MINUS,
37 KC_RPRN, ___DVORAK_R3___, KC_RSFT,
38
39 ___ERGODOX_BOTTOM_RIGHT___,
40 ___ERGODOX_THUMB_RIGHT___
41 ),
42
43 [XMONAD] = LAYOUT_wrapper (
44 // left hand
45 ___, ___FUNC_L___, ___,
46 ___, ___DVORAK_L1___, ___,
47 ___, ___DVORAK_L2___,
48 ___, ___DVORAK_L3___, ___,
49
50 ___ERGODOX_BOTTOM_LEFT___,
51 ___ERGODOX_THUMB_LEFT___,
52
53 // right hand
54 ___, ___FUNC_R___, ___,
55 ___, ___DVORAK_R1___, ___,
56 /**/ ___DVORAK_R2___, ___,
57 ___, ___DVORAK_R3___, ___,
58
59 ___ERGODOX_BOTTOM_RIGHT___,
60 ___ERGODOX_THUMB_RIGHT___
61 ),
62
63 [QWERTY] = LAYOUT_wrapper(
64 // left hand
65 KC_GRV, ___NUMBER_L___, DEF_OS_LAYER_SW,
66 KC_LOCK, ___QWERTY_L1___, KC_LBRC,
67 TAB_BKTAB, ___QWERTY_L2___,
68 KC_LSFT, ___QWERTY_L3___, KC_LPRN,
69
70 ___ERGODOX_BOTTOM_LEFT___,
71 ___ERGODOX_THUMB_LEFT___,
72
73 // right hand
74 MDIA_SYMB, ___NUMBER_R___, KC_EQL,
75 KC_RBRC, ___QWERTY_R1___, KC_SLASH,
76 /* */ ___QWERTY_R2___, KC_MINUS,
77 KC_RPRN, ___QWERTY_R3___, KC_RSFT,
78
79 ___ERGODOX_BOTTOM_RIGHT___,
80 ___ERGODOX_THUMB_RIGHT___
81 ),
82
83 [COLEMAK] = LAYOUT_wrapper (
84 // left hand
85 KC_GRV, ___NUMBER_L___, DEF_OS_LAYER_SW,
86 KC_LOCK, ___COLEMAK_L1___, KC_LBRC,
87 TAB_BKTAB, ___COLEMAK_L2___,
88 KC_LSFT, ___COLEMAK_L3___, KC_LPRN,
89
90 ___ERGODOX_BOTTOM_LEFT___,
91 ___ERGODOX_THUMB_LEFT___,
92
93 // right hand
94 MDIA_SYMB, ___NUMBER_R___, KC_EQL,
95 KC_RBRC, ___COLEMAK_R1___, KC_SLASH,
96 /* */ ___COLEMAK_R2___, KC_MINUS,
97 KC_RPRN, ___COLEMAK_R3___, KC_RSFT,
98
99 ___ERGODOX_BOTTOM_RIGHT___,
100 ___ERGODOX_THUMB_RIGHT___
101 ),
102
103 [WORKMAN] = LAYOUT_wrapper (
104 // left hand
105 KC_GRV, ___NUMBER_L___, DEF_OS_LAYER_SW,
106 KC_LOCK, ___WORKMAN_L1___, KC_LBRC,
107 TAB_BKTAB, ___WORKMAN_L2___,
108 KC_LSFT, ___WORKMAN_L3___, KC_LPRN,
109
110 ___ERGODOX_BOTTOM_LEFT___,
111 ___ERGODOX_THUMB_LEFT___,
112
113 // right hand
114 MDIA_SYMB, ___NUMBER_R___, KC_EQL,
115 KC_RBRC, ___WORKMAN_R1___, KC_SLASH,
116 /* */ ___WORKMAN_R2___, KC_MINUS,
117 KC_RPRN, ___WORKMAN_R3___, KC_RSFT,
118
119 ___ERGODOX_BOTTOM_RIGHT___,
120 ___ERGODOX_THUMB_RIGHT___
121 ),
122
123 [NORMAN] = LAYOUT_wrapper(
124 // left hand
125 KC_GRV, ___NUMBER_L___, DEF_OS_LAYER_SW,
126 KC_LOCK, ___NORMAN_L1___, KC_LBRC,
127 TAB_BKTAB, ___NORMAN_L2___,
128 KC_LSFT, ___NORMAN_L3___, KC_LPRN,
129
130 ___ERGODOX_BOTTOM_LEFT___,
131 ___ERGODOX_THUMB_LEFT___,
132
133 // right hand
134 MDIA_SYMB, ___NUMBER_R___, KC_EQL,
135 KC_RBRC, ___NORMAN_R1___, KC_SLASH,
136 /* */ ___NORMAN_R2___, KC_MINUS,
137 KC_RPRN, ___NORMAN_R3___, KC_RSFT,
138
139 ___ERGODOX_BOTTOM_RIGHT___,
140 ___ERGODOX_THUMB_RIGHT___
141 ),
142
143 [DVORAK_ON_BEPO] = LAYOUT_wrapper(
144 // left hand
145 DB_GRV, ___NUMBER_BEPO_L___, DEF_OS_LAYER_SW,
146 KC_LOCK, ___DVORAK_FR_L1___, DB_LBRC,
147 TAB_BKTAB, ___DVORAK_FR_L2___,
148 KC_LSFT, ___DVORAK_FR_L3___, DB_LPRN,
149
150 ___ERGODOX_BOTTOM_LEFT___,
151 ___ERGODOX_THUMB_LEFT___,
152
153
154 // right hand
155 MDIA_SYMB, ___NUMBER_BEPO_R___, DB_EQL,
156 DB_RBRC, ___DVORAK_FR_R1___, DB_SLASH,
157
158 /* */ ___DVORAK_FR_R2___, DB_MINUS,
159 DB_RPRN, ___DVORAK_FR_R3___, KC_RSFT,
160
161 ___ERGODOX_BOTTOM_RIGHT_FR___,
162 ___ERGODOX_THUMB_RIGHT___
163 ),
164
165 [XMONAD_FR] = LAYOUT_wrapper(
166 // left hand
167 ___, ___FUNC_L___, ___,
168 ___, ___DVORAK_FR_L1___, ___,
169 ___, ___DVORAK_FR_L2___,
170 ___, ___DVORAK_FR_L3___, ___,
171
172 ___ERGODOX_BOTTOM_LEFT___,
173 ___ERGODOX_THUMB_LEFT___,
174
175
176 // right hand
177 ___, ___FUNC_R___, ___,
178 ___, ___DVORAK_FR_R1___, ___,
179 /**/ ___DVORAK_FR_R2___, ___,
180 ___, ___DVORAK_FR_R3___, ___,
181
182 ___ERGODOX_BOTTOM_RIGHT_FR___,
183 ___ERGODOX_THUMB_RIGHT___
184 ),
185
186 [BEPO] = LAYOUT_wrapper (
187 // Left hand
188 BP_DLR, ___SYMBOL_BEPO_L___, DEF_OS_LAYER_SW,
189 KC_LOCK, ___BEPO_FR_L1___, DB_LBRC,
190 TAB_BKTAB, ___BEPO_FR_L2___,
191 BP_SFT_T_ECRC, ___BEPO_FR_L3___, DB_RBRC,
192
193 ___ERGODOX_BOTTOM_LEFT___,
194 ___ERGODOX_THUMB_LEFT___,
195
196
197 // Right hand
198 MDIA_SYMB, ___SYMBOL_BEPO_R___, BP_EQL,
199 BP_DCRC, ___BEPO_FR_R1___, BP_W,
200 /* */ ___BEPO_FR_R2___, BP_CCED,
201 BP_C, ___BEPO_FR_R3___, KC_RSFT,
202
203 ___ERGODOX_BOTTOM_RIGHT___,
204 ___ERGODOX_THUMB_RIGHT___
205 ),
206
207 // SYMBOLS
208 [SYMB] = LAYOUT_wrapper(
209 // left hand
210 ___, ___FUNC_L___, ___,
211 ___, ___SYMBOLS_1___, ___,
212 ___, ___SYMBOLS_2___,
213 ___, ___SYMBOLS_3___, ___,
214
215 ___ERGODOX_TRANS_BOTTOM___,
216 ___ERGODOX_TRANS_THUMBS___,
217
218
219 // right hand
220 ___, ___FUNC_R___, KC_F11,
221 ___, KC_UP, ___KEYPAD_1___, KC_F12,
222 /**/ KC_DOWN, ___KEYPAD_2___, KC_TRNS,
223 ___, KC_AMPR, ___KEYPAD_3___, KC_PENT,
224 /* */ ___KEYPAD_4___, ___,
225
226 ___ERGODOX_TRANS_THUMBS___
227 ),
228
229 [SYMB_ON_BEPO] = LAYOUT_wrapper(
230 // left hand
231 ___, ___FUNC_L___, ___,
232 ___, ___SYMBOLS_1_BP___, ___,
233 ___, ___SYMBOLS_2_BP___,
234 ___, ___SYMBOLS_3_BP___, ___,
235
236 ___ERGODOX_TRANS_BOTTOM___,
237 ___ERGODOX_TRANS_THUMBS___,
238
239
240 // right hand
241 ___, ___FUNC_R___, KC_F11,
242 ___, KC_UP, ___KEYPAD_1_BP___, KC_F12,
243 /**/ KC_DOWN, ___KEYPAD_2_BP___, KC_TRNS,
244 ___, KC_AMPR, ___KEYPAD_3_BP___, KC_PENT,
245 /* */ ___KEYPAD_4_BP___, ___,
246
247 ___ERGODOX_TRANS_THUMBS___
248 ),
249
250 // MEDIA AND MOUSE
251 [MDIA] = LAYOUT_wrapper(
252 // left hand
253 ___, ___FUNC_L___, ___,
254 ___MOUSE_BTNS_L___, ___, ___,
255 ___, ___MOUSE_LDUR___, ___,
256 ___, ___MWHEEL_LDUR___, XXX, ___,
257 ___, ___, ___MOUSE_ACCL_012___,
258 ___ERGODOX_TRANS_THUMBS___,
259
260 // right hand
261 ___, ___FUNC_R___, KC_F11,
262 KC_VOLU, ___, ___MUTE_PLAY_STOP___, ___, KC_F12,
263 /* */ KC_PGUP, ___VI_ARROWS___, ___,
264 KC_VOLD, KC_PGDN, ___MOUSE_BTNS_R___,
265 ___ERGODOX_TRANS_BOTTOM___,
266 ___ERGODOX_TRANS_THUMBS___
267 ),
268
269 [LAYERS] = LAYOUT_wrapper(
270 // left hand
271 ___, ___FUNC_L___, ___,
272 XXX, XXX, XXX, ___LAYERS_L1___, XXX, XXX,
273 XXX, XXX, XXX, ___LAYERS_L2___, XXX,
274 XXX, XXX, ___LAYERS_L3___, XXX, XXX,
275 ___, ___, ___LAYERS_L4___,
276 ___ERGODOX_TRANS_THUMBS___,
277
278 // right hand
279 ___, ___FUNC_R___, KC_F11,
280 KC_VOLU, ___, ___MUTE_PLAY_STOP___, ___, KC_F12,
281 /* */ KC_PGUP, ___VI_ARROWS___, ___,
282 KC_VOLD, KC_PGDN, ___MOUSE_BTNS_R___,
283 ___ERGODOX_TRANS_BOTTOM___,
284 ___ERGODOX_TRANS_THUMBS___
285 ),
286};
287
288
289
290// Runs constantly in the background, in a loop.
291void matrix_scan_user(void) {
292
293 uint8_t layer = biton32(layer_state);
294
295 ergodox_board_led_off();
296 ergodox_right_led_1_off();
297 ergodox_right_led_2_off();
298 ergodox_right_led_3_off();
299 if(!on_qwerty())
300 ergodox_right_led_1_on();
301 switch (layer) {
302 //case DVORAK:
303 //ergodox_right_led_1_off();
304 //break;
305 // first led on for a bepo software keyboard layer
306 case DVORAK_ON_BEPO:
307 ergodox_right_led_2_on();
308 break;
309 case BEPO:
310 ergodox_right_led_1_on();
311 ergodox_right_led_1_off();
312 ergodox_right_led_1_on();
313 ergodox_right_led_1_off();
314 ergodox_right_led_1_on();
315 break;
316 case SYMB:
317 ergodox_right_led_3_on();
318 break;
319 case MDIA:
320 ergodox_right_led_3_on();
321 break;
322 case LAYERS:
323 ergodox_right_led_1_on();
324 ergodox_right_led_2_on();
325 ergodox_right_led_3_on();
326 break;
327 default:
328 ergodox_board_led_off();
329 break;
330
331 /* default: */
332 /* // none */
333 /* break; */
334
335 }
336}
337
338
339/*
340 clear_oneshot_mods();
341 set_oneshot_locked_mods(mods);
342 register_mods(mods);
343
344 register_code(action.key.code);
345 unregister_code(action.key.code);
346
347 layer_on(action.layer_tap.val);
348 layer_off(action.layer_tap.val);
349
350 clear_oneshot_locked_mods();
351 clear_oneshot_mods();
352 unregister_mods(mods);
353
354*/
diff --git a/keyboards/ergodox_ez/keymaps/ericgebhart/readme.md b/keyboards/ergodox_ez/keymaps/ericgebhart/readme.md
new file mode 100644
index 000000000..4f71bf39e
--- /dev/null
+++ b/keyboards/ergodox_ez/keymaps/ericgebhart/readme.md
@@ -0,0 +1,5 @@
1Overview
2========
3
4These are my ergodox_ez keymaps. There isn't much here. Go take a look at my Userspace readme.
5That's where all the code is.
diff --git a/users/ericgebhart/config.h b/users/ericgebhart/config.h
new file mode 100755
index 000000000..934c3debb
--- /dev/null
+++ b/users/ericgebhart/config.h
@@ -0,0 +1,33 @@
1#ifndef USERSPACE_CONFIG_H
2#define USERSPACE_CONFIG_H
3
4#include "../../config.h"
5
6// Sets good default for the speed of the mouse.
7#undef MOUSEKEY_INTERVAL
8#undef MOUSEKEY_DELAY
9#undef MOUSEKEY_TIME_TO_MAX
10#undef MOUSEKEY_MAX_SPEED
11
12#define MOUSEKEY_INTERVAL 20
13#define MOUSEKEY_DELAY 100
14#define MOUSEKEY_TIME_TO_MAX 60
15#define MOUSEKEY_MAX_SPEED 7
16
17#undef MOUSEKEY_WHEEL_MAX_SPEED
18#undef MOUSEKEY_WHEEL_TIME_TO_MAX
19#undef MOUSEKEY_WHEEL_DELAY
20
21#define MOUSEKEY_WHEEL_MAX_SPEED 5
22#define MOUSEKEY_WHEEL_TIME_TO_MAX 60
23#define MOUSEKEY_WHEEL_DELAY 100
24
25#undef TAPPING_TOGGLE
26#undef TAPPING_TERM
27#undef IGNORE_MOD_TAP_INTERRUPT
28
29#define TAPPING_TOGGLE 1
30#define TAPPING_TERM 200
31#define IGNORE_MOD_TAP_INTERRUPT
32
33#endif
diff --git a/users/ericgebhart/ericgebhart.c b/users/ericgebhart/ericgebhart.c
new file mode 100644
index 000000000..69aa450e0
--- /dev/null
+++ b/users/ericgebhart/ericgebhart.c
@@ -0,0 +1,637 @@
1/*
2 Copyright 2018 Eric Gebhart <e.a.gebhart@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include "ericgebhart.h"
18
19#include "quantum.h"
20#include "version.h"
21#include "action.h"
22#include "action_layer.h"
23#include "process_keycode/process_tap_dance.h"
24#include "keymap_bepo.h"
25
26float tone_copy[][2] = SONG(SCROLL_LOCK_ON_SOUND);
27float tone_paste[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
28
29static uint16_t copy_paste_timer;
30userspace_config_t userspace_config;
31
32void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
33
34
35// Add reconfigurable functions here, for keymap customization
36// This allows for a global, userspace functions, and continued
37// customization of the keymap. Use _keymap instead of _user
38// functions in the keymaps
39__attribute__ ((weak))
40void matrix_init_keymap(void) {}
41
42__attribute__ ((weak))
43void matrix_scan_keymap(void) {}
44
45__attribute__ ((weak))
46bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
47 return true;
48}
49
50__attribute__ ((weak))
51bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
52 return true;
53}
54
55__attribute__ ((weak))
56uint32_t layer_state_set_keymap (uint32_t state) {
57 return state;
58}
59
60__attribute__ ((weak))
61void led_set_keymap(uint8_t usb_led) {}
62
63// Runs just one time when the keyboard initializes.
64void matrix_init_user(void) {
65 //ACTION_DEFAULT_LAYER_SET(DVORAK) ;
66}
67
68// check default layerstate to see which layer we are on.
69// if (biton32(layer_state) == _DIABLO) { --- current layer
70// if (biton32(default_layer_state) == _DIABLO) { --- current default layer
71// check for left shift on.
72// if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT);
73
74static void switch_default_layer(uint8_t layer) {
75 default_layer_set(1UL<<layer);
76 clear_keyboard();
77}
78
79// so the keyboard remembers which layer it's in after power disconnect.
80/*
81 uint32_t default_layer_state_set_kb(uint32_t state) {
82 eeconfig_update_default_layer(state);
83 return state;
84 }
85*/
86
87// These are the keys for dvorak on bepo. column one is the keycode and mods for
88// the unshifted key, the second column is the keycode and mods for the shifted key.
89// GR is Good Range. It subtracts SAFE_RANGE from the keycode so we can make a
90// reasnably sized array without difficulties. The macro is for the constant declarations
91// the function is for when we use it.
92const uint8_t key_translations[][2][2] = {
93 [GR(DB_1)] = {{BP_DQOT, MOD_LSFT}, {BP_DCRC, MOD_LSFT}},
94 [GR(DB_2)] = {{BP_LGIL, MOD_LSFT}, {BP_AT, MOD_NONE}},
95 [GR(DB_3)] = {{BP_RGIL, MOD_LSFT}, {BP_DLR, MOD_LSFT}},
96 [GR(DB_4)] = {{BP_LPRN, MOD_LSFT}, {BP_DLR, MOD_NONE}},
97 [GR(DB_5)] = {{BP_RPRN, MOD_LSFT}, {BP_PERC, MOD_NONE}},
98 [GR(DB_6)] = {{BP_AT, MOD_LSFT}, {BP_AT, MOD_BIT(KC_RALT)}},
99 [GR(DB_7)] = {{BP_PLUS, MOD_LSFT}, {BP_P, MOD_BIT(KC_RALT)}},
100 [GR(DB_8)] = {{BP_MINS, MOD_LSFT}, {BP_ASTR, MOD_NONE}},
101 [GR(DB_9)] = {{BP_SLASH, MOD_LSFT}, {BP_LPRN, MOD_NONE}},
102 [GR(DB_0)] = {{BP_ASTR, MOD_LSFT}, {BP_RPRN, MOD_NONE}},
103 [GR(DB_GRV)] = {{BP_PERC, MOD_LSFT}, {BP_K, MOD_BIT(KC_RALT)}},
104 [GR(DB_SCOLON)] = {{BP_COMM, MOD_LSFT}, {BP_DOT, MOD_LSFT}},
105 [GR(DB_SLASH)] = {{BP_SLASH, MOD_NONE}, {BP_APOS, MOD_LSFT}},
106 [GR(DB_BACKSLASH)] = {{BP_AGRV, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}},
107 [GR(DB_EQL)] = {{BP_EQL, MOD_NONE}, {BP_PLUS, MOD_NONE}},
108 [GR(DB_COMM)] = {{BP_COMMA, MOD_NONE}, {BP_LGIL, MOD_BIT(KC_RALT)}},
109 [GR(DB_DOT)] = {{BP_DOT, MOD_NONE}, {BP_RGIL, MOD_BIT(KC_RALT)}},
110 [GR(DB_QUOT)] = {{BP_APOS, MOD_NONE}, {BP_DQOT, MOD_NONE}},
111 [GR(DB_MINUS)] = {{BP_MINUS, MOD_NONE}, {KC_SPC, MOD_BIT(KC_RALT)}},
112 [GR(DB_LPRN)] = {{BP_LPRN, MOD_NONE}, {BP_LPRN, MOD_BIT(KC_RALT)}},
113 [GR(DB_RPRN)] = {{BP_RPRN, MOD_NONE}, {BP_RPRN, MOD_BIT(KC_RALT)}},
114 [GR(DB_LBRC)] = {{BP_Y, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}},
115 [GR(DB_RBRC)] = {{BP_X, MOD_BIT(KC_RALT)}, {BP_RPRN, MOD_BIT(KC_RALT)}},
116 // For the symbol layer
117 [GR(DB_HASH)] = {{BP_DLR, MOD_LSFT}, {BP_DLR, MOD_LSFT}},
118 [GR(DB_LCBR)] = {{BP_LPRN, MOD_BIT(KC_RALT)}, {BP_LPRN, MOD_BIT(KC_RALT)}},
119 [GR(DB_RCBR)] = {{BP_LPRN, MOD_BIT(KC_RALT)}, {BP_RPRN, MOD_BIT(KC_RALT)}},
120 [GR(DB_PIPE)] = {{BP_B, MOD_BIT(KC_RALT)}, {BP_B, MOD_BIT(KC_RALT)}},
121 [GR(DB_TILD)] = {{BP_K, MOD_BIT(KC_RALT)}, {BP_K, MOD_BIT(KC_RALT)}},
122 [GR(DB_CIRC)] = {{BP_AT, MOD_BIT(KC_RALT)}, {BP_AT, MOD_BIT(KC_RALT)}},
123 [GR(DB_LESS)] = {{BP_LGIL, MOD_BIT(KC_RALT)}, {BP_LGIL, MOD_BIT(KC_RALT)}},
124 [GR(DB_GRTR)] = {{BP_RGIL, MOD_BIT(KC_RALT)}, {BP_RGIL, MOD_BIT(KC_RALT)}},
125
126
127};
128
129
130uint8_t gr(uint8_t kc){
131 return (kc - SAFE_RANGE);
132}
133// send the right keycode for the right mod.
134// remove the mods we are taking care of,
135// send our keycodes then restore them.
136// all so we can make dvorak keys from bepo keycodes.
137void send_keycode(uint8_t kc){
138 uint8_t tmp_mods = get_mods();
139 bool is_shifted = ( tmp_mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) );
140 //uint8_t key[2][2] = key_translations[GR(kc)];
141 // need to turn of the shift if it is on.
142 unregister_mods((MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)));
143 if(is_shifted){
144 register_mods(SHIFTED_MODS(kc));
145 register_code(SHIFTED_KEY(kc));
146 unregister_code(SHIFTED_KEY(kc));
147 unregister_mods(SHIFTED_MODS(kc));
148 } else{
149 register_mods(UNSHIFTED_MODS(kc));
150 register_code(UNSHIFTED_KEY(kc));
151 unregister_code(UNSHIFTED_KEY(kc));
152 unregister_mods(UNSHIFTED_MODS(kc));
153 }
154 clear_mods();
155 register_mods(tmp_mods);
156}
157
158
159bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160
161// If console is enabled, it will print the matrix position and status of each key pressed
162#ifdef KEYLOGGER_ENABLE
163xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed);
164#endif //KEYLOGGER_ENABLE
165
166// still dont know how to make #&_ And RALT is not ALTGR, That isn't working in the bepo keyboard
167// either. No {} either probably for the same reasons. ALtGR is the key to some of these.
168 switch (keycode) {
169 // Handle the key translations for Dvorak on bepo. It's best if these are the first
170 // enums after SAFE_RANGE.
171 case DB_1:
172 case DB_2:
173 case DB_3:
174 case DB_4:
175 case DB_5:
176 case DB_6:
177 case DB_7:
178 case DB_8:
179 case DB_9:
180 case DB_0:
181 case DB_GRV:
182 case DB_SCOLON:
183 case DB_SLASH:
184 case DB_BACKSLASH:
185 case DB_EQL:
186 case DB_DOT:
187 case DB_COMM:
188 case DB_QUOT:
189 case DB_MINUS:
190 case DB_LPRN:
191 case DB_RPRN:
192 case DB_LBRC:
193 case DB_RBRC:
194 if(record->event.pressed)
195 send_keycode(keycode);
196 unregister_code(keycode);
197 break;
198
199 case KC_QWERTY:
200 if (record->event.pressed) {
201 set_single_persistent_default_layer(QWERTY);
202 }
203 return false;
204 break;
205 case KC_COLEMAK:
206 if (record->event.pressed) {
207 set_single_persistent_default_layer(COLEMAK);
208 }
209 return false;
210 break;
211 case KC_DVORAK:
212 if (record->event.pressed) {
213 set_single_persistent_default_layer(DVORAK);
214 }
215 return false;
216 break;
217 case KC_WORKMAN:
218 if (record->event.pressed) {
219 set_single_persistent_default_layer(WORKMAN);
220 }
221 return false;
222 break;
223
224 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
225 if (!record->event.pressed) {
226 SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
227#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
228 ":dfu"
229#elif defined(BOOTLOADER_HALFKAY)
230 ":teensy"
231#elif defined(BOOTLOADER_CATERINA)
232 ":avrdude"
233#endif // bootloader options
234 SS_TAP(X_ENTER));
235 }
236 return false;
237 break;
238
239
240 case KC_RESET: // Custom RESET code
241 if (!record->event.pressed) {
242 reset_keyboard();
243 }
244 return false;
245 break;
246
247
248 case EPRM: // Resets EEPROM
249 if (record->event.pressed) {
250 eeconfig_init();
251 default_layer_set(1UL<<eeconfig_read_default_layer());
252 layer_state_set(layer_state);
253 }
254 return false;
255 break;
256 case VRSN: // Prints firmware version
257 if (record->event.pressed) {
258 SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
259 }
260 return false;
261 break;
262
263 /* Code has been depreciated
264 case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo
265 if (!record->event.pressed) {
266 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
267 send_string(decoy_secret[keycode - KC_SECRET_1]);
268 }
269 return false;
270 break;
271 */
272
273 // These are a serious of gaming macros.
274 // Only enables for the viterbi, basically,
275 // to save on firmware space, since it's limited.
276#ifdef MACROS_ENABLED
277 case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
278 if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); }
279 return false; break;
280#endif // MACROS_ENABLED
281
282 case KC_CCCV: // One key copy/paste
283 if(record->event.pressed){
284 copy_paste_timer = timer_read();
285 } else {
286 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
287 register_code(KC_LCTL);
288 tap(KC_C);
289 unregister_code(KC_LCTL);
290#ifdef AUDIO_ENABLE
291 PLAY_SONG(tone_copy);
292#endif
293 } else { // Tap, paste
294 register_code(KC_LCTL);
295 tap(KC_V);
296 unregister_code(KC_LCTL);
297#ifdef AUDIO_ENABLE
298 PLAY_SONG(tone_paste);
299#endif
300 }
301 }
302 return false;
303 break;
304 case CLICKY_TOGGLE:
305#ifdef AUDIO_CLICKY
306 userspace_config.clicky_enable = clicky_enable;
307 eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw);
308#endif
309 break;
310#ifdef UNICODE_ENABLE
311 case UC_FLIP: // (╯°□°)╯ ︵ ┻━┻
312 if (record->event.pressed) {
313 register_code(KC_RSFT);
314 tap(KC_9);
315 unregister_code(KC_RSFT);
316 process_unicode((0x256F | QK_UNICODE), record); // Arm
317 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
318 process_unicode((0x25A1 | QK_UNICODE), record); // Mouth
319 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
320 register_code(KC_RSFT);
321 tap(KC_0);
322 unregister_code(KC_RSFT);
323 process_unicode((0x256F | QK_UNICODE), record); // Arm
324 tap(KC_SPC);
325 process_unicode((0x0361 | QK_UNICODE), record); // Flippy
326 tap(KC_SPC);
327 process_unicode((0x253B | QK_UNICODE), record); // Table
328 process_unicode((0x2501 | QK_UNICODE), record); // Table
329 process_unicode((0x253B | QK_UNICODE), record); // Table
330 }
331 return false;
332 break;
333#endif // UNICODE_ENABLE
334
335}
336
337return true;
338 // return process_record_keymap(keycode, record) && process_record_secrets(keycode, record);
339}
340
341void tap_dance_mouse_btns (qk_tap_dance_state_t *state, void *user_data) {
342 switch(state->count){
343 case 1:
344 register_code(KC_BTN1);
345 break;
346 case 2:
347 register_code(KC_BTN2);
348 break;
349 case 3:
350 register_code(KC_BTN3);
351 break;
352 case 4:
353 register_code(KC_BTN4);
354 break;
355 case 5:
356 register_code(KC_BTN5);
357 break;
358 default:
359 break;
360 }
361 reset_tap_dance(state);
362}
363
364// counting on all the qwerty layers to be less than dvorak_on_bepo
365int on_qwerty(){
366 uint8_t deflayer = (biton32(default_layer_state));
367 return (deflayer < DVORAK_ON_BEPO);
368}
369
370void tap_dance_df_bepo_layers_switch (qk_tap_dance_state_t *state, void *user_data) {
371 switch(state->count){
372 case 1:
373 switch_default_layer(DVORAK_ON_BEPO);
374 break;
375 case 2:
376 switch_default_layer(BEPO);
377 break;
378 case 3:
379 layer_invert(LAYERS);
380 break;
381 default:
382 break;
383 }
384 reset_tap_dance(state);
385}
386
387void tap_dance_layer_switch (qk_tap_dance_state_t *state, void *user_data) {
388 switch(state->count){
389 case 1:
390 if(on_qwerty())
391 layer_invert(SYMB);
392 else
393 layer_invert(SYMB_ON_BEPO);
394 break;
395 case 2:
396 layer_invert(MDIA);
397 break;
398 case 3:
399 layer_invert(LAYERS);
400 default:
401 break;
402 }
403 reset_tap_dance(state);
404}
405
406void tap_dance_default_layer_switch (qk_tap_dance_state_t *state, void *user_data) {
407 switch(state->count){
408 case 1:
409 switch_default_layer(DVORAK);
410 break;
411 case 2:
412 switch_default_layer(DVORAK_ON_BEPO);
413 break;
414 case 3:
415 switch_default_layer(BEPO);
416 break;
417 default:
418 break;
419 }
420 reset_tap_dance(state);
421}
422
423// switch the default layer to another qwerty based layer.
424void switch_default_layer_on_qwerty(int count) {
425 switch(count){
426 case 1:
427 switch_default_layer(DVORAK);
428 break;
429 case 2:
430 switch_default_layer(QWERTY);
431 break;
432 case 3:
433 switch_default_layer(COLEMAK);
434 break;
435 case 4:
436 switch_default_layer(WORKMAN);
437 break;
438 case 5:
439 switch_default_layer(NORMAN);
440 break;
441 default:
442 switch_default_layer(DVORAK);
443 break;
444 }
445}
446
447// switch the default layer to another bepo based layer.
448void switch_default_layer_on_bepo(int count) {
449 switch(count){
450 case 1:
451 switch_default_layer(DVORAK_ON_BEPO);
452 break;
453 case 2:
454 switch_default_layer(BEPO);
455 break;
456 default:
457 switch_default_layer(DVORAK_ON_BEPO);
458 break;
459 }
460}
461
462
463// tap to change the default layer. Distinguishes between layers that are based on
464// a qwerty software keyboard and a bepo software keyboard.
465// if shifted, choose layers based on the other software keyboard, otherwise choose only
466// layers that work on the current software keyboard.
467void tap_dance_default_os_layer_switch (qk_tap_dance_state_t *state, void *user_data) {
468 //uint8_t shifted = (get_mods() & MOD_BIT(KC_LSFT|KC_RSFT));
469 bool shifted = ( keyboard_report->mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) );
470 int qwerty = on_qwerty();
471
472
473 // shifted, choose between layers on the other software keyboard
474 if(shifted){
475 if (qwerty)
476 switch_default_layer_on_bepo(state->count);
477 else
478 switch_default_layer_on_qwerty(state->count);
479
480 // not shifted, choose between layers on the same software keyboard
481 } else {
482 if (qwerty)
483 switch_default_layer_on_qwerty(state->count);
484 else
485 switch_default_layer_on_bepo(state->count);
486 }
487
488 reset_tap_dance(state);
489}
490
491
492/* Return an integer that corresponds to what kind of tap dance should be executed.
493 *
494 * How to figure out tap dance state: interrupted and pressed.
495 *
496 * Interrupted: If the state of a dance dance is "interrupted", that means that another key has been hit
497 * under the tapping term. This is typically indicitive that you are trying to "tap" the key.
498 *
499 * Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term
500 * has ended, but the key is still being pressed down. This generally means the key is being "held".
501 *
502 * One thing that is currenlty not possible with qmk software in regards to tap dance is to mimic the "permissive hold"
503 * feature. In general, advanced tap dances do not work well if they are used with commonly typed letters.
504 * For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters.
505 *
506 * Good places to put an advanced tap dance:
507 * z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon
508 *
509 * Criteria for "good placement" of a tap dance key:
510 * Not a key that is hit frequently in a sentence
511 * Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or
512 * in a web form. So 'tab' would be a poor choice for a tap dance.
513 * Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the
514 * letter 'p', the word 'pepper' would be quite frustating to type.
515 *
516 * For the third point, there does exist the 'DOUBLE_SINGLE_TAP', however this is not fully tested
517 *
518 */
519int cur_dance (qk_tap_dance_state_t *state) {
520 if (state->count == 1) {
521 if (state->interrupted || !state->pressed) return SINGLE_TAP;
522 //key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'.
523 else return SINGLE_HOLD;
524 }
525 else if (state->count == 2) {
526 /*
527 * DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
528 * action when hitting 'pp'. Suggested use case for this return value is when you want to send two
529 * keystrokes of the key, and not the 'double tap' action/macro.
530 */
531 if (state->interrupted) return DOUBLE_SINGLE_TAP;
532 else if (state->pressed) return DOUBLE_HOLD;
533 else return DOUBLE_TAP;
534 }
535 //Assumes no one is trying to type the same letter three times (at least not quickly).
536 //If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add
537 //an exception here to return a 'TRIPLE_SINGLE_TAP', and define that enum just like 'DOUBLE_SINGLE_TAP'
538 if (state->count == 3) {
539 if (state->interrupted || !state->pressed) return TRIPLE_TAP;
540 else return TRIPLE_HOLD;
541 }
542 else return 8; //magic number. At some point this method will expand to work for more presses
543}
544//instanalize an instance of 'tap' for the 'x' tap dance.
545static tdtap xtap_state = {
546 .is_press_action = true,
547 .state = 0
548};
549/*
550 This so I can have a single key that acts like LGUI in DVORAK no
551 matter which keymap is my current default.
552 It also allows for the
553 shift gui and ctl gui, on the same key, So the same key is Escape,
554 and the mostcommon modifiers in my xmonad control keymap, while also
555 insuring that dvorak is active for the xmonad command key
556 Single tap = ESC
557 tap and hold = dvorak with L_GUI
558 double tap = One shot dvorak layer with LSFT LGUI mods
559 double hold = dvorak with LCTL LGUI
560 double single tap = esc.
561*/
562int get_xmonad_layer(){
563 int qwerty = on_qwerty();
564
565 if (qwerty)
566 return(XMONAD);
567 else
568 return(XMONAD_FR);
569}
570
571
572void x_finished (qk_tap_dance_state_t *state, void *user_data) {
573 int xmonad_layer = get_xmonad_layer();
574 xtap_state.state = cur_dance(state);
575 switch (xtap_state.state) {
576 case SINGLE_TAP:
577 register_code(KC_ESC);
578 break;
579 case SINGLE_HOLD:
580 layer_on(xmonad_layer);
581 set_oneshot_mods (MOD_LGUI);
582 //set_oneshot_layer (DVORAK, ONESHOT_START);
583 break;
584 case DOUBLE_TAP:
585 set_oneshot_mods ((MOD_LCTL | MOD_LGUI));
586 layer_on (xmonad_layer);
587 set_oneshot_layer (xmonad_layer, ONESHOT_START);
588 break;
589 case DOUBLE_HOLD:
590 set_oneshot_mods (MOD_LSFT | MOD_LGUI);
591 if (xmonad_layer != -1)
592 layer_on(xmonad_layer);
593 break;
594 case DOUBLE_SINGLE_TAP:
595 register_code(KC_ESC);
596 unregister_code(KC_ESC);
597 register_code(KC_ESC);
598 //Last case is for fast typing. Assuming your key is `f`:
599 //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`.
600 //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms.
601 }
602}
603
604void x_reset (qk_tap_dance_state_t *state, void *user_data) {
605 int xmonad_layer = get_xmonad_layer();
606 switch (xtap_state.state) {
607 case SINGLE_TAP:
608 unregister_code(KC_ESC);
609 break;
610 case SINGLE_HOLD:
611 layer_off(xmonad_layer);
612 break;
613 case DOUBLE_TAP:
614 set_oneshot_layer (xmonad_layer, ONESHOT_PRESSED);
615 break;
616 case DOUBLE_HOLD:
617 layer_off(xmonad_layer);
618 break;
619 case DOUBLE_SINGLE_TAP:
620 unregister_code(KC_ESC);
621 }
622 xtap_state.state = 0;
623}
624
625//Tap Dance Definitions
626qk_tap_dance_action_t tap_dance_actions[] = {
627 //Tap once for Esc, twice for Caps Lock
628 [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
629 [TD_TAB_BKTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LSFT(KC_TAB)),
630 [TD_MDIA_SYMB] = ACTION_TAP_DANCE_FN(tap_dance_layer_switch),
631 [TD_DVORAK_BEPO] = ACTION_TAP_DANCE_FN(tap_dance_df_bepo_layers_switch),
632 [TD_DEF_LAYER_SW] = ACTION_TAP_DANCE_FN(tap_dance_default_layer_switch),
633 [TD_DEF_OS_LAYER_SW] = ACTION_TAP_DANCE_FN(tap_dance_default_os_layer_switch),
634 [TD_HOME_END] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END),
635 [TD_XMONAD_ESC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset),
636 [TD_MOUSE_BTNS] = ACTION_TAP_DANCE_FN(tap_dance_mouse_btns)
637};
diff --git a/users/ericgebhart/ericgebhart.h b/users/ericgebhart/ericgebhart.h
new file mode 100644
index 000000000..6eb11ddfc
--- /dev/null
+++ b/users/ericgebhart/ericgebhart.h
@@ -0,0 +1,429 @@
1/*
2 Copyright 2018 Eric Gebhart <e.a.gebhart@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18
19#ifndef ericgebhart
20#define ericgebhart
21
22#include "quantum.h"
23#include "process_keycode/process_tap_dance.h"
24
25
26void tap(uint16_t keycode);
27bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
28
29
30#define EECONFIG_USERSPACE (uint8_t *)19
31
32typedef union {
33 uint8_t raw;
34 struct {
35 bool clicky_enable :1;
36 bool rgb_layer_change :1;
37 bool is_overwatch :1;
38 bool nuke_switch :1;
39 };
40} userspace_config_t;
41
42#define ___ KC_TRNS
43#define XXX KC_NO
44
45// The most portable copy/paste keys (windows (mostly), linux, and some terminal emulators).
46#define MK_CUT LSFT(KC_DEL) // shift + delete
47#define MK_COPY LCTL(KC_INS) // ctrl + insert
48#define MK_PASTE LSFT(KC_INS) // shift + insert
49
50
51#define DVORAK 0 // dvorak layout (default)
52#define QWERTY 1
53#define COLEMAK 2
54#define WORKMAN 3
55#define NORMAN 4
56// bepo layers
57#define DVORAK_ON_BEPO 6 // dvorak layout (default)
58#define BEPO 7 // Bepo
59// non-default layers
60#define SYMB 8 // symbols and numbers
61#define SYMB_ON_BEPO 9 // symbols and numbers
62#define MDIA 10 // mouse knd media eys
63#define LAYERS 11 // layers and right mousekeys.
64#define XMONAD 12 // xmonad ie. dvorak.
65#define XMONAD_FR 13 // xmonad ie. dvorak.
66
67
68// for the creation of dvorak keys on an Bepo keyboard at the OS layer.
69
70// so we can create an array of reasonable size
71// for our translation keys. We have to create a
72// good range of numbers
73#define GR(x) (x-SAFE_RANGE)
74
75uint8_t gr(uint8_t);
76void send_keycode(uint8_t);
77
78#define MOD_NONE 0x00
79
80// indexs for the keycode translation table.
81#define UNSHIFTED_KEY(key) key_translations[gr(key)][0][0]
82#define UNSHIFTED_MODS(key) key_translations[gr(key)][0][1]
83#define SHIFTED_KEY(key) key_translations[gr(key)][1][0]
84#define SHIFTED_MODS(key) key_translations[gr(key)][1][1]
85
86
87enum userspace_custom_keycodes {
88 // keep the keycodes using the send_key function close to SAFE_RANGE
89 // so the array of keycodes remains a reasonbale size.
90 DB_1 = SAFE_RANGE, // can always be here
91 DB_2,
92 DB_3,
93 DB_4,
94 DB_5,
95 DB_6,
96 DB_7,
97 DB_8,
98 DB_9,
99 DB_0,
100 DB_GRV,
101 DB_SCOLON,
102 DB_SLASH,
103 DB_BACKSLASH,
104 DB_EQL,
105 DB_DOT,
106 DB_COMM,
107 DB_QUOT,
108 DB_MINUS,
109 DB_RPRN,
110 DB_LPRN,
111 DB_RBRC,
112 DB_LBRC,
113 // for symbols layer
114 DB_HASH,
115 DB_LCBR,
116 DB_RCBR,
117 DB_PIPE,
118 DB_TILD,
119 DB_CIRC,
120 DB_LESS,
121 DB_GRTR,
122 // End of dvorak on bepo translation keys.
123
124 EPRM,
125 VRSN,
126 KC_DVORAK_ON_BEPO,
127 KC_BEPO,
128 KC_NORMAN,
129 KC_QWERTY,
130 KC_COLEMAK,
131 KC_DVORAK,
132 KC_WORKMAN,
133 KC_MAKE,
134 KC_RESET,
135 KC_RGB_T,
136 KC_SECRET_1,
137 KC_SECRET_2,
138 KC_SECRET_3,
139 KC_SECRET_4,
140 KC_SECRET_5,
141 KC_CCCV
142};
143
144#define SFTGUI_T(kc) { MT(MOD_LGUI | MOD_LSFT, kc) }
145#define SFT_GUI_ESC MT(MOD_LSFT | MOD_LGUI, KC_PGDN) // shift LGUI or Escape.
146#define ALT_ENT ALT_T(KC_ENT) // Alt or enter
147#define CTL_SPC CTL_T(KC_SPC) // ctrl or space
148#define CTL_BSPC CTL_T(KC_BSPC) // ctrl or backspace
149#define ALT_DEL ALT_T(KC_DEL) // Alt or delete
150#define GUI_ESC GUI_T(KC_ESC) // Gui or escape
151#define ALGR_SYMB ALGR_T(TG(SYMB)) // Alt gre or toggle symbol layer
152
153#define KC_SFT_T_U SFT_T(KC_U)
154#define KC_SFT_T_H SFT_T(KC_H)
155#define KC_LT_SYMB_I LT(SYMB, KC_I)
156#define KC_LT_SYMB_D LT(SYMB, KC_D)
157
158// for dvorak on bepo
159#define BP_SFT_T_U SFT_T(BP_U)
160#define BP_SFT_T_H SFT_T(BP_H)
161#define BP_LT_SYMB_D LT(SYMB, BP_D)
162
163
164// for bepo on bepo
165#define BP_SFT_T_T SFT_T(BP_T)
166#define BP_LT_SYMB_C LT(SYMB_ON_BEPO, BP_C)
167#define BP_LT_SYMB_I LT(SYMB_ON_BEPO, BP_I)
168#define BP_SFT_T_E SFT_T(BP_E)
169#define BP_SFT_T_ECRC SFT_T(BP_ECRC)
170#define BP_SFT_T_CCED SFT_T(BP_CCED)
171#define BP_LT_SYMB_COMM LT(SYMB,BP_COMM)
172
173// OSM keycodes, to keep things clean and easy to change
174#define KC_MLSF OSM(MOD_LSFT)
175#define KC_MRSF OSM(MOD_RSFT)
176#define OS_LGUI OSM(MOD_LGUI)
177#define OS_RGUI OSM(MOD_RGUI)
178#define OS_LSFT OSM(MOD_LSFT)
179#define OS_RSFT OSM(MOD_RSFT)
180#define OS_LCTL OSM(MOD_LCTL)
181#define OS_RCTL OSM(MOD_RCTL)
182#define OS_LALT OSM(MOD_LALT)
183#define OS_RALT OSM(MOD_RALT)
184#define ALT_APP ALT_T(KC_APP)
185
186#define MG_NKRO MAGIC_TOGGLE_NKRO
187
188
189//// TAP DANCE
190
191typedef struct {
192 bool is_press_action;
193 int state;
194} tdtap;
195
196enum {
197 SINGLE_TAP = 1,
198 SINGLE_HOLD = 2,
199 DOUBLE_TAP = 3,
200 DOUBLE_HOLD = 4,
201 DOUBLE_SINGLE_TAP = 5, //send two single taps
202 TRIPLE_TAP = 6,
203 TRIPLE_HOLD = 7
204 };
205
206 //Tap Dance Declarations
207 enum {
208 TD_ESC_CAPS = 0,
209 TD_TAB_BKTAB = 1,
210 TD_MDIA_SYMB = 2,
211 TD_HOME_END = 3,
212 TD_XMONAD_ESC = 4,
213 TD_DEF_LAYER_SW = 5,
214 TD_DEF_OS_LAYER_SW = 6,
215 TD_MOUSE_BTNS = 7,
216 TD_DVORAK_BEPO = 8
217 };
218
219
220// Tap dance
221#define TAB_BKTAB TD(TD_TAB_BKTAB) // Tab or backtab tapdance.
222#define MDIA_SYMB TD(TD_MDIA_SYMB) // MDIA or Symb layer tapdance toggle.
223#define DEF_LAYER_SW TD(TD_DEF_LAYER_SW) // dvorak, dvorak_on_bepo, bepo default layer
224#define DEF_OS_LAYER_SW TD(TD_DEF_OS_LAYER_SW) // dvorak, dvorak_on_bepo, bepo default layer
225#define HOME_END TD(TD_HOME_END) // home or end tapdance.
226#define XMONAD_ESC TD(TD_XMONAD_ESC) // Escape, dvorak, media or symb. - tap and hold tap dance. 1-4
227#define DVORAK_ET_BEPO TD(TD_DVORAK_BEPO) // Escape, dvorak, media or symb. - tap and hold tap dance. 1-4
228#define TDMOUSE_BTNS TD(TD_MOUSE_BTNS) // hmmm. 1-5
229
230
231int on_qwerty(void);
232int get_xmonad_layer(void);
233int cur_dance (qk_tap_dance_state_t *state);
234
235//for the x tap dance. Put it here so it can be used in any keymap
236void x_finished (qk_tap_dance_state_t *state, void *user_data);
237void x_reset (qk_tap_dance_state_t *state, void *user_data);
238
239
240// Blocks for each of the four major keyboard layouts
241// Organized so we can quickly adapt and modify all of them
242// at once, rather than for each keyboard, one at a time.
243// And this allows for much cleaner blocks in the keymaps.
244// For instance Tap/Hold for Control on all of the layouts
245
246// NOTE: These are all the same length. If you do a search/replace
247// then you need to add/remove underscores to keep the
248// lengths consistent.
249
250// Since our quirky block definitions are basically a list of comma separated
251// arguments, we need a wrapper in order for these definitions to be
252// expanded before being used as arguments to the LAYOUT_xxx macro.
253#if (!defined(LAYOUT) && defined(KEYMAP))
254#define LAYOUT KEYMAP
255#endif
256
257#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)
258#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
259#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__)
260#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
261
262//Dvorak on a qwerty software layer in the OS
263#define ___DVORAK_L1___ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
264#define ___DVORAK_L2___ KC_A, KC_O, KC_E, KC_SFT_T_U, KC_LT_SYMB_I
265#define ___DVORAK_L3___ KC_SCLN, KC_Q, KC_J, KC_K, KC_X
266
267#define ___DVORAK_R1___ KC_F, KC_G, KC_C, KC_R, KC_L
268#define ___DVORAK_R2___ KC_LT_SYMB_D, KC_SFT_T_H, KC_T, KC_N, KC_S
269#define ___DVORAK_R3___ KC_B, KC_M, KC_W, KC_V, KC_Z
270
271
272// Dvorak on fr-bepo software layer in the OS.
273// for dvorak and all the other qwerty like keyboards on bepo
274#define ___NUMBER_BEPO_L___ DB_1, DB_2, DB_3, DB_4, DB_5
275#define ___NUMBER_BEPO_R___ DB_6, DB_7, DB_8, DB_9, DB_0
276
277#define ___DVORAK_FR_L1___ DB_QUOT, DB_COMM, DB_DOT, BP_P, BP_Y
278#define ___DVORAK_FR_L2___ BP_A, BP_O, BP_E, BP_SFT_T_U, BP_LT_SYMB_I
279#define ___DVORAK_FR_L3___ DB_SCOLON, BP_Q, BP_J, BP_K, BP_X
280
281#define ___DVORAK_FR_R1___ BP_F, BP_G, BP_C, BP_R, BP_L
282#define ___DVORAK_FR_R2___ BP_LT_SYMB_D, BP_SFT_T_H, BP_T, BP_N, BP_S
283#define ___DVORAK_FR_R3___ BP_B, BP_M, BP_W, BP_V, BP_Z
284
285
286// Bepo on fr-bepo software layer
287// for bepo on bepo
288#define ___SYMBOL_BEPO_L___ /* BP_DLR */ BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN
289#define ___SYMBOL_BEPO_R___ BP_AT, BP_PLUS, BP_MINS, BP_SLASH, BP_ASTR /* BP_EQL, BP_PERC */
290
291#define ___BEPO_FR_L1___ BP_B, BP_ECUT, BP_P, BP_O, BP_EGRV
292#define ___BEPO_FR_L2___ BP_A, BP_U, BP_I, BP_SFT_T_E, BP_LT_SYMB_COMM
293#define ___BEPO_FR_L3___ /*BP_ECRC*/ BP_AGRV, BP_Y, BP_X, BP_DOT, BP_K
294
295#define ___BEPO_FR_R1___ /* BP_DCRC*/ BP_V, BP_D, BP_L, BP_J, BP_Z //, BP_W
296#define ___BEPO_FR_R2___ /* BP_C */ BP_SFT_T_T, BP_S, BP_R, BP_N, BP_M //BP_CCED
297#define ___BEPO_FR_R3___ BP_APOS, BP_Q, BP_G, BP_H, BP_F
298
299// the bottom rows for keyboards on bepo.
300#define ___ERGODOX_BOTTOM_RIGHT_FR___ KC_UP, KC_DOWN, DB_BACKSLASH, LCTL(BP_V), LCTL(BP_C)
301#define ___ERGODOX_BOTTOM_LEFT_FR___ LCTL(BP_C), LCTL(BP_V), KC_INS, KC_LEFT, KC_RIGHT
302
303// Since we have 7 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN, NORMAN,
304// 2 of them based on a Bepo software keyboard, --- DVORAK_ON_BEPO and BEPO),
305// this allows us to quickly modify the bottom row for all of the layouts
306// so we don't have to alter it 4 times and hope that we haven't missed
307// anything
308#define ___ERGODOX_BOTTOM_LEFT___ LCTL(KC_C), LCTL(KC_V), KC_INS, KC_LEFT, KC_RIGHT
309#define ___ERGODOX_BOTTOM_RIGHT___ KC_UP, KC_DOWN, KC_BSLASH, LCTL(KC_V), LCTL(KC_C)
310
311#define ___ERGODOX_THUMB_LEFT___ \
312 KC_RALT, ALGR_SYMB, \
313 HOME_END, \
314 CTL_BSPC, ALT_DEL, XMONAD_ESC
315
316#define ___ERGODOX_THUMB_RIGHT___ \
317 ALGR_SYMB, TD_MOUSE_BTNS, \
318 KC_PGUP, \
319 KC_PGDN, ALT_ENT, CTL_SPC
320
321#define ___ERGODOX_TRANS_THUMBS___ \
322 ___, ___, \
323 ___, \
324 ___, ___, ___ \
325
326#define ___ERGODOX_TRANS_BOTTOM___ \
327 ___,___,___,___,___
328
329#define ___ERGODOX_TRANS_6_ROW___ \
330 ___,___,___,___,___,___
331
332
333
334// Qwerty based layers that I don't really use.
335#define ___QWERTY_L1___ KC_Q, KC_W, KC_E, KC_R, KC_T
336#define ___QWERTY_L2___ KC_A, KC_S, KC_D, KC_F, KC_G
337#define ___QWERTY_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B
338
339#define ___QWERTY_R1___ KC_Y, KC_U, KC_I, KC_O, KC_P
340#define ___QWERTY_R2___ KC_H, KC_J, KC_K, KC_L, KC_SCLN
341#define ___QWERTY_R3___ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
342
343
344#define ___COLEMAK_L1___ KC_Q, KC_W, KC_F, KC_P, KC_G
345#define ___COLEMAK_L2___ KC_A, KC_R, KC_S, KC_T, KC_D
346#define ___COLEMAK_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B
347
348#define ___COLEMAK_R1___ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
349#define ___COLEMAK_R2___ KC_H, KC_N, KC_E, KC_I, KC_O
350#define ___COLEMAK_R3___ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH
351
352
353#define ___COLEMAK_MOD_DH_L1___ KC_Q, KC_W, KC_F, KC_P, KC_B
354#define ___COLEMAK_MOD_DH_L2___ KC_A, KC_R, KC_S, KC_T, KC_G
355#define ___COLEMAK_MOD_DH_L3___ CTL_T(KC_Z), KC_X, KC_C, KC_D, KC_V
356
357#define ___COLEMAK_MOD_DH_R1___ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
358#define ___COLEMAK_MOD_DH_R2___ KC_M, KC_N, KC_E, KC_I, KC_O
359#define ___COLEMAK_MOD_DH_R3___ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH
360
361
362#define ___WORKMAN_L1___ KC_Q, KC_D, KC_R, KC_W, KC_B
363#define ___WORKMAN_L2___ KC_A, KC_S, KC_H, KC_T, KC_G
364#define ___WORKMAN_L3___ KC_Z, KC_X, KC_M, KC_C, KC_V
365
366#define ___WORKMAN_R1___ KC_J, KC_F, KC_U, KC_P, KC_SCLN
367#define ___WORKMAN_R2___ KC_Y, KC_N, KC_E, KC_O, KC_I
368#define ___WORKMAN_R3___ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH
369
370
371#define ___NORMAN_L1___ KC_Q, KC_W, KC_D, KC_F, KC_K
372#define ___NORMAN_L2___ KC_A, KC_S, KC_E, KC_T, KC_G
373#define ___NORMAN_L3___ KC_Z, KC_X, KC_C, KC_V, KC_B
374
375#define ___NORMAN_R1___ KC_J, KC_U, KC_R, KC_L, KC_SCLN
376#define ___NORMAN_R2___ KC_Y, KC_N, KC_I, KC_O, KC_U
377#define ___NORMAN_R3___ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH
378
379
380// For the top rows. Numbers for most things, symbols for Bepo.
381
382// for everything on qwerty.
383#define ___NUMBER_L___ KC_1, KC_2, KC_3, KC_4, KC_5
384#define ___NUMBER_R___ KC_6, KC_7, KC_8, KC_9, KC_0
385
386// function key rows, works for everyone.
387#define ___FUNC_L___ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
388#define ___FUNC_R___ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
389
390
391// Rows for the auxillary layers.
392
393// The symbol layer is for qwerty. I need another one for Bepo...
394
395// the KC_P? codes don't work for me. I don't use those shifted values anyway.
396#define ___KEYPAD_1___ KC_7, KC_8, KC_9, KC_PSLS
397#define ___KEYPAD_2___ KC_4, KC_5, KC_6, KC_PAST
398#define ___KEYPAD_3___ KC_1, KC_2, KC_3, KC_PMNS
399#define ___KEYPAD_4___ KC_0, KC_DOT, KC_PEQL, KC_PPLS
400
401#define ___KEYPAD_1_BP___ DB_7, DB_8, DB_9, BP_SLASH
402#define ___KEYPAD_2_BP___ DB_4, DB_5, DB_6, BP_ASTR
403#define ___KEYPAD_3_BP___ DB_1, DB_2, DB_3, DB_MINUS
404#define ___KEYPAD_4_BP___ DB_0, DB_DOT, DB_EQL, BP_PLUS
405
406#define ___SYMBOLS_1___ KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE
407#define ___SYMBOLS_2___ KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV
408#define ___SYMBOLS_3___ KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD
409
410#define ___SYMBOLS_1_BP___ KC_EXLM, BP_AT, DB_LCBR, DB_RCBR, DB_PIPE
411#define ___SYMBOLS_2_BP___ DB_HASH, BP_DLR, DB_LPRN, DB_RPRN, DB_GRV
412#define ___SYMBOLS_3_BP___ BP_PERC, DB_CIRC, DB_LBRC, DB_RBRC, DB_TILD
413
414#define ___MOUSE_LDUR___ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R
415#define ___MWHEEL_LDUR___ KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R
416#define ___MOUSE_BTNS_R___ KC_BTN1, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5
417#define ___MOUSE_BTNS_L___ KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1
418#define ___MOUSE_ACCL_012___ KC_ACL0, KC_ACL1, KC_ACL2
419
420#define ___MUTE_PLAY_STOP___ KC_MUTE, KC_MPLY, KC_MSTP
421#define ___VI_ARROWS___ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
422
423#define ___LAYERS_L1___ DF(BEPO), DF(DVORAK_ON_BEPO)
424#define ___LAYERS_L2___ DF(COLEMAK), DF(DVORAK)
425#define ___LAYERS_L3___ DF(QWERTY), DF(NORMAN), DF(WORKMAN)
426#define ___LAYERS_L4___ TO(MDIA), TO(SYMB_ON_BEPO), TO(SYMB)
427
428
429#endif
diff --git a/users/ericgebhart/flash-ergodox b/users/ericgebhart/flash-ergodox
new file mode 100755
index 000000000..945b2b605
--- /dev/null
+++ b/users/ericgebhart/flash-ergodox
@@ -0,0 +1 @@
teensy-loader-cli -mmcu=atmega32u4 -w $1
diff --git a/users/ericgebhart/readme.md b/users/ericgebhart/readme.md
new file mode 100644
index 000000000..cd57735c2
--- /dev/null
+++ b/users/ericgebhart/readme.md
@@ -0,0 +1,124 @@
1Overview
2========
3
4This is my personal userspace. Most of my code exists here. I only have one keymap, and that
5is for an ergodox_ez. There are a lot of layers, 7 of them are default layers. I primarily use
6dvorak and Bepo. I've been using emacs in vi mode for over 23 years. I also us Xmonad as my
7window manager, additionally I've been using a Kinesis advantage keyboard in dvorak for over 20
8years. All of those things tend to color the layouts I have.
9
10The Bepo layer needs some love. It is true to the layout at Bepo.fr, but I find it a little
11cumbersome, and I miss some of my favorite keys.
12
13There are 2 dvorak layers, one for a qwerty OS keyboard, and one for a Bepo OS keyboard.
14There is a symbol/keypad layer for bepo and qwerty. And of course there is a mouse/media layer.
15There are 2 Xmonad layers one for qwerty and one for Bepo. Layer selection happens automatically
16based on your current default layer. I use 2 tap dance keys for layer selection.
17
18There are also Qwerty, Colemak, Workman and Norman layers for qwerty.
19
20
21Keyboard Layout Templates
22-------------------------
23
24I borrowed the idea for the keyboard defines and some of the definitions from @drashna.
25I think it is an awesome idea, It makes consistency between layout definitions so much easier.
26@drashna had this to say about it.
27
28
29This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once.
30
31This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once.
32
33The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance:
34
35`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)`
36
37Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine.
38
39Credit goes to @jola5 for first implementing this awesome idea.
40
41
42Custom Keycodes
43---------------
44
45Keycodes are defined in the ericgebhart.h file and need to be included in the keymap.c files, so that they can be used there. The keymap.c file has very little in it, the most important thing to see there are the keys that are at the ends of each row, ie. the 1st and last key on each row is defined there.
46Everything else is in ericgebhart.h.
47
48Layer Indication
49----------------
50
51The ergodox_ez only has 3 leds, layer indication is pretty lame.
52Currently the first led lights up if the default layer is not qwerty. The symbol and media layers get
53the other 2 leds, and all the leds light up if you are on the "layers" layer.
54I hope I can figure out how to make it better, but I just don't see a way with 3 leds and 11 layers.
55
56
57BEPO vs Qwerty Layers
58---------------------
59
60There are 7 base layers. Dvorak, qwerty, Colemak, Workman, and Norman work on a Qwerty software layer on the OS. Dvorak_on_bepo and Bepo both work on a Bepo software layer on the os.
61Dvorak on qwerty is the default. There is a function in ericgebhart.c which will allow the keyboard
62to persist it's default layer through power down. It is currently commented out.
63
64I don't actually use Qwerty, but it seemed like I should have it,
65@drashna had it along with Colemak, Workman and Norman so I added them
66to my existing dvorak and bepo definitions.
67
68There are two tap dance functions that allow switching the default layers
69and the overlay layers.
70
71The default layers switch according to the current OS keyboard of the current Default layer.
72Shifting the key, causes the selection to use the other OS keyboard selections. ie,
73if you are on qwerty, you get dvorak, qwerty, colemak, workman and norman. If you shift it you get
74dvorak on bepo and bepo. If you are not on qwerty the unshifted taps get dvorak and bepo on bepo.
75
76The other tap dance for layers is for the symbol, mouse and layers layers. The layers layer is just a
77safety layer, knowing I can get to if I screw something up...
78
79XMonad
80---------------------
81
82Additionally there is an advanced tap dance called XMONAD_ESC. One tap is Escape, tap and hold is
83LGUI with the proper XMONAD layer, it is essentially dvorak, for the
84given OS layer. 2 taps is Shift lgui with xmonad, and 2 taps and hold
85is Control LGUI with Xmonad. This allows for the finger patterns for
86Xmonad to remain the same regarless of the keyboard in use. The hold
87versions allow for secondary menu selection in Xmonad, the 2 tap function
88must be for a key that is in the top level keymap of Xmonad. This is how
89many people use xmonad so it's not a real problem. There are plenty of
90keys combinations to choose from with these choices. The function can
91be expanded to 3 taps and 3 tap and hold, and on and on....
92
93I have a few other special keys, for momentary symbols or shift on the home row of each hand.
94
95Also, after using a kinesis for many years I'm very accustomed to the
96space, enter, backspace and delete keys on the thumbs. I've added control
97and alt as a secondary function. These are also the Control and Alt keys
98if held down.
99
100Tap Dance
101--------------------
102
103Additionally there are other tap dance functions, tab-backtab, home-end as well as I few I'm not actually using.
104
105Building and flashing
106-----------------------
107
108```make ergodox_z:ericgebhart``` will compile the code.
109
110I use the teensy-loader cli so that's all I know. There is a script here called flash_ergodox
111
112Use it like this,
113
114```flash-ergodox <path to your hex file>```
115
116then use a paperclip to push the reset button on your keyboard.
117
118Switching the OS keyboard
119-------------------------
120
121This varies from system to system. I use Arch Linux, so I use ```setxkbmap```.
122I've included a helper script which makes it easy to switch between EN and FR Bepo,
123called switch-kbd.
124
diff --git a/users/ericgebhart/rules.mk b/users/ericgebhart/rules.mk
new file mode 100755
index 000000000..2572d2111
--- /dev/null
+++ b/users/ericgebhart/rules.mk
@@ -0,0 +1,18 @@
1USER_NAME := ericgebhart
2SRC += ericgebhart.c
3
4MOUSEKEY_ENABLE = yes # Mouse keys
5EXTRAKEY_ENABLE = yes # Audio control and System control
6COMMAND_ENABLE = yes # Commands for debug and configuration
7NKRO_ENABLE = yes # USB Nkey Rollover - for issues, see github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
8SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard
9KEY_LOCK_ENABLE = yes # Enable the KC_LOCK key
10TAP_DANCE_ENABLE = yes # Enable the tap dance feature.
11CONSOLE_ENABLE = yes # Console for debug
12
13BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
14UNICODE_ENABLE = no
15SLEEP_LED_ENABLE = no
16API_SYSEX_ENABLE = no
17RGBLIGHT_ENABLE = no
18RGBLIGHT_ANIMATION = no
diff --git a/users/ericgebhart/switch-kbd b/users/ericgebhart/switch-kbd
new file mode 100755
index 000000000..4401967a0
--- /dev/null
+++ b/users/ericgebhart/switch-kbd
@@ -0,0 +1,74 @@
1#!/usr/bin/env zsh
2
3# Switch the keyboard to en-us by default, bepo, or en-dvorak.
4
5help(){
6 print 'switch-kbd - helper for setxkbmap'
7 print ' '
8 print 'Change the keyboard to en-us, fr-bepo, or en-dvorak.'
9 print 'Uses setxkbmap, so the change only affects the current'
10 print 'session. This mainly to avoid using a toggle key.'
11 print ' '
12 print ' -b Bepo'
13 print ' -d Dvorak'
14 print ' -n do not execute'
15 print ' -h help text.'
16 print ' '
17 print ' The default is to set the keyboard to en-us.'
18 exit
19}
20
21layout="-layout us"
22variant=""
23let "execute = 1"
24let "verose = 0"
25
26# $opt will hold the current option
27local opt
28while getopts bdnvh opt; do
29 # loop continues till options finished
30 # see which pattern $opt matches...
31 case $opt in
32 (b)
33 layout="-layout fr"
34 variant="-variant bepo"
35 ;;
36
37 (d)
38 layout="-layout en"
39 variant="-variant dvorak"
40 ;;
41 (n)
42 let "execute = 0"
43 ;;
44 (v)
45 let "verbose = 1"
46 ;;
47 (h)
48 help
49 ;;
50 # matches a question mark
51 # (and nothing else, see text)
52 (\?)
53 print "Bad option:" $*
54 print " "
55 help
56 return 1
57 ;;
58 esac
59done
60(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
61##print Remaining arguments are: $*
62
63mycommand='setxkbmap '${layout}' '${variant}
64
65if [[ ( $verbose -ne 0 ) ]]; then;
66 print "setxkbmap Command:" $mycommand
67fi
68
69if [[ ( $execute -ne 0 ) ]]
70then;
71 eval $mycommand
72else;
73 print "did not execute"
74fi