Move remaining LAYOUT_alls to data driven (#20463)

This commit is contained in:
Ryan
2023-04-27 07:45:43 +10:00
committed by GitHub
parent 67e18c0d6b
commit 4871f651c5
388 changed files with 54548 additions and 55359 deletions

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hub20.h"
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE

View File

@@ -1,137 +0,0 @@
/* Copyright 2020 joshajohnson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
#define ___ KC_NO
/* This is a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
/* LAYOUT_all
* ┌───┬───┐
* │01 │02 │
* ┌───┼───┼───┼───┐
* │10 │11 │12 │13 │
* ├───┼───┼───┼───┤
* │20 │21 │22 │23 │
* ├───┼───┼───┼───┤
* │30 │31 │32 │33 │
* ├───┼───┼───┼───┤
* │40 │41 │42 │43 │
* ├───┼───┼───┼───┤
* │50 │51 │52 │53 │
* └───┴───┴───┴───┘
*/
#define LAYOUT_all( \
K01, K02, \
K10, K11, K12, K13, \
K20, K21, K22, K23, \
K30, K31, K32, K33, \
K40, K41, K42, K43, \
K50, K51, K52, K53 \
) \
{ \
{ ___, K01, K02, ___, }, \
{ K10, K11, K12, K13, }, \
{ K20, K21, K22, K23, }, \
{ K30, K31, K32, K33, }, \
{ K40, K41, K42, K43, }, \
{ K50, K51, K52, K53, }, \
}
/* LAYOUT_left_handed
* ┌───┬───┐
* │01 │02 │
* ┌───┼───┼───┼───┐
* │10 │11 │12 │13 │
* ├───┼───┼───┼───┤
* │ │21 │22 │23 │
* │20 ├───┼───┼───┤
* │ │31 │32 │33 │
* ├───┼───┼───┼───┤
* │ │41 │42 │43 │
* │40 ├───┼───┴───┤
* │ │51 │ 52 │
* └───┴───┴───────┘
*/
#define LAYOUT_left_handed( \
K01, K02, \
K10, K11, K12, K13, \
K21, K22, K23, \
K20, K31, K32, K33, \
K41, K42, K43, \
K40, K51, K52 \
) \
{ \
{ ___, K01, K02, ___, }, \
{ K10, K11, K12, K13, }, \
{ K20, K21, K22, K23, }, \
{ ___, K31, K32, K33, }, \
{ K40, K41, K42, K43, }, \
{ ___, K51, K52, ___, }, \
}
/* LAYOUT_right_handed
* ┌───┬───┐
* │01 │02 │
* ┌───┼───┼───┼───┐
* │10 │11 │12 │13 │
* ├───┼───┼───┼───┤
* │20 │21 │22 │ │
* ├───┼───┼───┤23 │
* │30 │31 │32 │ │
* ├───┼───┼───┼───┤
* │40 │41 │42 │ │
* ├───┴───┼───┤43 │
* │ 50(not sure, confirm) │52 │ │
* └───────┴───┴───┘
*/
//NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
#define LAYOUT_right_handed( \
K01, K02, \
K10, K11, K12, K13, \
K20, K21, K22, \
K30, K31, K32, K23, \
K40, K41, K42, \
K50, K52, K43 \
) \
{ \
{ ___, K01, K02, ___, }, \
{ K10, K11, K12, K13, }, \
{ K20, K21, K22, K23, }, \
{ K30, K31, K32, ___, }, \
{ K40, K41, K42, K43, }, \
{ K50, ___, K52, ___, }, \
}

View File

