Skip to content

Commit

Permalink
FJLabs Swordfish Layout Macro Refactor (qmk#21234)
Browse files Browse the repository at this point in the history
* physically arrange layout macro

Arranges the layout macro to QMK standards (left to right, row by row).

This change breaks compatibility with out-of-tree keymaps, because the
order in which the keycode arguments must be passed is changed.

* rename `LAYOUT_alice_all` to `LAYOUT_split_bs`

* add `LAYOUT_2u_bs` macro
  • Loading branch information
noroadsleft authored Jun 14, 2023
1 parent 9551a0a commit 7bafae6
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 102 deletions.
209 changes: 143 additions & 66 deletions keyboards/fjlabs/swordfish/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,82 +19,159 @@
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT_alice_all": {
"LAYOUT_2u_bs": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [0, 5], "x": 5, "y": 0},
{"matrix": [0, 6], "x": 6, "y": 0},
{"matrix": [0, 7], "x": 8.5, "y": 0},
{"matrix": [0, 8], "x": 9.5, "y": 0},
{"matrix": [0, 9], "x": 10.5, "y": 0},
{"matrix": [0, 10], "x": 11.5, "y": 0},
{"matrix": [0, 11], "x": 12.5, "y": 0},
{"matrix": [0, 12], "x": 13.5, "y": 0},
{"matrix": [0, 13], "x": 14.5, "y": 0},
{"matrix": [0, 14], "x": 15.5, "y": 0},
{"matrix": [1, 0], "x": 16.75, "y": 0},
{"matrix": [1, 5], "x": 5, "y": 0},
{"matrix": [0, 5], "x": 6, "y": 0},
{"matrix": [0, 6], "x": 9, "y": 0},
{"matrix": [0, 7], "x": 10, "y": 0},
{"matrix": [0, 8], "x": 11, "y": 0},
{"matrix": [0, 9], "x": 12, "y": 0},
{"matrix": [0, 10], "x": 13, "y": 0},
{"matrix": [0, 11], "x": 14, "y": 0},
{"matrix": [0, 12], "x": 15, "y": 0, "w": 2},
{"matrix": [0, 14], "x": 17.25, "y": 0},

{"matrix": [1, 1], "x": 0, "y": 1, "w": 1.5},
{"matrix": [1, 2], "x": 1.5, "y": 1},
{"matrix": [1, 3], "x": 2.5, "y": 1},
{"matrix": [1, 4], "x": 3.5, "y": 1},
{"matrix": [1, 5], "x": 4.5, "y": 1},
{"matrix": [1, 6], "x": 5.5, "y": 1},
{"matrix": [1, 7], "x": 8, "y": 1},
{"matrix": [1, 8], "x": 9, "y": 1},
{"matrix": [1, 9], "x": 10, "y": 1},
{"matrix": [1, 10], "x": 11, "y": 1},
{"matrix": [1, 11], "x": 12, "y": 1},
{"matrix": [1, 12], "x": 13, "y": 1},
{"matrix": [1, 13], "x": 14, "y": 1},
{"matrix": [1, 14], "x": 15, "y": 1, "w": 1.5},
{"matrix": [2, 0], "x": 16.75, "y": 1},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
{"matrix": [1, 1], "x": 1.5, "y": 1},
{"matrix": [1, 2], "x": 2.5, "y": 1},
{"matrix": [1, 3], "x": 3.5, "y": 1},
{"matrix": [1, 4], "x": 4.5, "y": 1},
{"matrix": [2, 5], "x": 5.5, "y": 1},
{"matrix": [1, 6], "x": 8.5, "y": 1},
{"matrix": [1, 7], "x": 9.5, "y": 1},
{"matrix": [1, 8], "x": 10.5, "y": 1},
{"matrix": [1, 9], "x": 11.5, "y": 1},
{"matrix": [1, 10], "x": 12.5, "y": 1},
{"matrix": [1, 11], "x": 13.5, "y": 1},
{"matrix": [1, 12], "x": 14.5, "y": 1},
{"matrix": [1, 13], "x": 15.5, "y": 1, "w": 1.5},
{"matrix": [1, 14], "x": 17.25, "y": 1},

