diff options
| -rw-r--r-- | keyboards/planck/keymaps/cbbrowne/config.h | 5 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/cbbrowne/keymap.c | 97 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/cbbrowne/readme.md | 43 |
3 files changed, 118 insertions, 27 deletions
diff --git a/keyboards/planck/keymaps/cbbrowne/config.h b/keyboards/planck/keymaps/cbbrowne/config.h index 58cd2cc5b..1e04ba61d 100644 --- a/keyboards/planck/keymaps/cbbrowne/config.h +++ b/keyboards/planck/keymaps/cbbrowne/config.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #include "../../config.h" | 4 | #include "../../config.h" |
| 5 | 5 | ||
| 6 | #define LEADER_TIMEOUT 300 | ||
| 7 | #define BACKLIGHT_BREATHING | ||
| 8 | |||
| 6 | /* cbbrowne user configuration */ | 9 | /* cbbrowne user configuration */ |
| 7 | 10 | ||
| 8 | #define randadd 53 | 11 | #define randadd 53 |
| @@ -16,5 +19,3 @@ | |||
| 16 | 19 | ||
| 17 | #endif | 20 | #endif |
| 18 | 21 | ||
| 19 | |||
| 20 | |||
diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index 898f6f0e0..7f1601af7 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c | |||
| @@ -65,10 +65,11 @@ | |||
| 65 | */ | 65 | */ |
| 66 | 66 | ||
| 67 | enum layers { | 67 | enum layers { |
| 68 | _QW = 0, /* Qwerty mapping */ | 68 | _QWERTY = 0, /* Qwerty mapping */ |
| 69 | _LW, /* Lower layer, where top line has symbols !@#$%^&*() */ | 69 | _LOWER, /* Lower layer, where top line has symbols !@#$%^&*() */ |
| 70 | _RS, /* Raised layer, where top line has digits 1234567890 */ | 70 | _RAISE, /* Raised layer, where top line has digits 1234567890 */ |
| 71 | _KP, /* Key pad */ | 71 | _KEYPAD, /* Key pad */ |
| 72 | _ADJUST, /* Special Adjust layer coming via tri-placement */ | ||
| 72 | }; | 73 | }; |
| 73 | 74 | ||
| 74 | enum macro_id { | 75 | enum macro_id { |
| @@ -76,37 +77,60 @@ enum macro_id { | |||
| 76 | M_USERNAME, | 77 | M_USERNAME, |
| 77 | M_RANDDIGIT, | 78 | M_RANDDIGIT, |
| 78 | M_RANDLETTER, | 79 | M_RANDLETTER, |
| 79 | M_VERSION | 80 | M_VERSION, |
| 81 | MACRO_UPPER, | ||
| 82 | MACRO_LOWER, | ||
| 80 | }; | 83 | }; |
| 81 | 84 | ||
| 85 | #define M_LOWER M(MACRO_LOWER) | ||
| 86 | #define M_UPPER M(MACRO_UPPER) | ||
| 87 | #define ROT_LED M(M_LED) /* Rotate LED */ | ||
| 88 | #define QWERTY DF(_QWERTY) /* Switch to QWERTY layout */ | ||
| 89 | #define KEYPAD DF(_KEYPAD) /* Switch to keypad */ | ||
| 90 | #define USERNAME M(M_USERNAME) /* shortcut for username */ | ||
| 91 | #define RANDDIG M(M_RANDDIGIT) | ||
| 92 | #define RANDALP M(M_RANDLETTER) | ||
| 93 | #define CTLENTER MT(MOD_RCTL, KC_ENT) | ||
| 94 | #define SHIFTQUOTE MT(MOD_RSFT, KC_QUOT) | ||
| 95 | #define ALTRIGHT MT(MOD_LALT, KC_RGHT) | ||
| 96 | #define MVERSION M(M_VERSION) | ||
| 97 | |||
| 98 | |||
| 82 | /* Note that Planck has dimensions 4 rows x 12 columns */ | 99 | /* Note that Planck has dimensions 4 rows x 12 columns */ |
| 83 | 100 | ||
| 84 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 101 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 85 | [_QW] = { /* Qwerty */ | 102 | [_QWERTY] = { /* Qwerty */ |
| 86 | {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, | 103 | {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, |
| 87 | {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT)}, | 104 | {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTLENTER}, |
| 88 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT }, | 105 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SHIFTQUOTE }, |
| 89 | {KC_TAB, M(M_LED), KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | 106 | {KC_TAB, KC_LALT, ROT_LED, KC_LGUI, M_LOWER, KC_SPC, KC_SPC, M_UPPER, KC_LEFT, KC_DOWN, KC_UP, ALTRIGHT} |
| 90 | /* Note that KC_SPC is recorded TWICE, so that either matrix position can activate it */ | 107 | /* Note that KC_SPC is recorded TWICE, so that either matrix position can activate it */ |
| 91 | }, | 108 | }, |
| 92 | [_RS] = { /* RAISE */ | 109 | [_RAISE] = { /* RAISE */ |
| 93 | {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, | 110 | {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, |
| 94 | {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, | 111 | {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, |
| 95 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_KP), DF(_KP), RESET, _______}, | 112 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, RESET, _______}, |
| 96 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | 113 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} |
| 97 | }, | 114 | }, |
| 98 | [_LW] = { /* LOWER */ | 115 | [_LOWER] = { /* LOWER */ |
| 99 | {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, | 116 | {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, |
| 100 | {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, | 117 | {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, |
| 101 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_KP), DF(_KP), RESET, _______}, | 118 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QWERTY, KEYPAD, KEYPAD, RESET, _______}, |
| 102 | {_______, DF(_KP), _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | 119 | {_______, KEYPAD, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} |
| 120 | }, | ||
| 121 | [_KEYPAD] = { /* Key Pad */ | ||
| 122 | {KC_ESC, USERNAME, MVERSION, KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC}, | ||
| 123 | {KC_LCTL, RANDDIG, KC_F5, KC_F6, KC_F7, KC_F8, KC_PGDN, KC_KP_MINUS, KC_4, KC_5, KC_6, KC_PIPE}, | ||
| 124 | {KC_LSFT, RANDALP, KC_F1, KC_F2, KC_F3, KC_F4, KC_DEL, KC_KP_PLUS, KC_1, KC_2, KC_3, KC_ENTER}, | ||
| 125 | {KC_TAB, KC_LALT, ROT_LED, KC_LGUI, M_LOWER, KC_SPC, KC_SPC, QWERTY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} | ||
| 103 | }, | 126 | }, |
| 104 | [_KP] = { /* Key Pad */ | 127 | |
| 105 | {KC_ESC, M(M_USERNAME), M(M_VERSION), KC_F10, KC_F11, KC_F12, KC_PGUP, KC_KP_ENTER, KC_7, KC_8, KC_9, KC_BSPC}, | 128 | [_ADJUST] = { /* Adjustments - gonna shift the wild tools in here */ |
| 106 | {KC_LCTL, M(M_RANDDIGIT), KC_F5, KC_F6, KC_F7, KC_F8, KC_PGDN, KC_KP_MINUS, KC_4, KC_5, KC_6, KC_PIPE}, | 129 | {ROT_LED,USERNAME,MVERSION, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, |
| 107 | {KC_LSFT, M(M_RANDLETTER), KC_F1, KC_F2, KC_F3, KC_F4, KC_DEL, KC_KP_PLUS, KC_1, KC_2, KC_3, KC_ENTER}, | 130 | {_______, RANDDIG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, |
| 108 | {BL_STEP, M(M_LED), KC_LALT, KC_LGUI, KC_NO, KC_SPC, KC_SPC, DF(_QW), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} | 131 | {_______, RANDALP, _______, _______, _______, RESET, RESET, _______, _______, _______, _______, _______ }, |
| 109 | } | 132 | {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } |
| 133 | } | ||
| 110 | }; | 134 | }; |
| 111 | 135 | ||
| 112 | /* What is fn_actions actually used for??? */ | 136 | /* What is fn_actions actually used for??? */ |
| @@ -171,6 +195,39 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 171 | unregister_code (KC_A + rval); | 195 | unregister_code (KC_A + rval); |
| 172 | } | 196 | } |
| 173 | break; | 197 | break; |
| 198 | case MACRO_UPPER: | ||
| 199 | if (record->event.pressed) | ||
| 200 | { | ||
| 201 | layer_on(_RAISE); | ||
| 202 | #ifdef BACKLIGHT_ENABLE | ||
| 203 | breathing_speed_set(2); | ||
| 204 | breathing_pulse(); | ||
| 205 | #endif | ||
| 206 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 207 | } | ||
| 208 | else | ||
| 209 | { | ||
| 210 | layer_off(_RAISE); | ||
| 211 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 212 | } | ||
| 213 | break; | ||
| 214 | case MACRO_LOWER: | ||
| 215 | if (record->event.pressed) | ||
| 216 | { | ||
| 217 | layer_on(_LOWER); | ||
| 218 | #ifdef BACKLIGHT_ENABLE | ||
| 219 | breathing_speed_set(2); | ||
| 220 | breathing_pulse(); | ||
| 221 | #endif | ||
| 222 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 223 | } | ||
| 224 | else | ||
| 225 | { | ||
| 226 | layer_off(_LOWER); | ||
| 227 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 228 | } | ||
| 229 | break; | ||
| 230 | |||
| 174 | } | 231 | } |
| 175 | return MACRO_NONE; | 232 | return MACRO_NONE; |
| 176 | }; | 233 | }; |
diff --git a/keyboards/planck/keymaps/cbbrowne/readme.md b/keyboards/planck/keymaps/cbbrowne/readme.md index 51979f630..184142e0c 100644 --- a/keyboards/planck/keymaps/cbbrowne/readme.md +++ b/keyboards/planck/keymaps/cbbrowne/readme.md | |||
| @@ -24,7 +24,26 @@ doing sundry experimentation: | |||
| 24 | - Key [2][2] aka "a" uses a random number generator to select a digit 0-9 at random | 24 | - Key [2][2] aka "a" uses a random number generator to select a digit 0-9 at random |
| 25 | - Key [3][2] aka "z" uses a random number generator to select a letter a-z at random | 25 | - Key [3][2] aka "z" uses a random number generator to select a letter a-z at random |
| 26 | - Key [1][3] aka "e" spits out the keymap version number | 26 | - Key [1][3] aka "e" spits out the keymap version number |
| 27 | * Minor use of Space Cadet Shift; my SHIFT key has switched to KC_LSP0, so that when I just hit SHIFT, I get a left parens: ( which is great for Lisping. I don't have a Right Shift, so I don't get an autoclose; I think I'll live with that until a Planck successor with more lines of keys :-) | 27 | * Trying out sgoodwin's "hold Enter down to get Shift" |
| 28 | - Liking this Quite Well Enough... | ||
| 29 | - Applied this to both Shift and Quote | ||
| 30 | - It seems likely that Alt should get a right-hand-side, akin to this... | ||
| 31 | - Alt needs to move, and get a RHS | ||
| 32 | - Hence ALTRIGHT, and shifted ROT_LED over | ||
| 33 | - Emacs likes this!!! :-) | ||
| 34 | - I'm suspicious that I'll want to shift ROT_LED another location over, | ||
| 35 | so some modifier can replace the OS/KC_LGUI key | ||
| 36 | * I have added an alternate ADJUST layer that is activated via update_tri_layer() | ||
| 37 | - e.g. - LOWER+RAISE simultaneously | ||
| 38 | - This seems entirely more useful for handling my "special keys" | ||
| 39 | like the random numbers, user name, and such, than the keypad layer | ||
| 40 | * The _ADJUST layer provides a good place to have RESET | ||
| 41 | - But this isn't strictly enough; I want RESET somewhat accessible from | ||
| 42 | main layer lest an error hide that layer | ||
| 43 | - I never use the OS/KC_LGUI key (that's Command on MacOS, Windows | ||
| 44 | Key on Windows), so that's a good place to have it as a chord of | ||
| 45 | some sort | ||
| 46 | |||
| 28 | 47 | ||
| 29 | 2. Some code structure ideas | 48 | 2. Some code structure ideas |
| 30 | --------------------------------------------------- | 49 | --------------------------------------------------- |
| @@ -43,8 +62,8 @@ doing sundry experimentation: | |||
| 43 | only need to fit 4 symbols onto each line, rather than 12. | 62 | only need to fit 4 symbols onto each line, rather than 12. |
| 44 | 63 | ||
| 45 | I used enums to manage layer IDs and macro IDs so that I don't need | 64 | I used enums to manage layer IDs and macro IDs so that I don't need |
| 46 | to care (beyond "start at 0", and arguably that's not needed) about | 65 | to care (beyond "start at 0", and arguably even that's not needed) |
| 47 | their values. | 66 | about their values. |
| 48 | 67 | ||
| 49 | 3. Things I did not like about the default mapping | 68 | 3. Things I did not like about the default mapping |
| 50 | --------------------------------------------------------- | 69 | --------------------------------------------------------- |
| @@ -57,12 +76,27 @@ doing sundry experimentation: | |||
| 57 | and shift ESC off the first column so KC_LCTL and KC_LALT can | 76 | and shift ESC off the first column so KC_LCTL and KC_LALT can |
| 58 | be on the first column. | 77 | be on the first column. |
| 59 | * I needed to swap ' and ENTER | 78 | * I needed to swap ' and ENTER |
| 79 | |||
| 80 | 4. Unuseful experiments | ||
| 81 | --------------------------------------------------------- | ||
| 82 | |||
| 83 | I have tried some things out that didn't turn out particularly well. | ||
| 84 | I'll note some of these for posterity, hopefully helpful in not doing | ||
| 85 | unwise things again... | ||
| 86 | |||
| 60 | * I tried added Workman alongside Dvorak and Colemak | 87 | * I tried added Workman alongside Dvorak and Colemak |
| 61 | - Boy, oh boy, these don't help!!! | 88 | - Boy, oh boy, these don't help!!! |
| 62 | - I have done 30 years of learning of Emacs key mappings, and | 89 | - I have done 30 years of learning of Emacs key mappings, and |
| 63 | these alternative keyboards massively mess me up | 90 | these alternative keyboards massively mess me up |
| 64 | 91 | ||
| 65 | 4. TODO | 92 | * Space Cadet Shift; switching L_SHIFT to KC_LSP0, so that when I |
| 93 | just hit SHIFT, I get a left parens. In principle, this is great | ||
| 94 | for Lisping. | ||
| 95 | - Unfortunately, there are times when mouse interfaces use SHIFT | ||
| 96 | to allow selecting multiple items, and this really interferes | ||
| 97 | with that | ||
| 98 | |||
| 99 | 5. TODO | ||
| 66 | --------------------------------------------------------- | 100 | --------------------------------------------------------- |
| 67 | 101 | ||
| 68 | * I use tmux quite a lot; the mollat keymap seems to have some | 102 | * I use tmux quite a lot; the mollat keymap seems to have some |
| @@ -77,4 +111,3 @@ doing sundry experimentation: | |||
| 77 | * The jeebak keymap seems to have some neat ideas: | 111 | * The jeebak keymap seems to have some neat ideas: |
| 78 | - Number layer which is aggressive about having numbers in several places | 112 | - Number layer which is aggressive about having numbers in several places |
| 79 | - Touch layer seems interesting | 113 | - Touch layer seems interesting |
| 80 | * Trying out sgoodwin's "hold Enter down to get Shift" \ No newline at end of file | ||