@@ -30,78 +30,92 @@
"layouts": {
"LAYOUT_all": {
"layout": [
{"label":"Mute", "x":0.5, "y":0},
{"label":"Play / Pause", "x":2.5, "y":0},
{"label":"-", "x":0, "y":1},
{"label":"*", "x":1, "y":1},
{"label":"/", "x":2, "y":1},
{"label":"Numlock", "x":3, "y":1},
{"label":"+", "x":0, "y":2},
{"label":"7", "x":1, "y":2},
{"label":"8", "x":2, "y":2},
{"label":"9", "x":3, "y":2},
{"label":"+", "x":0, "y":3},
{"label":"4", "x":1, "y":3},
{"label":"5", "x":2, "y":3},
{"label":"6", "x":3, "y":3},
{"label":"Enter", "x":0, "y":4},
{"label":"1", "x":1, "y":4},
{"label":"2", "x":2, "y":4},
{"label":"3", "x":3, "y":4},
{"label":"Enter", "x":0, "y":5},
{"label":".", "x":1, "y":5},
{"label":"0", "x":2, "y":5},
{"label":"0", "x":3, "y":5}
{"matrix": [0, 1], "x": 0.5, "y": 0},
{"matrix": [0, 2], "x": 2.5, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3},
{"matrix": [4, 0], "x": 0, "y": 4},
{"matrix": [4, 1], "x": 1, "y": 4},
{"matrix": [4, 2], "x": 2, "y": 4},
{"matrix": [4, 3], "x": 3, "y": 4},
{"matrix": [5, 0], "x": 0, "y": 5},
{"matrix": [5, 1], "x": 1, "y": 5},
{"matrix": [5, 2], "x": 2, "y": 5},
{"matrix": [5, 3], "x": 3, "y": 5}
]
},
"LAYOUT_left_handed": {
"layout": [
{"label":"Mute", "x":0.5, "y":0},
{"label":"Play / Pause", "x":2.5, "y":0},
{"label":"-", "x":0, "y":1},
{"label":"*", "x":1, "y":1},
{"label":"/", "x":2, "y":1},
{"label":"Numlock", "x":3, "y":1},
{"label":"7", "x":1, "y":2},
{"label":"8", "x":2, "y":2},
{"label":"9", "x":3, "y":2},
{"label":"+", "x":0, "y":2, "h":2},
{"label":"4", "x":1, "y":3},
{"label":"5", "x":2, "y":3},
{"label":"6", "x":3, "y":3},
{"label":"Enter", "x":0, "y":4, "h":2},
{"label":"1", "x":1, "y":4},
{"label":"2", "x":2, "y":4},
{"label":"3", "x":3, "y":4},
{"label":".", "x":1, "y":5},
{"label":"0", "x":3, "y":5, "w":2}
{"matrix": [0, 1], "x": 0.5, "y": 0},
{"matrix": [0, 2], "x": 2.5, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [2, 0], "x": 0, "y": 2, "h": 2},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3},
{"matrix": [4, 1], "x": 0, "y": 4, "h": 2},
{"matrix": [4, 2], "x": 1, "y": 4},
{"matrix": [4, 3], "x": 2, "y": 4},
{"matrix": [4, 0], "x": 3, "y": 4},
{"matrix": [5, 1], "x": 1, "y": 5},
{"matrix": [5, 2], "x": 2, "y": 5, "w": 2}
]
},
"LAYOUT_right_handed": {
"layout": [
{"label":"Mute", "x":0.5, "y":0},
{"label":"Play / Pause", "x":2.5, "y":0},
{"label":"Numlock", "x":0, "y":1},
{"label":"/", "x":1, "y":1},
{"label":"*", "x":2, "y":1},
{"label":"-", "x":3, "y":1},
{"label":"7", "x":0, "y":2},
{"label":"8", "x":1, "y":2},
{"label":"9", "x":2, "y":2},
{"label":"4", "x":0, "y":3},
{"label":"5", "x":1, "y":3},
{"label":"6", "x":2, "y":3},
{"label":"+", "x":3, "y":2, "h":2},
{"matrix": [0, 1], "x": 0.5, "y": 0},
{"label":"1", "x":0, "y":4},
{"label":"2", "x":1, "y":4},
{"label":"3", "x":2, "y":4},
{"matrix": [0, 2], "x": 2.5, "y": 0},
{"label":"0", "x":0, "y":5, "w":2},
{"label":".", "x":2, "y":5},
{"label":"Enter", "x":3, "y":4, "h":2}
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [2, 3], "x": 3, "y": 2, "h": 2},
{"matrix": [4, 0], "x": 0, "y": 4},
{"matrix": [4, 1], "x": 1, "y": 4},
{"matrix": [4, 2], "x": 2, "y": 4},
{"matrix": [5, 0], "x": 0, "y": 5, "w": 2},
{"matrix": [5, 2], "x": 2, "y": 5},
{"matrix": [4, 3], "x": 3, "y": 4, "h": 2}
]
}
}