{"matrix": [2, 1], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 2], "x": 1.75, "y": 2},
{"matrix": [2, 3], "x": 2.75, "y": 2},
{"matrix": [2, 4], "x": 3.75, "y": 2},
{"matrix": [2, 5], "x": 4.75, "y": 2},
{"matrix": [2, 6], "x": 5.75, "y": 2},
{"matrix": [2, 7], "x": 8.25, "y": 2},
{"matrix": [2, 8], "x": 9.25, "y": 2},
{"matrix": [2, 9], "x": 10.25, "y": 2},
{"matrix": [2, 10], "x": 11.25, "y": 2},
{"matrix": [2, 11], "x": 12.25, "y": 2},
{"matrix": [2, 13], "x": 13.25, "y": 2},
{"matrix": [2, 14], "x": 14.25, "y": 2, "w": 2.25},
{"matrix": [3, 0], "x": 16.75, "y": 2},
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
{"matrix": [2, 3], "x": 3.75, "y": 2},
{"matrix": [2, 4], "x": 4.75, "y": 2},
{"matrix": [3, 5], "x": 5.75, "y": 2},
{"matrix": [2, 6], "x": 8.75, "y": 2},
{"matrix": [2, 7], "x": 9.75, "y": 2},
{"matrix": [2, 8], "x": 10.75, "y": 2},
{"matrix": [2, 9], "x": 11.75, "y": 2},
{"matrix": [2, 10], "x": 12.75, "y": 2},
{"matrix": [2, 11], "x": 13.75, "y": 2},
{"matrix": [2, 13], "x": 14.75, "y": 2, "w": 2.25},
{"matrix": [2, 14], "x": 17.25, "y": 2},

{"matrix": [3, 1], "x": 0, "y": 3, "w": 2.25},
{"matrix": [3, 2], "x": 2.25, "y": 3},
{"matrix": [3, 3], "x": 3.25, "y": 3},
{"matrix": [3, 4], "x": 4.25, "y": 3},
{"matrix": [3, 5], "x": 5.25, "y": 3},
{"matrix": [3, 6], "x": 6.25, "y": 3},
{"matrix": [3, 7], "x": 8, "y": 3},
{"matrix": [3, 8], "x": 9, "y": 3},
{"matrix": [3, 9], "x": 10, "y": 3},
{"matrix": [3, 10], "x": 11, "y": 3},
{"matrix": [3, 11], "x": 12, "y": 3},
{"matrix": [3, 12], "x": 13, "y": 3},
{"matrix": [3, 13], "x": 14, "y": 3, "w": 1.5},
{"matrix": [4, 0], "x": 15.75, "y": 3.25},
{"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
{"matrix": [3, 1], "x": 2.25, "y": 3},
{"matrix": [3, 2], "x": 3.25, "y": 3},
{"matrix": [3, 3], "x": 4.25, "y": 3},
{"matrix": [3, 4], "x": 5.25, "y": 3},
{"matrix": [4, 5], "x": 6.25, "y": 3},
{"matrix": [3, 6], "x": 8.25, "y": 3},
{"matrix": [3, 7], "x": 9.25, "y": 3},
{"matrix": [3, 8], "x": 10.25, "y": 3},
{"matrix": [3, 9], "x": 11.25, "y": 3},
{"matrix": [3, 10], "x": 12.25, "y": 3},
{"matrix": [3, 11], "x": 13.25, "y": 3},
{"matrix": [3, 12], "x": 14.25, "y": 3, "w": 1.75},
{"matrix": [3, 13], "x": 16.25, "y": 3.25},

{"matrix": [4, 1], "x": 0, "y": 4, "w": 1.25},
{"matrix": [4, 2], "x": 1.25, "y": 4, "w": 1.25},
{"matrix": [4, 4], "x": 3.25, "y": 4, "w": 1.25},
{"matrix": [4, 5], "x": 4.5, "y": 4, "w": 2.75},
{"matrix": [4, 7], "x": 8, "y": 4, "w": 2.25},
{"matrix": [4, 8], "x": 10.25, "y": 4, "w": 1.25},
{"matrix": [4, 10], "x": 12, "y": 4, "w": 1.25},
{"matrix": [4, 11], "x": 13.25, "y": 4, "w": 1.25},
{"matrix": [4, 12], "x": 14.75, "y": 4.25},
{"matrix": [4, 13], "x": 15.75, "y": 4.25},
{"matrix": [4, 14], "x": 16.75, "y": 4.25}
{"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
{"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
{"matrix": [4, 2], "x": 3.25, "y": 4, "w": 1.25},
{"matrix": [4, 4], "x": 4.5, "y": 4, "w": 2.75},
{"matrix": [4, 7], "x": 8.25, "y": 4, "w": 2.25},
{"matrix": [4, 8], "x": 10.5, "y": 4, "w": 1.25},
{"matrix": [4, 10], "x": 12.25, "y": 4, "w": 1.25},
{"matrix": [4, 11], "x": 13.5, "y": 4, "w": 1.25},
{"matrix": [4, 12], "x": 15.25, "y": 4.25},
{"matrix": [4, 13], "x": 16.25, "y": 4.25},
{"matrix": [4, 14], "x": 17.25, "y": 4.25}
]
},
"LAYOUT_split_bs": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [1, 5], "x": 5, "y": 0},
{"matrix": [0, 5], "x": 6, "y": 0},
{"matrix": [0, 6], "x": 9, "y": 0},
{"matrix": [0, 7], "x": 10, "y": 0},
{"matrix": [0, 8], "x": 11, "y": 0},
{"matrix": [0, 9], "x": 12, "y": 0},
{"matrix": [0, 10], "x": 13, "y": 0},
{"matrix": [0, 11], "x": 14, "y": 0},
{"matrix": [0, 12], "x": 15, "y": 0},
{"matrix": [0, 13], "x": 16, "y": 0},
{"matrix": [0, 14], "x": 17.25, "y": 0},

