Traveller handwired layout macro refactor (#13539)

This commit is contained in:
James Young 2021-07-13 21:28:56 -07:00 committed by GitHub
parent 70efc82c1c
commit dd5ead676b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 130 additions and 127 deletions

View File

@ -2,66 +2,68 @@
"keyboard_name": "Traveller",
"url": "",
"maintainer": "qmk",
"width": 13,
"height": 4,
"width": 15,
"height": 5.2,
"layouts": {
"LAYOUT": {
"layout": [
{"x": 0, "y": 0},
{"x": 1, "y": 0},
{"x": 2, "y": 0},
{"x": 0, "y": 1.2},
{"x": 1, "y": 0.8},
{"x": 2, "y": 0.4},
{"x": 3, "y": 0},
{"x": 4, "y": 0},
{"x": 5, "y": 0},
{"x": 4, "y": 0.4},
{"x": 5, "y": 0.8},
{"x": 7, "y": 0},
{"x": 8, "y": 0},
{"x": 9, "y": 0},
{"x": 10, "y": 0},
{"x": 9, "y": 0.8},
{"x": 10, "y": 0.4},
{"x": 11, "y": 0},
{"x": 12, "y": 0},
{"x": 12, "y": 0.4},
{"x": 13, "y": 0.8},
{"x": 14, "y": 1.2},
{"x": 0, "y": 1},
{"x": 1, "y": 1},
{"x": 2, "y": 1},
{"x": 0, "y": 2.2},
{"x": 1, "y": 1.8},
{"x": 2, "y": 1.4},
{"x": 3, "y": 1},
{"x": 4, "y": 1},
{"x": 5, "y": 1},
{"x": 4, "y": 1.4},
{"x": 5, "y": 1.8},
{"x": 7, "y": 1},
{"x": 8, "y": 1},
{"x": 9, "y": 1},
{"x": 10, "y": 1},
{"x": 9, "y": 1.8},
{"x": 10, "y": 1.4},
{"x": 11, "y": 1},
{"x": 12, "y": 1},
{"x": 12, "y": 1.4},
{"x": 13, "y": 1.8},
{"x": 14, "y": 2.2},
{"x": 0, "y": 2},
{"x": 1, "y": 2},
{"x": 2, "y": 2},
{"x": 0, "y": 3.2},
{"x": 1, "y": 2.8},
{"x": 2, "y": 2.4},
{"x": 3, "y": 2},
{"x": 4, "y": 2},
{"x": 5, "y": 2},
{"x": 6, "y": 2},
{"x": 7, "y": 2},
{"x": 8, "y": 2},
{"x": 9, "y": 2},
{"x": 10, "y": 2},
{"x": 11, "y": 2},
{"x": 12, "y": 2},
{"x": 4, "y": 2.4},
{"x": 5, "y": 2.8},
{"x": 0, "y": 3},
{"x": 1, "y": 3},
{"x": 2, "y": 3},
{"x": 9, "y": 2.8},
{"x": 10, "y": 2.4},
{"x": 11, "y": 2},
{"x": 12, "y": 2.4},
{"x": 13, "y": 2.8},
{"x": 14, "y": 3.2},
{"x": 0, "y": 4.2},
{"x": 1, "y": 3.8},
{"x": 2, "y": 3.4},
{"x": 3, "y": 3},
{"x": 4, "y": 3},
{"x": 5, "y": 3},
{"x": 6, "y": 3},
{"x": 7, "y": 3},
{"x": 8, "y": 3},
{"x": 9, "y": 3},
{"x": 10, "y": 3},
{"x": 4, "y": 3.4},
{"x": 5, "y": 3.8},
{"x": 6, "y": 3.05, "h": 1.5},
{"x": 8, "y": 3.05, "h": 1.5},
{"x": 9, "y": 3.8},
{"x": 10, "y": 3.4},
{"x": 11, "y": 3},
{"x": 12, "y": 3}
{"x": 12, "y": 3.4},
{"x": 13, "y": 3.8},
{"x": 14, "y": 4.2}
]
}
}

View File

@ -1,4 +1,5 @@
#include QMK_KEYBOARD_H
#include "mousekey.h"
enum layer_names {
_QW,
@ -23,36 +24,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | NAV | ` ~ | W | E | R | T | | Y | U | I | O | - | = |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | Q | S | D | F | G | | H | J | K | L | P | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------+------|
* |ctrl/esc| A | X | C | V | B |Ctrl /| N | M | , | . | ; | ' |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | Shift| Z | Del | GUI | Low | Bspc |/Enter| Spc | Hi | GUI | Alt | / |Shift |
* `------------------------------------------------------------------------------------------'
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |ctrl/esc| A | X | C | V | B | | N | M | , | . | ; | ' |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | Shift| Z | Del | GUI | Low | Bspc | Ctrl | Enter| Spc | Hi | GUI | Alt | / |Shift |
* `-------------------------------------------------------------------------------------------------'
*/
[_QW] = LAYOUT(
TG(_NAV), KC_GRV, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_MINS, KC_EQL,
KC_TAB, KC_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_BSLS,
CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_DEL, KC_LGUI, MO(_LW), KC_BSPC, KC_ENT, KC_SPC, MO(_HI), KC_RGUI, KC_RALT, KC_SLSH, KC_RSFT
CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_DEL, KC_LGUI, MO(_LW), KC_BSPC, KC_RCTL, KC_ENT, KC_SPC, MO(_HI), KC_RGUI, KC_RALT, KC_SLSH, KC_RSFT
),
/* LOW - numbers, missing or awkward programming keys
Doubled 1 key allows lazy reach with ring finger.
* ,-----------------------------------------. .-----------------------------------------.
* | FKeys| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |Ctrl-alt-del|
* |------+------+------+------+------+------| +------+------+------+------+------+------|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | 1 | ] | ( | ) | | | * | ( | ) | [ | | |
* |------+------+------+------+------+------|------+------+------+------+------+------+------|
* | Caps | [ | | { | } | ` | /| # | { | } | | ] | |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | Shift| | | | Low | |/ | | Hi | | | |Shift |
* `------------------------------------------------------------------------------------------'
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Caps | [ | | { | } | ` | | # | { | } | | ] | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | Shift| | | | Low | | | | | Hi | | | |Shift |
* `-------------------------------------------------------------------------------------------------'
*/
[_LW] = LAYOUT(
TG(_FKEYS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LCTL(LALT(KC_DEL)),
_______, KC_1, KC_RBRC, KC_LPRN, KC_RPRN, XXXXXXX, KC_ASTR, KC_LPRN, KC_RPRN, KC_LBRC, XXXXXXX, XXXXXXX,
KC_CAPS, KC_LBRC, XXXXXXX, KC_LCBR, KC_RCBR, KC_TILD, _______, KC_HASH, KC_LCBR, KC_RCBR, XXXXXXX, KC_RBRC, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
KC_CAPS, KC_LBRC, XXXXXXX, KC_LCBR, KC_RCBR, KC_TILD, KC_HASH, KC_LCBR, KC_RCBR, XXXXXXX, KC_RBRC, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* HI - Punctuation, shell and
@ -62,17 +63,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |FKEYS | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | ! | & | "|" | $ | % | | Vol+| Mute| | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------+------|
* | CAPS | ^ | : | . | * | - | /| Vol-| Play | PgUp | Home | Up | End |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | | / | | | Low | |/ | | Hi | PgDn | Left| Down | Right |
* `------------------------------------------------------------------------------------------'
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | CAPS | ^ | : | . | * | - | | Vol-| Play | PgUp | Home | Up | End |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | | / | | | Low | | | | | Hi | PgDn | Left | Down |Right |
* `-------------------------------------------------------------------------------------------------'
*/
[_HI] = LAYOUT(
TG(_FKEYS), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS,
_______, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_CAPS, KC_CIRC, KC_COLN, KC_DOT, KC_ASTR, KC_MINS, _______, KC_VOLD, KC_PPLS, KC_PGUP, KC_HOME, KC_UP, KC_END,
_______, KC_SLSH, _______, _______, TT(_LW), _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT
KC_CAPS, KC_CIRC, KC_COLN, KC_DOT, KC_ASTR, KC_MINS, KC_VOLD, KC_PPLS, KC_PGUP, KC_HOME, KC_UP, KC_END,
_______, KC_SLSH, _______, _______, TT(_LW), _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT
),
/* NAV - mouse & navigation
@ -80,20 +81,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* Mouse buttons are reversed for comfort - bigger stretch is to the right button.
*
* ,-----------------------------------------. .-----------------------------------------.
* | NAV | | | Up | |Gui-> | | MwU | MS_UL| MS_U |MS_UR | |Ms Norm|
* |------+------+------+------+------+------| |------+------+------+------+------+--------|
* | |Gui<- | Left | Down |Right | C^E | | BTN3 | MS_L |MS Up | MS_R | |Ms Fast |
* |------+------+------+------+------+------|------|------+------+------+------+------+--------|
* | | C^A | GUI X| GUI C| GUI_V| |Enter/| MWD | M_DL |MS Dwn|MS_DR | Up |Ms Slow |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | | GuiZ | | | Low | |/ButnR|ButnL | Hi | | Left | Down | Right |
* `------------------------------------------------------------------------------------------'
* | NAV | | | Up | |Gui-> | | MwU | MS_UL| MS_U |MS_UR | |MsNorm|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | |Gui<- | Left | Down |Right | C^E | | BTN3 | MS_L |MS Up | MS_R | |MsFast|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | C^A | GUI X| GUI C| GUI_V| | | MWD | M_DL |MS Dwn|MS_DR | Up |MsSlow|
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | | GuiZ | | | Low | |Enter | ButnR|ButnL | Hi | | Left | Down | Right|
* `-------------------------------------------------------------------------------------------------'
*/
[_NAV] = LAYOUT(
TG(_NAV), XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, RGUI(KC_RGHT), KC_WH_U, M_MUL, KC_MS_U, M_MUR, XXXXXXX, KC_ACL2,
_______, RGUI(KC_LEFT), KC_LEFT, KC_DOWN, KC_RGHT, LCTL(KC_E), KC_BTN3, KC_MS_L, KC_MS_U, KC_MS_R, XXXXXXX, KC_ACL1,
_______, LCTL(KC_A), LGUI(KC_X), RGUI(KC_C), RGUI(KC_V), XXXXXXX, KC_ENT, KC_WH_D, M_MDL, KC_MS_D, M_MDR, KC_UP, KC_ACL0,
_______, RGUI(KC_Z), _______, _______, _______, _______, KC_BTN2, KC_BTN1, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT
_______, LCTL(KC_A), LGUI(KC_X), RGUI(KC_C), RGUI(KC_V), XXXXXXX, KC_WH_D, M_MDL, KC_MS_D, M_MDR, KC_UP, KC_ACL0,
_______, RGUI(KC_Z), _______, _______, _______, _______, KC_ENT, KC_BTN2, KC_BTN1, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT
),
/* FKEYS - Funtion keys & mac stuff
@ -101,17 +102,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | | | F11 | F12 | F13 | F14 | F15 | Alt |
* |------+------+------+------+------+------|------+------+------+------+------+------+------|
* |Qwerty| | | | | | /| | | | | | Del |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | . |RGBTog| . | | LO | Bspc |/ | | HI | | | | |
* `------------------------------------------------------------------------------------------'
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |Qwerty| | | | | | | | | | | | Del |
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
* | . |RGBTog| . | | LO | Bspc | | | | HI | | | | |
* `-------------------------------------------------------------------------------------------------'
*/
[_FKEYS] = LAYOUT(
TG(_FKEYS), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RCTL,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LALT,
TO(_QW), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL,
_______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
TO(_QW), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL,
_______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* TRNS - skeleton for laters
@ -119,17 +120,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | . | . | . | . | . | . | | ^ | & | * | ( | ) | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | . | . | . | . | . | . | | 6 | 7 | 8 | 9 | 0 | |
* |------+------+------+------+------+------|------+------+------+------+------+------+------|
* | . | . | . | . | . | . | /| | | | . | ; | " |
* |------+------+------+------+------+------+ // +------+------+------+------+------+------|
* | . | . | . | GUI | LO | . |/ | Spc | HI | GUI | M0 | / |LSFT |
* `------------------------------------------------------------------------------------------'
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | . | . | . | . | . | . | | | | | . | ; | " |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | . | . | . | GUI | LO | . | | | Spc | HI | GUI | M0 | / | LSFT |
* `-------------------------------------------------------------------------------------------------'
*/
[_TRNS] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};

View File

@ -7,8 +7,8 @@
#define LAYOUT( \
k00, k01, k02, k03, k04, k05, k07, k08, k09, k0A, k0B, k0C, \
k10, k11, k12, k13, k14, k15, k17, k18, k19, k1A, k1B, k1C, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C \
k20, k21, k22, k23, k24, k25, k27, k28, k29, k2A, k2B, k2C, \
k30, k31, k32, k33, k34, k35, k26, k36, k37, k38, k39, k3A, k3B, k3C \
) { \
{ k00, k01, k02, k03, k04, k05, XXX, k07, k08, k09, k0A, k0B, k0C }, \
{ k10, k11, k12, k13, k14, k15, XXX, k17, k18, k19, k1A, k1B, k1C }, \