aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--docs/feature_advanced_keycodes.md4
-rw-r--r--keyboards/nyquist/keymaps/333fred/README.md8
-rw-r--r--keyboards/nyquist/keymaps/333fred/keymap.c57
-rw-r--r--keyboards/nyquist/keymaps/333fred/rules.mk3
-rw-r--r--layouts/community/ergodox/333fred/README.md23
-rw-r--r--layouts/community/ergodox/333fred/keymap.c52
-rw-r--r--layouts/community/ergodox/333fred/rules.mk1
-rw-r--r--users/333fred/333fred.c63
-rw-r--r--users/333fred/333fred.h22
-rw-r--r--users/333fred/rules.mk2
11 files changed, 163 insertions, 73 deletions
diff --git a/.gitignore b/.gitignore
index a91b62a5a..90f29a297 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@ cmake-build-debug
46*.stackdump 46*.stackdump
47util/Win_Check_Output.txt 47util/Win_Check_Output.txt
48# Let these ones be user specific, since we have so many different configurations 48# Let these ones be user specific, since we have so many different configurations
49.vscode/c_cpp_properties.json
49.vscode/launch.json 50.vscode/launch.json
50.vscode/tasks.json 51.vscode/tasks.json
51.vscode/last.sql 52.vscode/last.sql
diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md
index 95a20340e..d49efdc1a 100644
--- a/docs/feature_advanced_keycodes.md
+++ b/docs/feature_advanced_keycodes.md
@@ -49,6 +49,8 @@ Once you have a good feel for how layers work and what you can do, you can get m
49 49
50Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem. 50Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.
51 51
52Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](../tmk_core/common/action_layer.h).
53
52# Modifier keys 54# Modifier keys
53 55
54These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent. 56These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent.
@@ -145,6 +147,8 @@ You can control the behavior of one shot keys by defining these in `config.h`:
145* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes. 147* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
146* `OSL(layer)` - momentary switch to *layer*. 148* `OSL(layer)` - momentary switch to *layer*.
147 149
150Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](../tmk_core/common/action.c#L429).
151
148## Permissive Hold 152## Permissive Hold
149 153
150As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: 154As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
diff --git a/keyboards/nyquist/keymaps/333fred/README.md b/keyboards/nyquist/keymaps/333fred/README.md
index cc35aff19..aa783af07 100644
--- a/keyboards/nyquist/keymaps/333fred/README.md
+++ b/keyboards/nyquist/keymaps/333fred/README.md
@@ -5,7 +5,7 @@ This nyquist layout is based on my Ergodox Infinity Layout, which is [here](../.
5## Layers 5## Layers
6 6
7### QWERTY 7### QWERTY
8The shift modifiers on this layer all use OSM to allow for quick single capitalization. Press and hold F to go to the VIM movement layer. Layer is also a one-shot layer toggle, and can be held down to type multiple characters on the Lower layer. Game is a regular toggle layer. 8The shift modifiers on this layer all use OSM to allow for quick single capitalization. LwrVIM acts a combo one-shot toggle and momentary layer toggle. Tap once to make the next key be sent on the Lower. Hold to move to the Lower layer until release. Tap and hold (so press, release, press and hold) to move to the VIM layer until release. Game is a regular toggle layer.
9 9
10``` 10```
11Qwerty 11Qwerty
@@ -14,11 +14,11 @@ Qwerty
14|------+------+------+------+------+------+------+------+------+------+------+------| 14|------+------+------+------+------+------+------+------+------+------+------+------|
15| Tab | Q | W | E | R | T | Y | U | I | O | P | \ | 15| Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
16|------+------+------+------+------+-------------+------+------+------+------+------| 16|------+------+------+------+------+-------------+------+------+------+------+------|
17| Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | 17| Esc | A | S | D | F | G | H | J | K | L | ; | " |
18|------+------+------+------+------+------|------+------+------+------+------+------| 18|------+------+------+------+------+------|------+------+------+------+------+------|
19| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| 19| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift|
20|------+------+------+------+------+------+------+------+------+------+------+------| 20|------+------+------+------+------+------+------+------+------+------+------+------|
21| Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Lock | = | Game | Del | 21| Ctrl | Alt | F4 | GUI |LwrVIM| Bksp | Spc | Ent | Lock | = | RAlt | Del |
22`-----------------------------------------------------------------------------------' 22`-----------------------------------------------------------------------------------'
23``` 23```
24 24
@@ -36,7 +36,7 @@ Lower
36|------+------+------+------+------+------|------+------+------+------+------+------| 36|------+------+------+------+------+------|------+------+------+------+------+------|
37| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | 37| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ |
38|------+------+------+------+------+------+------+------+------+------+------+------| 38|------+------+------+------+------+------+------+------+------+------+------+------|
39| Pscr | | | | | | 0 | . | = | Prev | Next | Play | 39| Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play |
40`-----------------------------------------------------------------------------------' 40`-----------------------------------------------------------------------------------'
41``` 41```
42 42
diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c
index dfbcd5285..ab47336a2 100644
--- a/keyboards/nyquist/keymaps/333fred/keymap.c
+++ b/keyboards/nyquist/keymaps/333fred/keymap.c
@@ -1,20 +1,18 @@
1#include "nyquist.h" 1#include "nyquist.h"
2#include "action_layer.h" 2#include "action_layer.h"
3#include "action_util.h"
3#include "eeconfig.h" 4#include "eeconfig.h"
5#include "333fred.h"
4 6
5extern keymap_config_t keymap_config; 7extern keymap_config_t keymap_config;
6 8
7#define _QWERTY 0
8#define _LOWER 1
9#define _VIM 2
10#define _GAME 3
11
12enum custom_macros { 9enum custom_macros {
13 DLEFT, 10 DLEFT,
14 DRIGHT, 11 DRIGHT,
15 PSCREEN_APP 12 PSCREEN_APP
16}; 13};
17 14
15// Tap dance for layer transitions
18// Fillers to make layering more clear 16// Fillers to make layering more clear
19#define _______ KC_TRNS 17#define _______ KC_TRNS
20#define XXXXXXX KC_NO 18#define XXXXXXX KC_NO
@@ -27,22 +25,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 * |------+------+------+------+------+------+------+------+------+------+------+------| 25 * |------+------+------+------+------+------+------+------+------+------+------+------|
28 * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | 26 * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
29 * |------+------+------+------+------+-------------+------+------+------+------+------| 27 * |------+------+------+------+------+-------------+------+------+------+------+------|
30 * | Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | 28 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
31 * |------+------+------+------+------+------|------+------+------+------+------+------| 29 * |------+------+------+------+------+------|------+------+------+------+------+------|
32 * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| 30 * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift|
33 * |------+------+------+------+------+------+------+------+------+------+------+------| 31 * |------+------+------+------+------+------+------+------+------+------+------+------|
34 * | Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Alt | + | Game | Del | 32 * | Ctrl | Alt | F4 | GUI |Lwr/VM| Bksp | Spc | Ent | Lock | = | Alt | Del |
35 * `-----------------------------------------------------------------------------------' 33 * `-----------------------------------------------------------------------------------'
36 */ 34 */
37[_QWERTY] = KEYMAP( \ 35[BASE] = KEYMAP( \
38 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ 36 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \
39 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ 37 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \
40 KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ 38 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
41 OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ 39 OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \
42 KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, TG(_GAME), KC_DEL \ 40 KC_LCTL, KC_LALT, KC_F4, KC_LGUI, TD(TD_SYM_VIM), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, KC_RALT, KC_DEL \
43), 41),
44 42
45/* Lower 43/* Symbols
46 * ,-----------------------------------------------------------------------------------. 44 * ,-----------------------------------------------------------------------------------.
47 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | 45 * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
48 * |------+------+------+------+------+-------------+------+------+------+------+------| 46 * |------+------+------+------+------+-------------+------+------+------+------+------|
@@ -52,36 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
52 * |------+------+------+------+------+------|------+------+------+------+------+------| 50 * |------+------+------+------+------+------|------+------+------+------+------+------|
53 * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | 51 * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ |
54 * |------+------+------+------+------+------+------+------+------+------+------+------| 52 * |------+------+------+------+------+------+------+------+------+------+------+------|
55 * | Pscr | | | | | | 0 | . | = | Prev | Next | Play | 53 * | Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play |
56 * `-----------------------------------------------------------------------------------' 54 * `-----------------------------------------------------------------------------------'
57 */ 55 */
58[_LOWER] = KEYMAP( \ 56[SYMB] = KEYMAP( \
59 KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ 57 KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \
60 _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ 58 _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \
61 _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ 59 _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \
62 M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ 60 M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \
63 KC_PSCR, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ 61 KC_PSCR, _______, _______, _______, _______, TG(GAME), KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \
64), 62),
65 63
66/* Vim Movement (Hold down F) 64/* Vim Movement (Hold down F)
67 * ,-----------------------------------------------------------------------------------. 65 * ,-----------------------------------------------------------------------------------.
68 * | | | | | | | | | | | | | 66 * | | | | | | | | | | | | |
69 * |------+------+------+------+------+------+------+------+------+------+------+------| 67 * |------+------+------+------+------+------+------+------+------+------+------+------|
70 * | | | | | | | | | | | | | 68 * | | | | LSHFT| | | | | | | | |
71 * |------+------+------+------+------+------+------+------+------+------+------+------| 69 * |------+------+------+------+------+------+------+------+------+------+------+------|
72 * | | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | 70 * | | DLeft|DRight| LCTRL| LGUI | | Left | Down | Up | Right| | |
73 * |------+------+------+------+------+------+------+------+------+------+------+------| 71 * |------+------+------+------+------+------+------+------+------+------+------+------|
74 * | | | | | | | | | | | | | 72 * | | | | | | | | | | | | |
75 * |------+------+------+------+------+------+------+------+------+------+------+------| 73 * |------+------+------+------+------+------+------+------+------+------+------+------|
76 * | | | | | LShft| | | | | | | | 74 * | | | | | | | | | | | | |
77 * `-----------------------------------------------------------------------------------' 75 * `-----------------------------------------------------------------------------------'
78 */ 76 */
79[_VIM] = KEYMAP( \ 77[VIM] = KEYMAP( \
80 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 78 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
79 _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, \
80 _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \
81 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 81 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
82 _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ 82 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
83 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
84 _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \
85), 83),
86 84
87/* Gaming mode (Raise) 85/* Gaming mode (Raise)
@@ -98,12 +96,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
98 * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| 96 * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY|
99 * `-----------------------------------------------------------------------------------' 97 * `-----------------------------------------------------------------------------------'
100 */ 98 */
101[_GAME] = KEYMAP( \ 99[GAME] = KEYMAP( \
102 KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 100 KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
103 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 101 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
104 KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ 102 KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \
105 KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ 103 KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \
106 KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(_LOWER), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(_QWERTY) \ 104 KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \
107) 105)
108 106
109}; 107};
@@ -133,3 +131,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
133 } 131 }
134 return MACRO_NONE; 132 return MACRO_NONE;
135} 133}
134
135bool process_record_user(uint16_t keycode, keyrecord_t *record) {
136 tap_dance_process_record(keycode);
137 return true;
138}
diff --git a/keyboards/nyquist/keymaps/333fred/rules.mk b/keyboards/nyquist/keymaps/333fred/rules.mk
index f85443280..5a3543a6f 100644
--- a/keyboards/nyquist/keymaps/333fred/rules.mk
+++ b/keyboards/nyquist/keymaps/333fred/rules.mk
@@ -1,6 +1,7 @@
1KEY_LOCK_ENABLE = yes 1KEY_LOCK_ENABLE = yes
2NKRO_ENABLE = yes 2NKRO_ENABLE = yes
3CONSOLE_ENABLE = yes 3CONSOLE_ENABLE = no
4TAP_DANCE_ENABLE = yes
4 5
5ifndef QUANTUM_DIR 6ifndef QUANTUM_DIR
6 include ../../../../Makefile 7 include ../../../../Makefile
diff --git a/layouts/community/ergodox/333fred/README.md b/layouts/community/ergodox/333fred/README.md
index f7b4ca42f..8286de173 100644
--- a/layouts/community/ergodox/333fred/README.md
+++ b/layouts/community/ergodox/333fred/README.md
@@ -5,24 +5,23 @@
5,--------------------------------------------------. ,--------------------------------------------------. 5,--------------------------------------------------. ,--------------------------------------------------.
6| ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | 6| ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - |
7|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 7|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
8| TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | 8| TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ |
9|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 9|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
10| Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L |; / : | ' | 10| Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
11|--------+------+------+------+------+------| L1 | |TT(3) |------+------+------+------+------+--------| 11|--------+------+------+------+------+------| L2 | |TT(3) |------+------+------+------+------+--------|
12| LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | 12| LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
13`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 13`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
14 |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | 14 |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI |
15 `----------------------------------' `----------------------------------' 15 `----------------------------------' `----------------------------------'
16 ,-------------. ,-------------. 16 ,-------------. ,-------------.
17 | Copy | Paste| | Alt |Ctrl/Esc| 17 | Copy | Paste| | Copy | Paste |
18 ,------|------|------| |------+--------+------. 18 ,------|------|------| |------+--------+------.
19 | | | PgUp | | PgDn | | | 19 | | | PgUp | | PgDn | | |
20 | Bcksp|OSL(2)|------| |------| Ent |Space | 20 | Bcksp|OSL(2)|------| |------| Ent |Space |
21 | | | Del | |OSL(2)| | | 21 | | VIM | Del | |OSL(2)| | |
22 `--------------------' `----------------------' 22 `--------------------' `----------------------'
23``` 23```
24* Double-click `;` to get a `:` 24* For a single tap or single hold, OSL behaves like OSL(SYMB). For a tap + hold, it behaves like MO(VIM).
25* Press-and-hold `f` to go to the movement layer
26 25
27### Keymap 1: Code Layer 26### Keymap 1: Code Layer
28``` 27```
@@ -38,7 +37,7 @@
38 | | | | | | | F12 |GoToIm| FAR | | | 37 | | | | | | | F12 |GoToIm| FAR | | |
39 `----------------------------------' `----------------------------------' 38 `----------------------------------' `----------------------------------'
40 ,-------------. ,---------------. 39 ,-------------. ,---------------.
41 |Format|Build | | Test | DTest | 40 |Format|Build | | Copy | Paste |
42 ,------|------|------| |------+--------+------. 41 ,------|------|------| |------+--------+------.
43 | | |Refact| |Sort U| | | 42 | | |Refact| |Sort U| | |
44 | | |------| |------| | | 43 | | |------| |------| | |
@@ -46,13 +45,11 @@
46 `--------------------' `----------------------' 45 `--------------------' `----------------------'
47``` 46```
48* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` 47* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B`
49* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T`
50* FAR - Visual Studio Find All References. Sends `CTRL + K, R` 48* FAR - Visual Studio Find All References. Sends `CTRL + K, R`
51* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D` 49* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D`
52* GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12` 50* GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12`
53* Refact - Visual Studio Refactor. Sends `CTRL + R, R` 51* Refact - Visual Studio Refactor. Sends `CTRL + R, R`
54* Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G` 52* Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G`
55* Test - Visual Studio Run Test. Sends `CTRL + R, T`
56 53
57 54
58### Keymap 2: Symbol Layer 55### Keymap 2: Symbol Layer
@@ -105,9 +102,9 @@
105,--------------------------------------------------. ,--------------------------------------------------. 102,--------------------------------------------------. ,--------------------------------------------------.
106| | | | | | | | | | | | | | | | 103| | | | | | | | | | | | | | | |
107|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 104|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
108| |KOpen |KType | | | | | | | Copy | | | | Paste| | 105| |KOpen |KType | LSFT | | | | | | Copy | | | | Paste| |
109|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 106|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
110| |DLeft |DRight| LCTL | | |------| |------| Left | Down | Up | Right| | | 107| |DLeft |DRight| LCTL | LGUI | |------| |------| Left | Down | Up | Right| | |
111|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 108|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
112| |SFT_TB| Tab | | | | | | | | | | | | | 109| |SFT_TB| Tab | | | | | | | | | | | | |
113`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 110`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
@@ -117,7 +114,7 @@
117 | | | | Home | End | 114 | | | | Home | End |
118 ,------|------|------| |------+------+------. 115 ,------|------|------| |------+------+------.
119 | | | | | | | | 116 | | | | | | | |
120 | | LSFT |------| |------| | | 117 | | |------| |------| | |
121 | | | | | | | | 118 | | | | | | | |
122 `--------------------' `--------------------' 119 `--------------------' `--------------------'
123``` 120```
diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c
index 3fac44e39..4e2cffa54 100644
--- a/layouts/community/ergodox/333fred/keymap.c
+++ b/layouts/community/ergodox/333fred/keymap.c
@@ -2,12 +2,7 @@
2#include "debug.h" 2#include "debug.h"
3#include "action_layer.h" 3#include "action_layer.h"
4#include "version.h" 4#include "version.h"
5 5#include "333fred.h"
6#define BASE 0 // default layer
7#define CODE 1 // code layer
8#define SYMB 2 // symbols
9#define MDIA 3 // media keys
10#define MOVE 4 // movement layer
11 6
12enum custom_keycodes { 7enum custom_keycodes {
13 PLACEHOLDER = SAFE_RANGE, // can always be here 8 PLACEHOLDER = SAFE_RANGE, // can always be here
@@ -48,20 +43,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
48 * ,--------------------------------------------------. ,--------------------------------------------------. 43 * ,--------------------------------------------------. ,--------------------------------------------------.
49 * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | 44 * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - |
50 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 45 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
51 * | TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | 46 * | TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ |
52 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 47 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
53 * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L | ; | ' | 48 * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L | ; | ' |
54 * |--------+------+------+------+------+------| L1 | |MO(3) |------+------+------+------+------+--------| 49 * |--------+------+------+------+------+------| L2 | |MO(3) |------+------+------+------+------+--------|
55 * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | 50 * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
56 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 51 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
57 * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | 52 * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI |
58 * `----------------------------------' `----------------------------------' 53 * `----------------------------------' `----------------------------------'
59 * ,-------------. ,-------------. 54 * ,-------------. ,-------------.
60 * | Copy | Paste| | Alt | Lock | 55 * | Copy | Paste| | Copy | Paste |
61 * ,------|------|------| |------+--------+------. 56 * ,------|------|------| |------+--------+------.
62 * | | | PgUp | | PgDn | | | 57 * | | | PgUp | | PgDn | | |
63 * | Bcksp|OSL(2)|------| |------| Ent |Space | 58 * | Bcksp|OSL(2)|------| |------| Ent |Space |
64 * | | | Del | | RCtrl| | | 59 * | | VIM | Del | | RCtrl| | |
65 * `--------------------' `----------------------' 60 * `--------------------' `----------------------'
66 */ 61 */
67// If it accepts an argument (i.e, is a function), it doesn't need KC_. 62// If it accepts an argument (i.e, is a function), it doesn't need KC_.
@@ -69,22 +64,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
69[BASE] = LAYOUT_ergodox( // layer 0 : default 64[BASE] = LAYOUT_ergodox( // layer 0 : default
70 // left hand 65 // left hand
71 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, 66 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
72 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), 67 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(CODE),
73 KC_ESC, KC_A, KC_S, KC_D, LT(MOVE, KC_F),KC_G, 68 KC_ESC, KC_A, KC_S, KC_D, LT(VIM, KC_F),KC_G,
74 OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE), 69 OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB),
75 OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT, 70 OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT,
76 LCTL(KC_C),LCTL(KC_V), 71 LCTL(KC_C), LCTL(KC_V),
77 KC_PGUP, 72 KC_PGUP,
78 KC_BSPC,OSL(SYMB), KC_DEL, 73 KC_BSPC,TD(TD_SYM_VIM), KC_DEL,
79 // right hand 74 // right hand
80 TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, 75 TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
81 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, 76 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
82 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 77 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
83 MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), 78 MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT),
84 KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, 79 KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI,
85 KC_RALT, KC_LOCK, 80 LCTL(KC_C), LCTL(KC_V),
86 KC_PGDN, 81 KC_PGDN,
87 KC_RCTL, KC_ENT, KC_SPC 82 KC_RCTL, KC_ENT, KC_SPC
88 ), 83 ),
89/* Keymap 1: Code Layer 84/* Keymap 1: Code Layer
90 * 85 *
@@ -100,10 +95,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
100 * | | | | | | | F12 |GoToIm| FAR | | | 95 * | | | | | | | F12 |GoToIm| FAR | | |
101 * `----------------------------------' `----------------------------------' 96 * `----------------------------------' `----------------------------------'
102 * ,-------------. ,---------------. 97 * ,-------------. ,---------------.
103 * |Format|Build | | Test | DTest | 98 * |Format|Build | | Copy | Paste |
104 * ,------|------|------| |------+--------+------. 99 * ,------|------|------| |------+--------+------.
105 * | | |Refact| |Sort U| | | 100 * | | |Refact| |Sort U| | |
106 * | | |------| |------| | | 101 * | |ACCESS|------| |------| | |
107 * | | | | | | | | 102 * | | | | | | | |
108 * `--------------------' `----------------------' 103 * `--------------------' `----------------------'
109 */ 104 */
@@ -126,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
126 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 121 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
127 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 122 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
128 KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS, 123 KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS,
129 M(TEST), M(DEBUG_TEST), 124 LCTL(KC_C), LCTL(KC_V),
130 M(REMOVE_SORT_USINGS), 125 M(REMOVE_SORT_USINGS),
131 KC_TRNS, KC_TRNS, KC_TRNS 126 KC_TRNS, KC_TRNS, KC_TRNS
132 ), 127 ),
@@ -218,9 +213,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
218 * ,--------------------------------------------------. ,--------------------------------------------------. 213 * ,--------------------------------------------------. ,--------------------------------------------------.
219 * | | | | | | | | | | | | | | | | 214 * | | | | | | | | | | | | | | | |
220 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| 215 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
221 * | |KOpen |KType | | | | | | | Copy | | | | Paste| | 216 * | |KOpen |KType |LSHFT | | | | | | Copy | | | | Paste| |
222 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 217 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
223 * | |DLeft |DRight|LCTRL |ACCESS| |------| |------| Left | Down | Up | Right| | | 218 * | |DLeft |DRight|LCTRL | LGUI | |------| |------| Left | Down | Up | Right| | |
224 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| 219 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
225 * | |SFT_TB| TAB | | | | | | | | | | | | | 220 * | |SFT_TB| TAB | | | | | | | | | | | | |
226 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' 221 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
@@ -230,20 +225,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
230 * | | | | Home | End | 225 * | | | | Home | End |
231 * ,------|------|------| |------+------+------. 226 * ,------|------|------| |------+------+------.
232 * | | | | | | | | 227 * | | | | | | | |
233 * | |LSHIFT|------| |------| | | 228 * | |ACCESS|------| |------| | |
234 * | | | | | | | | 229 * | | | | | | | |
235 * `--------------------' `--------------------' 230 * `--------------------' `--------------------'
236 */ 231 */
237// MEDIA AND MOUSE 232// MEDIA AND MOUSE
238[MOVE] = LAYOUT_ergodox( 233[VIM] = LAYOUT_ergodox(
239 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 234 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
240 KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 235 KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS,
241 KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_TRNS, KC_TRNS, 236 KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, KC_TRNS,
242 KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 237 KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
243 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 238 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
244 KC_TRNS, KC_TRNS, 239 KC_TRNS, KC_TRNS,
245 KC_TRNS, 240 KC_TRNS,
246 KC_TRNS, KC_LSFT, KC_TRNS, 241 KC_TRNS, KC_TRNS, KC_TRNS,
247 // right hand 242 // right hand
248 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 243 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
249 KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS, 244 KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS,
@@ -349,6 +344,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
349}; 344};
350 345
351bool process_record_user(uint16_t keycode, keyrecord_t *record) { 346bool process_record_user(uint16_t keycode, keyrecord_t *record) {
347 tap_dance_process_record(keycode);
352 switch (keycode) { 348 switch (keycode) {
353 // dynamically generate these. 349 // dynamically generate these.
354 case EPRM: 350 case EPRM:
diff --git a/layouts/community/ergodox/333fred/rules.mk b/layouts/community/ergodox/333fred/rules.mk
index d8e081eaa..31e723732 100644
--- a/layouts/community/ergodox/333fred/rules.mk
+++ b/layouts/community/ergodox/333fred/rules.mk
@@ -3,6 +3,7 @@ LCD_ENABLE = yes
3BACKLIGHT_ENABLE = yes 3BACKLIGHT_ENABLE = yes
4NKRO_ENABLE = yes 4NKRO_ENABLE = yes
5KEY_LOCK_ENABLE = yes 5KEY_LOCK_ENABLE = yes
6TAP_DANCE_ENABLE = yes
6 7
7 8
8 9
diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c
new file mode 100644
index 000000000..ef2d741e5
--- /dev/null
+++ b/users/333fred/333fred.c
@@ -0,0 +1,63 @@
1#include "333fred.h"
2#include "quantum.h"
3#include "action.h"
4
5typedef enum {
6 SINGLE_TAP, SINGLE_HOLD, DOUBLE
7} tap_dance_state_enum;
8
9static tap_dance_state_enum tap_dance_state;
10static bool tap_dance_active = false;
11
12void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) {
13 // Determine the current state
14 if (state->count == 1) {
15 if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP;
16 else tap_dance_state = SINGLE_HOLD;
17 } else {
18 // Handle any number of other taps as a VIM movement hold
19 tap_dance_state = DOUBLE;
20 }
21
22 switch (tap_dance_state) {
23 case SINGLE_TAP:
24 if (tap_dance_active) {
25 reset_oneshot_layer();
26 tap_dance_active = false;
27 } else {
28 set_oneshot_layer(SYMB, ONESHOT_START);
29 tap_dance_active = true;
30 }
31 break;
32 case SINGLE_HOLD:
33 layer_on(SYMB);
34 break;
35 case DOUBLE:
36 layer_on(VIM);
37 }
38}
39
40
41void tap_dance_layer_reset(qk_tap_dance_state_t *state, void *user_data) {
42 switch(tap_dance_state) {
43 case SINGLE_TAP:
44 clear_oneshot_layer_state(ONESHOT_PRESSED);
45 break;
46 case SINGLE_HOLD:
47 layer_off(SYMB);
48 break;
49 case DOUBLE:
50 layer_off(VIM);
51 break;
52 }
53}
54
55qk_tap_dance_action_t tap_dance_actions[] = {
56 [TD_SYM_VIM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_layer_finished, tap_dance_layer_reset)
57};
58
59void tap_dance_process_record(uint16_t keycode) {
60 if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) {
61 tap_dance_active = false;
62 }
63}
diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h
new file mode 100644
index 000000000..4a0462b7a
--- /dev/null
+++ b/users/333fred/333fred.h
@@ -0,0 +1,22 @@
1#ifndef FRED_333
2#define FRED_333
3
4#include "quantum.h"
5
6#define BASE 0
7#define CODE 1 // code layer
8#define SYMB 2
9#define MDIA 3 // media keys
10#define VIM 4
11#define GAME 5
12
13// Tap dance config shared between my keyboards
14enum tap_dance_declarations {
15 TD_SYM_VIM = 0
16};
17
18void tap_dance_layer_finished(qk_tap_dance_state_t*, void*);
19void tap_dance_layer_reset(qk_tap_dance_state_t*, void*);
20void tap_dance_process_record(uint16_t);
21
22#endif
diff --git a/users/333fred/rules.mk b/users/333fred/rules.mk
new file mode 100644
index 000000000..3160ac2e6
--- /dev/null
+++ b/users/333fred/rules.mk
@@ -0,0 +1,2 @@
1
2SRC += 333fred.c