diff options
| author | Morton Jonuschat <yabawock@gmail.com> | 2019-05-14 12:12:29 -0700 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-05-14 12:12:29 -0700 |
| commit | 7c0f2ae6d1c1d3f168a5919287b6608b092b3dba (patch) | |
| tree | 27df17fe5de7d7e7dab840828277c77233c05995 /layouts/community/ergodox | |
| parent | 93a97ec6e5a8f193bb96bba1636b7f67cd47d3fc (diff) | |
| download | qmk_firmware-7c0f2ae6d1c1d3f168a5919287b6608b092b3dba.tar.gz qmk_firmware-7c0f2ae6d1c1d3f168a5919287b6608b092b3dba.zip | |
[Keymap] Neo2 for ErgoDox on MacOS US QWERTY / ABC Extended keymap (#5862)
This is a Neo2 inspired layout that is meant to be fully usable on
MacOS when used with the default US QWERTY/ABC Extended keymap.
Neo2 layers 1-4 have been almost fully implemented in hardware.
Layers 5 and 6 (greek and mathematical symbols) have been left
out for now as most of them aren't available on the default
keymaps.
Layer toggling for layer 3 on the right hand side utilizes a
tap-toggle approach that is a combination of MO & LT macros.
This is required to allow sending Y when tapped, @ when tapped
while the SHIFT modifier is active and support momentarily
toggling the layer while the key is held.
Diffstat (limited to 'layouts/community/ergodox')
| -rw-r--r-- | layouts/community/ergodox/osx_neo2/keymap.c | 694 | ||||
| -rw-r--r-- | layouts/community/ergodox/osx_neo2/layers.h | 9 | ||||
| -rw-r--r-- | layouts/community/ergodox/osx_neo2/readme.md | 219 | ||||
| -rw-r--r-- | layouts/community/ergodox/osx_neo2/visualizer.c | 47 |
4 files changed, 969 insertions, 0 deletions
diff --git a/layouts/community/ergodox/osx_neo2/keymap.c b/layouts/community/ergodox/osx_neo2/keymap.c new file mode 100644 index 000000000..9e379c73f --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/keymap.c | |||
| @@ -0,0 +1,694 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "layers.h" | ||
| 3 | #include "version.h" | ||
| 4 | |||
| 5 | // Timer to detect tap/hold on NEO_RMOD3 key | ||
| 6 | static uint16_t neo3_timer; | ||
| 7 | // State bitmap to track which key(s) enabled NEO_3 layer | ||
| 8 | static uint8_t neo3_state = 0; | ||
| 9 | // State bitmap to track key combo for CAPSLOCK | ||
| 10 | static uint8_t capslock_state = 0; | ||
| 11 | |||
| 12 | // bitmasks for modifier keys | ||
| 13 | #define MOD_MASK_NONE 0 | ||
| 14 | |||
| 15 | // Used to trigger macros / sequences of keypresses | ||
| 16 | enum custom_keycodes { | ||
| 17 | PLACEHOLDER = SAFE_RANGE, // can always be here | ||
| 18 | US_OSX_SMALL_UE, | ||
| 19 | US_OSX_SMALL_AE, | ||
| 20 | US_OSX_SMALL_OE, | ||
| 21 | US_OSX_CAPITAL_UE, | ||
| 22 | US_OSX_CAPITAL_AE, | ||
| 23 | US_OSX_CAPITAL_OE, | ||
| 24 | NEO2_LMOD3, | ||
| 25 | NEO2_RMOD3, | ||
| 26 | NEO2_1, | ||
| 27 | NEO2_2, | ||
| 28 | NEO2_3, | ||
| 29 | NEO2_4, | ||
| 30 | NEO2_5, | ||
| 31 | NEO2_6, | ||
| 32 | NEO2_7, | ||
| 33 | NEO2_8, | ||
| 34 | NEO2_9, | ||
| 35 | NEO2_0, | ||
| 36 | NEO2_MINUS, | ||
| 37 | NEO2_UE, | ||
| 38 | NEO2_AE, | ||
| 39 | NEO2_OE, | ||
| 40 | NEO2_COMMA, | ||
| 41 | NEO2_DOT, | ||
| 42 | NEO2_SHARP_S | ||
| 43 | }; | ||
| 44 | |||
| 45 | #define NEO2_LMOD4 TT(NEO_4) | ||
| 46 | #define NEO2_RMOD4 NEO2_LMOD4 | ||
| 47 | |||
| 48 | // NEO_3 special characters | ||
| 49 | #define US_OSX_SUPERSCRIPT_1 KC_NO // ¹ | ||
| 50 | #define US_OSX_SUPERSCRIPT_2 KC_NO // ² | ||
| 51 | #define US_OSX_SUPERSCRIPT_3 KC_NO // ³ | ||
| 52 | #define US_OSX_RSAQUO LALT(LSFT(KC_4)) // › | ||
| 53 | #define US_OSX_LSAQUO LALT(LSFT(KC_3)) // ‹ | ||
| 54 | #define US_OSX_CENT LALT(KC_4) // ¢ | ||
| 55 | #define US_OSX_YEN LALT(KC_Y) // ¥ | ||
| 56 | #define US_OSX_SBQUO LALT(LSFT(KC_0)) // ‚ | ||
| 57 | #define US_OSX_LEFT_SINGLE_QUOTE LALT(KC_RBRACKET) // ‘ | ||
| 58 | #define US_OSX_RIGHT_SINGLE_QUOTE LALT(LSFT(KC_RBRACKET)) // ’ | ||
| 59 | #define US_OSX_ELLIPSIS LALT(KC_SCOLON) // … | ||
| 60 | #define US_OSX_UNDERSCORE LSFT(KC_MINUS) // _ | ||
| 61 | #define US_OSX_LBRACKET KC_LBRACKET // [ | ||
| 62 | #define US_OSX_RBRACKET KC_RBRACKET // ] | ||
| 63 | #define US_OSX_CIRCUMFLEX LSFT(KC_6) // ^ | ||
| 64 | #define US_OSX_EXCLAMATION LSFT(KC_1) // ! | ||
| 65 | #define US_OSX_LESSTHAN LSFT(KC_COMMA) // < | ||
| 66 | #define US_OSX_GREATERTHAN LSFT(KC_DOT) // > | ||
| 67 | #define US_OSX_EQUAL KC_EQUAL // = | ||
| 68 | #define US_OSX_AMPERSAND LSFT(KC_7) // & | ||
| 69 | #define US_OSX_SMALL_LONG_S KC_NO // ſ | ||
| 70 | #define US_OSX_BSLASH KC_BSLASH | ||
| 71 | #define US_OSX_SLASH KC_SLASH // / | ||
| 72 | #define US_OSX_CLBRACKET LSFT(KC_LBRACKET) // { | ||
| 73 | #define US_OSX_CRBRACKET LSFT(KC_RBRACKET) // } | ||
| 74 | #define US_OSX_ASTERISK LSFT(KC_8) // * | ||
| 75 | #define US_OSX_QUESTIONMARK LSFT(KC_SLASH) // ? | ||
| 76 | #define US_OSX_LPARENTHESES LSFT(KC_9) // ( | ||
| 77 | #define US_OSX_RPARENTHESES LSFT(KC_0) // ) | ||
| 78 | #define US_OSX_HYPHEN_MINUS KC_MINUS // - | ||
| 79 | #define US_OSX_COLON LSFT(KC_SCOLON) // : | ||
| 80 | #define US_OSX_AT LSFT(KC_2) // @ | ||
| 81 | #define US_OSX_HASH LSFT(KC_3) // # | ||
| 82 | #define US_OSX_PIPE LSFT(KC_BSLASH) // | | ||
| 83 | #define US_OSX_TILDE LSFT(KC_GRAVE) // ~ | ||
| 84 | #define US_OSX_BACKTICK KC_GRAVE // ` | ||
| 85 | #define US_OSX_PLUS LSFT(KC_EQUAL) // + | ||
| 86 | #define US_OSX_PERCENT LSFT(KC_5) // % | ||
| 87 | #define US_OSX_DOUBLE_QUOTE LSFT(KC_QUOTE) // " | ||
| 88 | #define US_OSX_SINGLE_QUOTE KC_QUOTE // ' | ||
| 89 | #define US_OSX_SEMICOLON KC_SCOLON // ; | ||
| 90 | |||
| 91 | // NEO_4 special characters | ||
| 92 | #define US_OSX_FEMININE_ORDINAL LALT(KC_9) // ª | ||
| 93 | #define US_OSX_MASCULINE_ORDINAL LALT(KC_0) // º | ||
| 94 | #define US_OSX_NUMERO_SIGN KC_NO // № | ||
| 95 | #define US_OSX_MIDDLE_DOT LALT(LSFT(KC_9)) // · | ||
| 96 | #define US_OSX_BRITISH_POUND LALT(KC_3) // £ | ||
| 97 | #define US_OSX_CURRENCY_SIGN KC_NO // ¤ | ||
| 98 | #define US_OSX_INV_EXCLAMATION LALT(KC_1) // ¡ | ||
| 99 | #define US_OSX_INV_QUESTIONMARK LALT(LSFT(KC_SLASH)) // ¿ | ||
| 100 | #define US_OSX_DOLLAR KC_DOLLAR // $ | ||
| 101 | #define US_OSX_EM_DASH LALT(LSFT(KC_MINUS)) // — | ||
| 102 | |||
| 103 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 104 | /* NEO_1: Basic layer | ||
| 105 | * | ||
| 106 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 107 | * | ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | | ||
| 108 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 109 | * | TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | | ||
| 110 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 111 | * | NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | | ||
| 112 | * |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| | ||
| 113 | * | LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | | ||
| 114 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 115 | * | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| | ||
| 116 | * `----------------------------------' `----------------------------------' | ||
| 117 | * ,-------------. ,-------------. | ||
| 118 | * | FKEYS| Home | | PgUp | FKEYS| | ||
| 119 | * ,------|------|------| |------+------+------. | ||
| 120 | * | Back-| | End | | PgDn | | | | ||
| 121 | * | space|Delete|------| |------| Enter|Space | | ||
| 122 | * | | | NEO_4| | NEO_4| | | | ||
| 123 | * `--------------------' `--------------------' | ||
| 124 | */ | ||
| 125 | [NEO_1] = LAYOUT_ergodox( | ||
| 126 | // left hand side - main | ||
| 127 | KC_NO /* NOOP */, NEO2_1, NEO2_2, NEO2_3, NEO2_4, NEO2_5, KC_ESCAPE, | ||
| 128 | KC_TAB, KC_X, KC_V, KC_L, KC_C, KC_W, KC_LCTRL, | ||
| 129 | NEO2_LMOD3, KC_U, KC_I, KC_A, KC_E, KC_O, /* --- */ | ||
| 130 | KC_LSHIFT, NEO2_UE, NEO2_OE, NEO2_AE, KC_P, KC_Z, KC_LALT, | ||
| 131 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_LCTRL, KC_LALT, KC_LGUI, /* --- */ /* --- */ | ||
| 132 | |||
| 133 | // left hand side - thumb cluster | ||
| 134 | /* --- */ MO(FKEYS), KC_HOME, | ||
| 135 | /* KC_BSPACE */ /* KC_DELETE */ KC_END, | ||
| 136 | KC_BSPACE, KC_DELETE, NEO2_LMOD4, | ||
| 137 | |||
| 138 | // right hand side - main | ||
| 139 | TO(US_1), NEO2_6, NEO2_7, NEO2_8, NEO2_9, NEO2_0, NEO2_MINUS, | ||
| 140 | KC_RCTRL, KC_K, KC_H, KC_G, KC_F, KC_Q, NEO2_SHARP_S, | ||
| 141 | /* --- */ KC_S, KC_N, KC_R, KC_T, KC_D, NEO2_RMOD3, | ||
| 142 | KC_RALT, KC_B, KC_M, NEO2_COMMA, NEO2_DOT, KC_J, KC_RSHIFT, | ||
| 143 | /* --- */ /* --- */ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, | ||
| 144 | |||
| 145 | // right hand side - thumb cluster | ||
| 146 | KC_PGUP, MO(FKEYS), /* --- */ | ||
| 147 | KC_PGDOWN, /* --- */ /* --- */ | ||
| 148 | NEO2_RMOD4, KC_ENTER, KC_SPACE | ||
| 149 | ), | ||
| 150 | |||
| 151 | /* NEO_3: Symbol layer | ||
| 152 | * | ||
| 153 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 154 | * | ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | | ||
| 155 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 156 | * | ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | | ||
| 157 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 158 | * | | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | | ||
| 159 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 160 | * | | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | | ||
| 161 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 162 | * | | | | | | | | | | | | | ||
| 163 | * `----------------------------------' `----------------------------------' | ||
| 164 | * ,-------------. ,-------------. | ||
| 165 | * | | | | | | | ||
| 166 | * ,------|------|------| |------+------+------. | ||
| 167 | * | | | | | | | | | ||
| 168 | * | | |------| |------| | | | ||
| 169 | * | | | | | | | | | ||
| 170 | * `--------------------' `--------------------' | ||
| 171 | */ | ||
| 172 | [NEO_3] = LAYOUT_ergodox( | ||
| 173 | // left hand side - main | ||
| 174 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, US_OSX_RSAQUO, US_OSX_LSAQUO, _______, | ||
| 175 | KC_NO /* NOOP */, US_OSX_ELLIPSIS, US_OSX_UNDERSCORE, US_OSX_LBRACKET, US_OSX_RBRACKET, US_OSX_CIRCUMFLEX, _______, | ||
| 176 | _______, US_OSX_BSLASH, US_OSX_SLASH, US_OSX_CLBRACKET, US_OSX_CRBRACKET, US_OSX_ASTERISK, /* --- */ | ||
| 177 | _______, US_OSX_HASH, US_OSX_DOLLAR, US_OSX_PIPE, US_OSX_TILDE, US_OSX_BACKTICK, _______, | ||
| 178 | _______, _______, _______, _______, _______, /* --- */ /* --- */ | ||
| 179 | |||
| 180 | // left hand side - thumb cluster | ||
| 181 | /* --- */ _______, _______, | ||
| 182 | /* --- */ /* --- */ _______, | ||
| 183 | _______, _______, _______, | ||
| 184 | |||
| 185 | // right hand side - main | ||
| 186 | _______, US_OSX_CENT, US_OSX_YEN, US_OSX_SBQUO, US_OSX_LEFT_SINGLE_QUOTE, US_OSX_RIGHT_SINGLE_QUOTE, KC_NO, | ||
| 187 | _______, US_OSX_EXCLAMATION, US_OSX_LESSTHAN, US_OSX_GREATERTHAN, US_OSX_EQUAL, US_OSX_AMPERSAND, US_OSX_SMALL_LONG_S, | ||
| 188 | /* --- */ US_OSX_QUESTIONMARK, US_OSX_LPARENTHESES, US_OSX_RPARENTHESES, US_OSX_HYPHEN_MINUS, US_OSX_COLON, NEO2_RMOD3, | ||
| 189 | _______, US_OSX_PLUS, US_OSX_PERCENT, US_OSX_DOUBLE_QUOTE, US_OSX_SINGLE_QUOTE, US_OSX_SEMICOLON, _______, | ||
| 190 | /* --- */ /* --- */ _______, _______, _______, _______, _______, | ||
| 191 | |||
| 192 | // right hand side - thumb cluster | ||
| 193 | _______, _______, /* --- */ | ||
| 194 | _______, /* --- */ /* --- */ | ||
| 195 | _______, _______, _______ | ||
| 196 | ), | ||
| 197 | |||
| 198 | /* NEO_4: Cursor & Numpad | ||
| 199 | * | ||
| 200 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 201 | * | ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | | ||
| 202 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 203 | * | ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | | ||
| 204 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 205 | * | | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | | ||
| 206 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 207 | * | | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | | ||
| 208 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 209 | * | | | | | | | | 0 | | | | | ||
| 210 | * `----------------------------------' `----------------------------------' | ||
| 211 | * ,-------------. ,-------------. | ||
| 212 | * | | | | | | | ||
| 213 | * ,------|------|------| |------+------+------. | ||
| 214 | * | | | | | | | | | ||
| 215 | * | | |------| |------| | | | ||
| 216 | * | | | | | | | | | ||
| 217 | * `--------------------' `--------------------' | ||
| 218 | */ | ||
| 219 | [NEO_4] = LAYOUT_ergodox( | ||
| 220 | // left hand side - main | ||
| 221 | KC_NO /* NOOP */, US_OSX_FEMININE_ORDINAL, US_OSX_MASCULINE_ORDINAL, KC_NO /* NOOP */, US_OSX_MIDDLE_DOT, US_OSX_BRITISH_POUND, _______, | ||
| 222 | _______, KC_PGUP, KC_BSPACE, KC_UP, KC_DELETE, KC_PGDOWN, _______, | ||
| 223 | _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, /* --- */ | ||
| 224 | _______, KC_ESCAPE, KC_TAB, KC_INSERT, KC_ENTER, KC_NO /* NOOP */, _______, | ||
| 225 | _______, _______, _______, _______, _______, /* --- */ /* --- */ | ||
| 226 | |||
| 227 | // left hand side - thumb cluster | ||
| 228 | /* --- */ _______, _______, | ||
| 229 | /* --- */ /* --- */ _______, | ||
| 230 | _______, _______, _______, | ||
| 231 | |||
| 232 | // right hand side - main | ||
| 233 | _______, US_OSX_CURRENCY_SIGN, KC_TAB, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO /* NOOP */, | ||
| 234 | _______, US_OSX_INV_EXCLAMATION, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, US_OSX_EM_DASH, | ||
| 235 | /* --- */ US_OSX_INV_QUESTIONMARK, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_COMMA, KC_KP_DOT, | ||
| 236 | _______, US_OSX_COLON, KC_KP_1, KC_KP_2, KC_KP_3, US_OSX_SEMICOLON, _______, | ||
| 237 | /* --- */ /* --- */ _______, KC_KP_0, _______, _______, _______, | ||
| 238 | |||
| 239 | // right hand side - thumb cluster | ||
| 240 | _______, _______, /* --- */ | ||
| 241 | _______, /* --- */ /* --- */ | ||
| 242 | _______, _______, _______ | ||
| 243 | ), | ||
| 244 | |||
| 245 | /* NEO_5: Greek | ||
| 246 | * | ||
| 247 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 248 | * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 249 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 250 | * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 251 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 252 | * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 253 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 254 | * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | | ||
| 255 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 256 | * | | | | | | | | | | | | | ||
| 257 | * `----------------------------------' `----------------------------------' | ||
| 258 | * ,-------------. ,-------------. | ||
| 259 | * | | | | | | | ||
| 260 | * ,------|------|------| |------+------+------. | ||
| 261 | * | | | | | | | | | ||
| 262 | * | | |------| |------| | | | ||
| 263 | * | | | | | | | | | ||
| 264 | * `--------------------' `--------------------' | ||
| 265 | */ | ||
| 266 | [NEO_5] = LAYOUT_ergodox( | ||
| 267 | // left hand side - main | ||
| 268 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 269 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 270 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ | ||
| 271 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 272 | _______, _______, _______, _______, _______, /* --- */ /* --- */ | ||
| 273 | |||
| 274 | // left hand side - thumb cluster | ||
| 275 | /* --- */ _______, _______, | ||
| 276 | /* --- */ /* --- */ _______, | ||
| 277 | _______, _______, _______, | ||
| 278 | |||
| 279 | // right hand side - main | ||
| 280 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 281 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 282 | /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 283 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 284 | /* --- */ /* --- */ _______, _______, _______, _______, _______, | ||
| 285 | |||
| 286 | // right hand side - thumb cluster | ||
| 287 | _______, _______, /* --- */ | ||
| 288 | _______, /* --- */ /* --- */ | ||
| 289 | _______, _______, _______ | ||
| 290 | ), | ||
| 291 | |||
| 292 | /* NEO_6: Math symbols | ||
| 293 | * | ||
| 294 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 295 | * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 296 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 297 | * | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 298 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 299 | * | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 300 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 301 | * | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | | ||
| 302 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 303 | * | | | | | | | | | | | | | ||
| 304 | * `----------------------------------' `----------------------------------' | ||
| 305 | * ,-------------. ,-------------. | ||
| 306 | * | | | | | | | ||
| 307 | * ,------|------|------| |------+------+------. | ||
| 308 | * | | | | | | | | | ||
| 309 | * | | |------| |------| | | | ||
| 310 | * | | | | | | | | | ||
| 311 | * `--------------------' `--------------------' | ||
| 312 | */ | ||
| 313 | [NEO_6] = LAYOUT_ergodox( | ||
| 314 | // left hand side - main | ||
| 315 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 316 | KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 317 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, /* --- */ | ||
| 318 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 319 | _______, _______, _______, _______, _______, /* --- */ /* --- */ | ||
| 320 | |||
| 321 | // left hand side - thumb cluster | ||
| 322 | /* --- */ _______, _______, | ||
| 323 | /* --- */ /* --- */ _______, | ||
| 324 | _______, _______, _______, | ||
| 325 | |||
| 326 | // right hand side - main | ||
| 327 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 328 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 329 | /* --- */ KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, | ||
| 330 | _______, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, KC_NO /* NOOP */, _______, | ||
| 331 | /* --- */ /* --- */ _______, _______, _______, _______, _______, | ||
| 332 | |||
| 333 | // right hand side - thumb cluster | ||
| 334 | _______, _______, /* --- */ | ||
| 335 | _______, /* --- */ /* --- */ | ||
| 336 | _______, _______, _______ | ||
| 337 | ), | ||
| 338 | |||
| 339 | /* US_1: US QWERTY | ||
| 340 | * | ||
| 341 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 342 | * | = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | | ||
| 343 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 344 | * | \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | | ||
| 345 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 346 | * | TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | | ||
| 347 | * |--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| | ||
| 348 | * | LSHIFT | Z | X | C | V | B | | | | N | M | , | . | / | RSHIFT | | ||
| 349 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 350 | * | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | | ||
| 351 | * `----------------------------------' `----------------------------------' | ||
| 352 | * ,-------------. ,-------------. | ||
| 353 | * | LCTRL| LALT | | RALT | RCTRL| | ||
| 354 | * ,------|------|------| |------+------+------. | ||
| 355 | * | | | HOME | | PGUP | | | | ||
| 356 | * | BKSP | DEL |------| |------| ENTR | SPCE | | ||
| 357 | * | | | END | | PGDN | | | | ||
| 358 | * `--------------------' `--------------------' | ||
| 359 | */ | ||
| 360 | [US_1] = LAYOUT_ergodox( | ||
| 361 | // left hand side - main | ||
| 362 | KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESCAPE, | ||
| 363 | KC_BSLASH, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO /* NOOP */, | ||
| 364 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, /* --- */ | ||
| 365 | KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO /* NOOP */, | ||
| 366 | KC_LGUI, KC_GRAVE, KC_NO, KC_NO, MO(FKEYS), /* --- */ /* --- */ | ||
| 367 | |||
| 368 | // left hand side - thumb cluster | ||
| 369 | /* --- */ KC_LCTRL, KC_LALT, | ||
| 370 | /* --- */ /* --- */ KC_HOME, | ||
| 371 | KC_BSPACE, KC_DELETE, KC_END, | ||
| 372 | |||
| 373 | // right hand side - main | ||
| 374 | TO(NEO_1), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, | ||
| 375 | KC_LBRACKET, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, | ||
| 376 | /* --- */ KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, | ||
| 377 | KC_NO /* NOOP */, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, | ||
| 378 | /* --- */ /* --- */ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_RGUI, | ||
| 379 | |||
| 380 | // right hand side - thumb cluster | ||
| 381 | KC_RALT, KC_RCTRL, /* --- */ | ||
| 382 | KC_PGUP, /* --- */ /* --- */ | ||
| 383 | KC_PGDOWN, KC_ENTER, KC_SPACE | ||
| 384 | ), | ||
| 385 | |||
| 386 | /* FKEYS: Function keys | ||
| 387 | * | ||
| 388 | * ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 389 | * | Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | | ||
| 390 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 391 | * | Play | | | | | | | | | | | | | | VolDn | | ||
| 392 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 393 | * | Next | | | | | |------| |------| | | | | | Mute | | ||
| 394 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 395 | * | | | | | | | | | | | | | | | | | ||
| 396 | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 397 | * | | | | | | | | | | | | | ||
| 398 | * `----------------------------------' `----------------------------------' | ||
| 399 | * ,-------------. ,-------------. | ||
| 400 | * | | | | | | | ||
| 401 | * ,------|------|------| |------+------+------. | ||
| 402 | * | | | | | | | | | ||
| 403 | * | | |------| |------| | | | ||
| 404 | * | | | | | | | | | ||
| 405 | * `--------------------' `--------------------' | ||
| 406 | */ | ||
| 407 | [FKEYS] = LAYOUT_ergodox( | ||
| 408 | // left hand side - main | ||
| 409 | KC_MEDIA_REWIND, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, | ||
| 410 | KC_MEDIA_PLAY_PAUSE, _______, _______, _______, _______, _______, _______, | ||
| 411 | KC_MEDIA_FAST_FORWARD, _______, _______, _______, _______, _______, /* --- */ | ||
| 412 | _______, _______, _______, _______, _______, _______, _______, | ||
| 413 | _______, _______, _______, _______, _______, /* --- */ /* --- */ | ||
| 414 | |||
| 415 | // left hand side - thumb cluster | ||
| 416 | /* --- */ _______, _______, | ||
| 417 | /* --- */ /* --- */ _______, | ||
| 418 | _______, _______, _______, | ||
| 419 | |||
| 420 | // right hand side - main | ||
| 421 | KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_AUDIO_VOL_UP, | ||
| 422 | _______, _______, _______, _______, _______, _______, KC_AUDIO_VOL_DOWN, | ||
| 423 | /* --- */ _______, _______, _______, _______, _______, KC_AUDIO_MUTE, | ||
| 424 | _______, _______, _______, _______, _______, _______, _______, | ||
| 425 | /* --- */ /* --- */ _______, _______, _______, _______, _______, | ||
| 426 | |||
| 427 | // right hand side - thumb cluster | ||
| 428 | _______, _______, /* --- */ | ||
| 429 | _______, /* --- */ /* --- */ | ||
| 430 | _______, _______, _______ | ||
| 431 | ), | ||
| 432 | }; | ||
| 433 | |||
| 434 | // Send a key tap with a optional set of modifiers. | ||
| 435 | void tap_with_modifiers(uint16_t keycode, uint8_t force_modifiers) { | ||
| 436 | uint8_t active_modifiers = get_mods(); | ||
| 437 | |||
| 438 | if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) register_code(KC_LSFT); | ||
| 439 | if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) register_code(KC_LCTRL); | ||
| 440 | if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) register_code(KC_LALT); | ||
| 441 | if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) register_code(KC_LGUI); | ||
| 442 | |||
| 443 | register_code(keycode); | ||
| 444 | unregister_code(keycode); | ||
| 445 | |||
| 446 | if ((force_modifiers & MOD_MASK_SHIFT) && !(active_modifiers & MOD_MASK_SHIFT)) unregister_code(KC_LSFT); | ||
| 447 | if ((force_modifiers & MOD_MASK_CTRL) && !(active_modifiers & MOD_MASK_CTRL)) unregister_code(KC_LCTRL); | ||
| 448 | if ((force_modifiers & MOD_MASK_ALT) && !(active_modifiers & MOD_MASK_ALT)) unregister_code(KC_LALT); | ||
| 449 | if ((force_modifiers & MOD_MASK_GUI) && !(active_modifiers & MOD_MASK_GUI)) unregister_code(KC_LGUI); | ||
| 450 | } | ||
| 451 | |||
| 452 | // Special remapping for keys with different keycodes/macros when used with shift modifiers. | ||
| 453 | bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) { | ||
| 454 | uint8_t active_modifiers = get_mods(); | ||
| 455 | uint8_t shifted = active_modifiers & MOD_MASK_SHIFT; | ||
| 456 | |||
| 457 | // Early return on key release | ||
| 458 | if (!record->event.pressed) { | ||
| 459 | return true; | ||
| 460 | } | ||
| 461 | |||
| 462 | if (shifted) { | ||
| 463 | clear_mods(); | ||
| 464 | |||
| 465 | switch (keycode) { | ||
| 466 | case NEO2_1: | ||
| 467 | // degree symbol | ||
| 468 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_8) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 469 | break; | ||
| 470 | case NEO2_2: | ||
| 471 | // section symbol | ||
| 472 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_6) SS_UP(X_LALT)); | ||
| 473 | break; | ||
| 474 | case NEO2_3: | ||
| 475 | // There is no OSX key combination for the script small l character | ||
| 476 | break; | ||
| 477 | case NEO2_4: | ||
| 478 | // right angled quote | ||
| 479 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_BSLASH) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 480 | break; | ||
| 481 | case NEO2_5: | ||
| 482 | // left angled quote | ||
| 483 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_BSLASH) SS_UP(X_LALT)); | ||
| 484 | break; | ||
| 485 | case NEO2_6: | ||
| 486 | // dollar sign | ||
| 487 | SEND_STRING(SS_DOWN(X_LSHIFT) SS_TAP(X_4) SS_UP(X_LSHIFT)); | ||
| 488 | break; | ||
| 489 | case NEO2_7: | ||
| 490 | // euro sign | ||
| 491 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_2) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 492 | break; | ||
| 493 | case NEO2_8: | ||
| 494 | // low9 double quote | ||
| 495 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_W) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 496 | break; | ||
| 497 | case NEO2_9: | ||
| 498 | // left double quote | ||
| 499 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_LBRACKET) SS_UP(X_LALT)); | ||
| 500 | break; | ||
| 501 | case NEO2_0: | ||
| 502 | // right double quote | ||
| 503 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_LBRACKET) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 504 | break; | ||
| 505 | case NEO2_MINUS: | ||
| 506 | // em dash | ||
| 507 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_MINUS) SS_UP(X_LSHIFT) SS_UP(X_LALT)); | ||
| 508 | break; | ||
| 509 | case NEO2_COMMA: | ||
| 510 | // en dash | ||
| 511 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_MINUS) SS_UP(X_LALT)); | ||
| 512 | break; | ||
| 513 | case NEO2_DOT: | ||
| 514 | // bullet | ||
| 515 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_8) SS_UP(X_LALT)); | ||
| 516 | break; | ||
| 517 | case NEO2_SHARP_S: | ||
| 518 | // german sharp s | ||
| 519 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT)); | ||
| 520 | break; | ||
| 521 | case NEO2_UE: | ||
| 522 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_U) SS_UP(X_LSHIFT)); | ||
| 523 | break; | ||
| 524 | case NEO2_OE: | ||
| 525 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_O) SS_UP(X_LSHIFT)); | ||
| 526 | break; | ||
| 527 | case NEO2_AE: | ||
| 528 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_A) SS_UP(X_LSHIFT)); | ||
| 529 | break; | ||
| 530 | default: | ||
| 531 | set_mods(active_modifiers); | ||
| 532 | return true; | ||
| 533 | } | ||
| 534 | |||
| 535 | set_mods(active_modifiers); | ||
| 536 | return false; | ||
| 537 | } else { | ||
| 538 | switch (keycode) { | ||
| 539 | case NEO2_1: | ||
| 540 | SEND_STRING(SS_TAP(X_1)); | ||
| 541 | break; | ||
| 542 | case NEO2_2: | ||
| 543 | SEND_STRING(SS_TAP(X_2)); | ||
| 544 | break; | ||
| 545 | case NEO2_3: | ||
| 546 | SEND_STRING(SS_TAP(X_3)); | ||
| 547 | break; | ||
| 548 | case NEO2_4: | ||
| 549 | SEND_STRING(SS_TAP(X_4)); | ||
| 550 | break; | ||
| 551 | case NEO2_5: | ||
| 552 | SEND_STRING(SS_TAP(X_5)); | ||
| 553 | break; | ||
| 554 | case NEO2_6: | ||
| 555 | SEND_STRING(SS_TAP(X_6)); | ||
| 556 | break; | ||
| 557 | case NEO2_7: | ||
| 558 | SEND_STRING(SS_TAP(X_7)); | ||
| 559 | break; | ||
| 560 | case NEO2_8: | ||
| 561 | SEND_STRING(SS_TAP(X_8)); | ||
| 562 | break; | ||
| 563 | case NEO2_9: | ||
| 564 | SEND_STRING(SS_TAP(X_9)); | ||
| 565 | break; | ||
| 566 | case NEO2_0: | ||
| 567 | SEND_STRING(SS_TAP(X_0)); | ||
| 568 | break; | ||
| 569 | case NEO2_MINUS: | ||
| 570 | SEND_STRING(SS_TAP(X_MINUS)); | ||
| 571 | break; | ||
| 572 | case NEO2_COMMA: | ||
| 573 | SEND_STRING(SS_TAP(X_COMMA)); | ||
| 574 | break; | ||
| 575 | case NEO2_DOT: | ||
| 576 | SEND_STRING(SS_TAP(X_DOT)); | ||
| 577 | break; | ||
| 578 | case NEO2_SHARP_S: | ||
| 579 | // german sharp s | ||
| 580 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT)); | ||
| 581 | break; | ||
| 582 | case NEO2_UE: | ||
| 583 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_U)); | ||
| 584 | break; | ||
| 585 | case NEO2_OE: | ||
| 586 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_O)); | ||
| 587 | break; | ||
| 588 | case NEO2_AE: | ||
| 589 | SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_A)); | ||
| 590 | break; | ||
| 591 | default: | ||
| 592 | return true; | ||
| 593 | } | ||
| 594 | |||
| 595 | return false; | ||
| 596 | } | ||
| 597 | } | ||
| 598 | |||
| 599 | // Runs for each key down or up event. | ||
| 600 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 601 | switch (keycode) { | ||
| 602 | case KC_LSHIFT: | ||
| 603 | if (record->event.pressed) { | ||
| 604 | capslock_state |= (MOD_BIT(KC_LSHIFT)); | ||
| 605 | } else { | ||
| 606 | capslock_state &= ~(MOD_BIT(KC_LSHIFT)); | ||
| 607 | } | ||
| 608 | break; | ||
| 609 | case KC_RSHIFT: | ||
| 610 | if (record->event.pressed) { | ||
| 611 | capslock_state |= MOD_BIT(KC_RSHIFT); | ||
| 612 | } else { | ||
| 613 | capslock_state &= ~(MOD_BIT(KC_RSHIFT)); | ||
| 614 | } | ||
| 615 | break; | ||
| 616 | case NEO2_LMOD3: | ||
| 617 | if (record->event.pressed) { | ||
| 618 | layer_on(NEO_3); | ||
| 619 | neo3_state |= (1 << 1); | ||
| 620 | } else { | ||
| 621 | // Turn off NEO_3 layer unless it's enabled through NEO2_RMOD3 as well. | ||
| 622 | if ((neo3_state & ~(1 << 1)) == 0) { | ||
| 623 | layer_off(NEO_3); | ||
| 624 | } | ||
| 625 | neo3_state &= ~(1 << 1); | ||
| 626 | } | ||
| 627 | break; | ||
| 628 | case NEO2_RMOD3: | ||
| 629 | if (record->event.pressed) { | ||
| 630 | neo3_timer = timer_read(); | ||
| 631 | neo3_state |= (1 << 2); | ||
| 632 | layer_on(NEO_3); | ||
| 633 | } else { | ||
| 634 | // Turn off NEO_3 layer unless it's enabled through NEO2_LMOD3 as well. | ||
| 635 | if ((neo3_state & ~(1 << 2)) == 0) { | ||
| 636 | layer_off(NEO_3); | ||
| 637 | } | ||
| 638 | neo3_state &= ~(1 << 2); | ||
| 639 | |||
| 640 | // Was the NEO2_RMOD3 key TAPPED? | ||
| 641 | if (timer_elapsed(neo3_timer) <= 150) { | ||
| 642 | if (neo3_state > 0) { | ||
| 643 | // We are still in NEO_3 layer, send keycode and modifiers for @ | ||
| 644 | tap_with_modifiers(KC_2, MOD_MASK_SHIFT); | ||
| 645 | return false; | ||
| 646 | } else { | ||
| 647 | // Do the normal key processing, send y | ||
| 648 | tap_with_modifiers(KC_Y, MOD_MASK_NONE); | ||
| 649 | return false; | ||
| 650 | } | ||
| 651 | } | ||
| 652 | } | ||
| 653 | break; | ||
| 654 | } | ||
| 655 | |||
| 656 | if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) { | ||
| 657 | // CAPSLOCK is currently active, disable it | ||
| 658 | if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { | ||
| 659 | unregister_code(KC_LOCKING_CAPS); | ||
| 660 | } else { | ||
| 661 | register_code(KC_LOCKING_CAPS); | ||
| 662 | } | ||
| 663 | return false; | ||
| 664 | } | ||
| 665 | |||
| 666 | return process_record_user_shifted(keycode, record); | ||
| 667 | }; | ||
| 668 | |||
| 669 | // Runs just one time when the keyboard initializes. | ||
| 670 | void matrix_init_user(void){ | ||
| 671 | |||
| 672 | }; | ||
| 673 | |||
| 674 | // Runs constantly in the background, in a loop. | ||
| 675 | void matrix_scan_user(void) { | ||
| 676 | uint8_t layer = biton32(layer_state); | ||
| 677 | |||
| 678 | ergodox_board_led_off(); | ||
| 679 | ergodox_right_led_1_off(); | ||
| 680 | ergodox_right_led_2_off(); | ||
| 681 | ergodox_right_led_3_off(); | ||
| 682 | switch (layer) { | ||
| 683 | // TODO: Make this relevant to the ErgoDox EZ. | ||
| 684 | case 1: | ||
| 685 | ergodox_right_led_1_on(); | ||
| 686 | break; | ||
| 687 | case 2: | ||
| 688 | ergodox_right_led_2_on(); | ||
| 689 | break; | ||
| 690 | default: | ||
| 691 | // none | ||
| 692 | break; | ||
| 693 | } | ||
| 694 | }; | ||
diff --git a/layouts/community/ergodox/osx_neo2/layers.h b/layouts/community/ergodox/osx_neo2/layers.h new file mode 100644 index 000000000..a5e0cba00 --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/layers.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | enum layers { | ||
| 2 | NEO_1, // layer_0 | ||
| 3 | NEO_3, // layer_1 | ||
| 4 | NEO_4, // layer_2 | ||
| 5 | NEO_5, // layer_3 | ||
| 6 | NEO_6, // layer_4 | ||
| 7 | US_1, // layer_5 | ||
| 8 | FKEYS // layer_6 | ||
| 9 | }; \ No newline at end of file | ||
diff --git a/layouts/community/ergodox/osx_neo2/readme.md b/layouts/community/ergodox/osx_neo2/readme.md new file mode 100644 index 000000000..cab4dfe70 --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/readme.md | |||
| @@ -0,0 +1,219 @@ | |||
| 1 | # Neo 2 for ErgoDox on QWERTY | ||
| 2 | |||
| 3 | # Description | ||
| 4 | |||
| 5 | The Neo layout is an optimized German keyboard layout developed by the | ||
| 6 | Neo Users Group, supporting many Latin-based alphabets. The positions | ||
| 7 | of the letters are not only optimized for German letter frequency, | ||
| 8 | but also for typical groups of two or three letters. English is | ||
| 9 | considered a primary target as well. | ||
| 10 | |||
| 11 | The design tries to enforce the alternating usage of both hands to | ||
| 12 | increase typing speed and incorporates ideas from de-ergo and other | ||
| 13 | ergonomic layouts. High frequency keys are placed in the home row. | ||
| 14 | The current layout Neo 2.0 has unique features making it suited for | ||
| 15 | many target groups such as programmers, mathematicians, scientists or | ||
| 16 | LaTeX authors. | ||
| 17 | |||
| 18 | Neo is grouped into six layers, each dedicated to a special purpose. | ||
| 19 | |||
| 20 | # Layers | ||
| 21 | |||
| 22 | At the core this is a Neo 2.0 layout adjusted for the Ergodox Infinity. | ||
| 23 | The keymap is laid out expecting a macOs using the US QWERTY or ABC | ||
| 24 | Extended layout. | ||
| 25 | |||
| 26 | [Layer 1](#layer-1) Lowercase, upppercase and typographical characters | ||
| 27 | |||
| 28 | [Layer 2](#layer-2) Special characters for programming | ||
| 29 | |||
| 30 | [Layer 3](#layer-3) WASD-like movement keys and number block | ||
| 31 | |||
| 32 | [Layer 4](#layer-4) Greek characters | ||
| 33 | |||
| 34 | [Layer 5](#layer-5) Mathematical symbols and Greek uppercase characters | ||
| 35 | |||
| 36 | [Layer 6](#layer-6) Ergodox Infinity US QWERTY layout | ||
| 37 | |||
| 38 | [Layer 7](#layer-7) Function keys | ||
| 39 | |||
| 40 | ## Legend | ||
| 41 | |||
| 42 | * Keys marked with `----` are dead keys. | ||
| 43 | * Blank keys are transparent and fall through to lower levels. | ||
| 44 | |||
| 45 | ## Layer 1 | ||
| 46 | |||
| 47 | This layer implements NEO layers 1 and 2. | ||
| 48 | |||
| 49 | ``` | ||
| 50 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 51 | | ---- | 1/° | 2/§ | 3/ | 4/» | 5/« | ESC | | US_1 | 6/$ | 7/€ | 8/„ | 9/“ | 0/” | -/— | | ||
| 52 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 53 | | TAB | X | V | L | C | W | LCTL | | RCTL | K | H | G | F | Q | ß | | ||
| 54 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 55 | | NEO_3 | U | I | A | E | O |------| |------| S | N | R | T | D | Y | | ||
| 56 | |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------| | ||
| 57 | | LSHIFT | Ü | Ö | Ä | P | Z | | | | B | M | ,/– | ./• | J | RSHIFT | | ||
| 58 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 59 | | ---- | ---- | LCTL | LALT | LGUI | | RGUI | Left | Down | Up | Right| | ||
| 60 | `----------------------------------' `----------------------------------' | ||
| 61 | ,-------------. ,-------------. | ||
| 62 | | FKEYS| Home | | PgUp | FKEYS| | ||
| 63 | ,------|------|------| |------+------+------. | ||
| 64 | | Back-| | End | | PgDn | | | | ||
| 65 | | space|Delete|------| |------| Enter|Space | | ||
| 66 | | | | NEO_4| | NEO_4| | | | ||
| 67 | `--------------------' `--------------------' | ||
| 68 | ``` | ||
| 69 | |||
| 70 | ## Layer 2 | ||
| 71 | |||
| 72 | This layer implements NEO layer 3. | ||
| 73 | |||
| 74 | |||
| 75 | ``` | ||
| 76 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 77 | | ---- | ---- | ---- | ---- | › | ‹ | | | | ¢ | ¥ | ‚ | ‘ | ’ | ---- | | ||
| 78 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 79 | | ---- | … | _ | [ | ] | ^ | | | | ! | < | > | = | & | ---- | | ||
| 80 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 81 | | | \ | / | { | } | * |------| |------| ? | ( | ) | - | : | @ | | ||
| 82 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 83 | | | # | $ | | | ~ | ` | | | | + | % | " | ' | ; | | | ||
| 84 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 85 | | | | | | | | | | | | | | ||
| 86 | `----------------------------------' `----------------------------------' | ||
| 87 | ,-------------. ,-------------. | ||
| 88 | | | | | | | | ||
| 89 | ,------|------|------| |------+------+------. | ||
| 90 | | | | | | | | | | ||
| 91 | | | |------| |------| | | | ||
| 92 | | | | | | | | | | ||
| 93 | `--------------------' `--------------------' | ||
| 94 | ``` | ||
| 95 | |||
| 96 | ## Layer 3 | ||
| 97 | |||
| 98 | This layer implements NEO layer 4. | ||
| 99 | |||
| 100 | ``` | ||
| 101 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 102 | | ---- | ª | º | ---- | · | £ | | | | ---- | Tab | / | * | - | ---- | | ||
| 103 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 104 | | ---- | PgUp | ⌫ | Up | ⌦ | PgDn | | | | ¡ | 7 | 8 | 9 | + | – | | ||
| 105 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 106 | | | Home | Left | Down | Right| End |------| |------| ¿ | 4 | 5 | 6 | , | . | | ||
| 107 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 108 | | | Esc | Tab | Ins |Return| ---- | | | | : | 1 | 2 | 3 | ; | | | ||
| 109 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 110 | | | | | | | | | 0 | | | | | ||
| 111 | `----------------------------------' `----------------------------------' | ||
| 112 | ,-------------. ,-------------. | ||
| 113 | | | | | | | | ||
| 114 | ,------|------|------| |------+------+------. | ||
| 115 | | | | | | | | | | ||
| 116 | | | |------| |------| | | | ||
| 117 | | | | | | | | | | ||
| 118 | `--------------------' `--------------------' | ||
| 119 | ``` | ||
| 120 | |||
| 121 | ## Layer 4 | ||
| 122 | |||
| 123 | This layer is currently empty/reserved for NEO layer 5. | ||
| 124 | |||
| 125 | ``` | ||
| 126 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 127 | | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 128 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 129 | | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 130 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 131 | | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 132 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 133 | | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | | ||
| 134 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 135 | | | | | | | | | | | | | | ||
| 136 | `----------------------------------' `----------------------------------' | ||
| 137 | ,-------------. ,-------------. | ||
| 138 | | | | | | | | ||
| 139 | ,------|------|------| |------+------+------. | ||
| 140 | | | | | | | | | | ||
| 141 | | | |------| |------| | | | ||
| 142 | | | | | | | | | | ||
| 143 | `--------------------' `--------------------' | ||
| 144 | ``` | ||
| 145 | |||
| 146 | ## Layer 5 | ||
| 147 | |||
| 148 | This layer is currently empty/reserved for NEO layer 6. | ||
| 149 | |||
| 150 | ``` | ||
| 151 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 152 | | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 153 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 154 | | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 155 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 156 | | | ---- | ----| ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- | | ||
| 157 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 158 | | | ---- | ----| ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | | | ||
| 159 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 160 | | | | | | | | | | | | | | ||
| 161 | `----------------------------------' `----------------------------------' | ||
| 162 | ,-------------. ,-------------. | ||
| 163 | | | | | | | | ||
| 164 | ,------|------|------| |------+------+------. | ||
| 165 | | | | | | | | | | ||
| 166 | | | |------| |------| | | | ||
| 167 | | | | | | | | | | ||
| 168 | `--------------------' `--------------------' | ||
| 169 | ``` | ||
| 170 | |||
| 171 | ## Layer 6 | ||
| 172 | |||
| 173 | A bare bones implementation of the default Ergodox Infinity layout. | ||
| 174 | |||
| 175 | ``` | ||
| 176 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 177 | | = | 1 | 2 | 3 | 4 | 5 | ESC | | NEO_1| 6 | 7 | 8 | 9 | 0 | - | | ||
| 178 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 179 | | \ | Q | W | E | R | T | ---- | | [ | Y | U | I | O | P | ] | | ||
| 180 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 181 | | TAB | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | | ||
| 182 | |--------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+--------| | ||
| 183 | | LSHIFT | Z | X | V | B | M | | | | N | M | , | . | / | RSHIFT | | ||
| 184 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 185 | | LGUI | ` | ---- | ---- | FKEYS| | Left | Down | Up | Right| RGUI | | ||
| 186 | `----------------------------------' `----------------------------------' | ||
| 187 | ,-------------. ,-------------. | ||
| 188 | | LCTRL| LALT | | RALT | RCTRL| | ||
| 189 | ,------|------|------| |------+------+------. | ||
| 190 | | | | HOME | | PGUP | | | | ||
| 191 | | BKSP | DEL |------| |------| ENTR | SPCE | | ||
| 192 | | | | END | | PGDN | | | | ||
| 193 | `--------------------' `--------------------' | ||
| 194 | ``` | ||
| 195 | |||
| 196 | ## Layer 7 | ||
| 197 | |||
| 198 | This layer implements function and multimedia keys. | ||
| 199 | |||
| 200 | ``` | ||
| 201 | ,--------------------------------------------------. ,--------------------------------------------------. | ||
| 202 | | Prev | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | VolUp | | ||
| 203 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | ||
| 204 | | Play | | | | | | | | | | | | | | VolDn | | ||
| 205 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 206 | | Next | | | | | |------| |------| | | | | | Mute | | ||
| 207 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | ||
| 208 | | | | | | | | | | | | | | | | | | ||
| 209 | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | ||
| 210 | | | | | | | | | | | | | | ||
| 211 | `----------------------------------' `----------------------------------' | ||
| 212 | ,-------------. ,-------------. | ||
| 213 | | | | | | | | ||
| 214 | ,------|------|------| |------+------+------. | ||
| 215 | | | | | | | | | | ||
| 216 | | | |------| |------| | | | ||
| 217 | | | | | | | | | | ||
| 218 | `--------------------' `--------------------' | ||
| 219 | ``` | ||
diff --git a/layouts/community/ergodox/osx_neo2/visualizer.c b/layouts/community/ergodox/osx_neo2/visualizer.c new file mode 100644 index 000000000..653201bb8 --- /dev/null +++ b/layouts/community/ergodox/osx_neo2/visualizer.c | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #include "layers.h" | ||
| 2 | #include "simple_visualizer.h" | ||
| 3 | #include "util.h" | ||
| 4 | |||
| 5 | static void get_visualizer_layer_and_color(visualizer_state_t *state) { | ||
| 6 | uint8_t layer = biton32(state->status.layer); | ||
| 7 | |||
| 8 | // Go from highest to lowest layer to get the right text/color combination. | ||
| 9 | switch (layer) { | ||
| 10 | // #AEB2F4 / hsv(65.71%, 28.69%, 95.69%) | ||
| 11 | case FKEYS: | ||
| 12 | // #F4AEDC / hsv(89.05%, 28.69%, 95.69%) | ||
| 13 | state->layer_text = "FUNCTION KEYS"; | ||
| 14 | state->target_lcd_color = LCD_COLOR(228, 73, 245); | ||
| 15 | break; | ||
| 16 | case US_1: | ||
| 17 | // #F4B993 / hsv(6.53%, 39.75%, 95.69%) | ||
| 18 | state->layer_text = "QWERTY"; | ||
| 19 | state->target_lcd_color = LCD_COLOR(17, 102, 245); | ||
| 20 | break; | ||
| 21 | case NEO_6: | ||
| 22 | // #F4E393 / hsv(13.75%, 39.75%, 95.69%) | ||
| 23 | state->layer_text = "NEO: 6"; | ||
| 24 | state->target_lcd_color = LCD_COLOR(35, 102, 245); | ||
| 25 | break; | ||
| 26 | case NEO_5: | ||
| 27 | // #C6F493 / hsv(24.57%, 39.75%, 95.69%) | ||
| 28 | state->layer_text = "NEO: 5"; | ||
| 29 | state->target_lcd_color = LCD_COLOR(63, 102, 245); | ||
| 30 | break; | ||
| 31 | case NEO_4: | ||
| 32 | // #8EEBC9 / hsv(43.91%, 39.57%, 92.16%) | ||
| 33 | state->layer_text = "NEO: 4"; | ||
| 34 | state->target_lcd_color = LCD_COLOR(112, 101, 189); | ||
| 35 | break; | ||
| 36 | case NEO_3: | ||
| 37 | // #93D2F4 / hsv(55.84%, 39.75%, 95.69%) | ||
| 38 | state->layer_text = "NEO: 3"; | ||
| 39 | state->target_lcd_color = LCD_COLOR(143, 102, 245); | ||
| 40 | break; | ||
| 41 | default: | ||
| 42 | // #EEEEEE / hsv(0%, 0%, 93%) | ||
| 43 | state->layer_text = "NEO: 1"; | ||
| 44 | state->target_lcd_color = LCD_COLOR(0, 0, 255); | ||
| 45 | break; | ||
| 46 | } | ||
| 47 | } | ||