{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
{"matrix": [1, 1], "x": 1.5, "y": 1},
{"matrix": [1, 2], "x": 2.5, "y": 1},
{"matrix": [1, 3], "x": 3.5, "y": 1},
{"matrix": [1, 4], "x": 4.5, "y": 1},
{"matrix": [2, 5], "x": 5.5, "y": 1},
{"matrix": [1, 6], "x": 8.5, "y": 1},
{"matrix": [1, 7], "x": 9.5, "y": 1},
{"matrix": [1, 8], "x": 10.5, "y": 1},
{"matrix": [1, 9], "x": 11.5, "y": 1},
{"matrix": [1, 10], "x": 12.5, "y": 1},
{"matrix": [1, 11], "x": 13.5, "y": 1},
{"matrix": [1, 12], "x": 14.5, "y": 1},
{"matrix": [1, 13], "x": 15.5, "y": 1, "w": 1.5},
{"matrix": [1, 14], "x": 17.25, "y": 1},

{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
{"matrix": [2, 3], "x": 3.75, "y": 2},
{"matrix": [2, 4], "x": 4.75, "y": 2},
{"matrix": [3, 5], "x": 5.75, "y": 2},
{"matrix": [2, 6], "x": 8.75, "y": 2},
{"matrix": [2, 7], "x": 9.75, "y": 2},
{"matrix": [2, 8], "x": 10.75, "y": 2},
{"matrix": [2, 9], "x": 11.75, "y": 2},
{"matrix": [2, 10], "x": 12.75, "y": 2},
{"matrix": [2, 11], "x": 13.75, "y": 2},
{"matrix": [2, 13], "x": 14.75, "y": 2, "w": 2.25},
{"matrix": [2, 14], "x": 17.25, "y": 2},

{"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
{"matrix": [3, 1], "x": 2.25, "y": 3},
{"matrix": [3, 2], "x": 3.25, "y": 3},
{"matrix": [3, 3], "x": 4.25, "y": 3},
{"matrix": [3, 4], "x": 5.25, "y": 3},
{"matrix": [4, 5], "x": 6.25, "y": 3},
{"matrix": [3, 6], "x": 8.25, "y": 3},
{"matrix": [3, 7], "x": 9.25, "y": 3},
{"matrix": [3, 8], "x": 10.25, "y": 3},
{"matrix": [3, 9], "x": 11.25, "y": 3},
{"matrix": [3, 10], "x": 12.25, "y": 3},
{"matrix": [3, 11], "x": 13.25, "y": 3},
{"matrix": [3, 12], "x": 14.25, "y": 3, "w": 1.75},
{"matrix": [3, 13], "x": 16.25, "y": 3.25},

{"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
{"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
{"matrix": [4, 2], "x": 3.25, "y": 4, "w": 1.25},
{"matrix": [4, 4], "x": 4.5, "y": 4, "w": 2.75},
{"matrix": [4, 7], "x": 8.25, "y": 4, "w": 2.25},
{"matrix": [4, 8], "x": 10.5, "y": 4, "w": 1.25},
{"matrix": [4, 10], "x": 12.25, "y": 4, "w": 1.25},
{"matrix": [4, 11], "x": 13.5, "y": 4, "w": 1.25},
{"matrix": [4, 12], "x": 15.25, "y": 4.25},
{"matrix": [4, 13], "x": 16.25, "y": 4.25},
{"matrix": [4, 14], "x": 17.25, "y": 4.25}
]
}
}
Expand Down
24 changes: 12 additions & 12 deletions keyboards/fjlabs/swordfish/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ enum layers {

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_LAYER0] = LAYOUT_alice_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_MPLY,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_5, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_VOLU,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_T, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_VOLD,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_G, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_B, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
[_LAYER0] = LAYOUT_split_bs(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_MPLY,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_VOLU,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_VOLD,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),

[_LAYER1] = LAYOUT_alice_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_RMOD, RGB_TOG,
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI,
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END
[_LAYER1] = LAYOUT_split_bs(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_RMOD, RGB_TOG,
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI,
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END
)
};
Loading

0 comments on commit 7bafae6

Please sign in to comment.