From 4871f651c5328cc8c16d1ec991f3e865094b24c8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 27 Apr 2023 07:45:43 +1000 Subject: Move remaining `LAYOUT_all`s to data driven (#20463) --- keyboards/hub20/hub20.c | 2 +- keyboards/hub20/hub20.h | 137 -------------------------------------------- keyboards/hub20/info.json | 142 +++++++++++++++++++++++++--------------------- 3 files changed, 79 insertions(+), 202 deletions(-) delete mode 100644 keyboards/hub20/hub20.h (limited to 'keyboards/hub20') diff --git a/keyboards/hub20/hub20.c b/keyboards/hub20/hub20.c index f7171c5219..8b1c58e1f7 100644 --- a/keyboards/hub20/hub20.c +++ b/keyboards/hub20/hub20.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "hub20.h" +#include "quantum.h" #ifdef RGB_MATRIX_ENABLE diff --git a/keyboards/hub20/hub20.h b/keyboards/hub20/hub20.h deleted file mode 100644 index a86cc02c77..0000000000 --- a/keyboards/hub20/hub20.h +++ /dev/null @@ -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 . - */ - -#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, ___, }, \ -} - - diff --git a/keyboards/hub20/info.json b/keyboards/hub20/info.json index 991c4ebc46..994b9405d9 100644 --- a/keyboards/hub20/info.json +++ b/keyboards/hub20/info.json @@ -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}, - - {"label":"1", "x":0, "y":4}, - {"label":"2", "x":1, "y":4}, - {"label":"3", "x":2, "y":4}, - - {"label":"0", "x":0, "y":5, "w":2}, - {"label":".", "x":2, "y":5}, - {"label":"Enter", "x":3, "y":4, "h":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, 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} ] } } -- cgit v1.2.3