From 7c57efaaf9388e003422c8b2c15e4ecd8b10053c Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 2 Jul 2020 15:47:53 +1000 Subject: [PATCH] Fix layouts for FM2U (#9604) * Fix layouts for FM2U * Leave old layout names as deprecated aliases --- keyboards/botanicalkeyboards/fm2u/fm2u.h | 95 ++++++++++++++++--- keyboards/botanicalkeyboards/fm2u/info.json | 93 ++++++++++-------- .../fm2u/keymaps/default/keymap.c | 4 +- .../fm2u/keymaps/via/keymap.c | 11 +-- 4 files changed, 140 insertions(+), 63 deletions(-) diff --git a/keyboards/botanicalkeyboards/fm2u/fm2u.h b/keyboards/botanicalkeyboards/fm2u/fm2u.h index eb5564afc35..83168032590 100644 --- a/keyboards/botanicalkeyboards/fm2u/fm2u.h +++ b/keyboards/botanicalkeyboards/fm2u/fm2u.h @@ -26,21 +26,88 @@ * The second converts the arguments into a two-dimensional array which * represents the switch matrix. */ -#define LAYOUT_100u( \ +#define LAYOUT_1u( \ k00 \ -) \ -{ \ +) { \ { k00 } \ } -#define LAYOUT_125u LAYOUT_100u -#define LAYOUT_150u LAYOUT_100u -#define LAYOUT_175u LAYOUT_100u -#define LAYOUT_200u LAYOUT_100u -#define LAYOUT_225u LAYOUT_100u -#define LAYOUT_275u LAYOUT_100u -#define LAYOUT_300u LAYOUT_100u -#define LAYOUT_600u LAYOUT_100u -#define LAYOUT_625u LAYOUT_100u -#define LAYOUT_700u LAYOUT_100u -#define LAYOUT_iso LAYOUT_100u +#define LAYOUT_1u25( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_1u5( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_1u75( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_2u( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_2u25( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_2u75( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_3u( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_6u( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_6u25( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_7u( \ + k00 \ +) { \ + { k00 } \ +} + +#define LAYOUT_isoenter( \ + k00 \ +) { \ + { k00 } \ +} + +// Backward compatibility TODO: remove these +#define LAYOUT_100u LAYOUT_1u +#define LAYOUT_125u LAYOUT_1u25 +#define LAYOUT_150u LAYOUT_1u5 +#define LAYOUT_175u LAYOUT_1u75 +#define LAYOUT_200u LAYOUT_2u +#define LAYOUT_225u LAYOUT_2u25 +#define LAYOUT_275u LAYOUT_2u75 +#define LAYOUT_300u LAYOUT_3u +#define LAYOUT_600u LAYOUT_6u +#define LAYOUT_625u LAYOUT_6u25 +#define LAYOUT_700u LAYOUT_7u +#define LAYOUT_iso LAYOUT_isoenter diff --git a/keyboards/botanicalkeyboards/fm2u/info.json b/keyboards/botanicalkeyboards/fm2u/info.json index 6831dad9445..1798e19435d 100644 --- a/keyboards/botanicalkeyboards/fm2u/info.json +++ b/keyboards/botanicalkeyboards/fm2u/info.json @@ -1,56 +1,69 @@ { - "keyboard_name": "fm2u", - "url": "", - "maintainer": "qmk", - "width": 1, - "height": 1, + "keyboard_name": "Botanical Keyboards FM2U", + "url": "", + "maintainer": "qmk", + "width": 1, + "height": 1, "layouts": { - "LAYOUT_100u": { - "layout": [{"x":0, "y":0}] + "LAYOUT_1u": { + "layout": [ + {"x": 0, "y": 0} + ] }, - - "LAYOUT_125u": { - "layout": [{"x":0, "y":0, "w":1.25}] + "LAYOUT_1u25": { + "layout": [ + {"x": 0, "y": 0, "w": 1.25} + ] }, - - "LAYOUT_150u": { - "layout": [{"x":0, "y":0, "w":1.50}] + "LAYOUT_1u5": { + "layout": [ + {"x": 0, "y": 0, "w": 1.50} + ] }, - - "LAYOUT_175u": { - "layout": [{"x":0, "y":0, "w":1.75}] + "LAYOUT_1u75": { + "layout": [ + {"x": 0, "y": 0, "w": 1.75} + ] }, - - "LAYOUT_200u": { - "layout": [{"x":0, "y":0, "w":2.00}] + "LAYOUT_2u": { + "layout": [ + {"x": 0, "y": 0, "w": 2} + ] }, - - "LAYOUT_225u": { - "layout": [{"x":0, "y":0, "w":2.25}] + "LAYOUT_2u25": { + "layout": [ + {"x": 0, "y": 0, "w": 2.25} + ] }, - - "LAYOUT_275u": { - "layout": [{"x":0, "y":0, "w":2.75}] + "LAYOUT_2u75": { + "layout": [ + {"x": 0, "y": 0, "w": 2.75} + ] }, - - "LAYOUT_300u": { - "layout": [{"x":0, "y":0, "w":3.00}] + "LAYOUT_3u": { + "layout": [ + {"x": 0, "y": 0, "w": 3} + ] }, - - "LAYOUT_600u": { - "layout": [{"x":0, "y":0, "w":6.00}] + "LAYOUT_6u": { + "layout": [ + {"x": 0, "y": 0, "w": 6} + ] }, - - "LAYOUT_625u": { - "layout": [{"x":0, "y":0, "w":6.25}] + "LAYOUT_6u25": { + "layout": [ + {"x": 0, "y": 0, "w": 6.25} + ] }, - - "LAYOUT_700u": { - "layout": [{"x":0, "y":0, "w":7.00}] + "LAYOUT_7u": { + "layout": [ + {"x": 0, "y": 0, "w": 7} + ] }, - - "LAYOUT_iso": { - "layout": [{"x":0.25, "y":0, "w":1.25, "h":2}] + "LAYOUT_isoenter": { + "layout": [ + {"x": 0.25, "y": 0, "w": 1.25, "h": 2} + ] } } } diff --git a/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c b/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c index afefa35334b..b1c7eb9d361 100644 --- a/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c +++ b/keyboards/botanicalkeyboards/fm2u/keymaps/default/keymap.c @@ -15,11 +15,9 @@ */ #include QMK_KEYBOARD_H - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [0] = LAYOUT_100u( + [0] = LAYOUT_2u( KC_B ) }; - diff --git a/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c b/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c index 01b00f18781..2adc87a13be 100644 --- a/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c +++ b/keyboards/botanicalkeyboards/fm2u/keymaps/via/keymap.c @@ -18,20 +18,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base */ - [0] = LAYOUT_100u( + [0] = LAYOUT_2u( KC_B ), - [1] = LAYOUT_100u( + [1] = LAYOUT_2u( KC_TRNS ), - [2] = LAYOUT_100u( + [2] = LAYOUT_2u( KC_TRNS ), - [3] = LAYOUT_100u( + [3] = LAYOUT_2u( KC_TRNS - ), + ) }; -