From 66857b919beccfc9d3395ffe1f88cb39e044aca3 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 23 Sep 2021 08:31:11 +0000 Subject: [PATCH] Wuque Mammoth20x Layout Macro Refactor (#14568) * mammoth20x: edit size of RightEncode key in Configurator * physically arrange layout macro Arranges the keycodes to resemble the assembled board. * rename LAYOUT_default to LAYOUT Includes "layout_aliases" tree in info.json for backwards compatibility. * rules.mk touch-up * convert tabs to spaces * add line break before ENCODER_ENABLE (not included in QMK's template) * readme.md touch-up * remove zero-width space characters * markdown fix for info paragraph * update link text --- keyboards/wuque/mammoth20x/info.json | 11 ++++--- .../wuque/mammoth20x/keymaps/default/keymap.c | 16 +++++----- .../wuque/mammoth20x/keymaps/via/keymap.c | 32 +++++++++---------- keyboards/wuque/mammoth20x/mammoth20x.h | 9 +++--- keyboards/wuque/mammoth20x/readme.md | 10 +++--- keyboards/wuque/mammoth20x/rules.mk | 2 +- 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/keyboards/wuque/mammoth20x/info.json b/keyboards/wuque/mammoth20x/info.json index 552a13b08bd..4b53405c191 100644 --- a/keyboards/wuque/mammoth20x/info.json +++ b/keyboards/wuque/mammoth20x/info.json @@ -2,13 +2,18 @@ "keyboard_name": "mammoth20x", "url": "https://shop.wuquestudio.com/", "maintainer": "spbgzh", + "layout_aliases": { + "LAYOUT_default": "LAYOUT" + }, "layouts": { - "LAYOUT_default": { + "LAYOUT": { "layout": [ { "label": "Esc", "x": 0, "y": 0 }, { "label": "Pause", "x": 1, "y": 0 }, { "label": "Delete", "x": 2, "y": 0 }, - { "label": "E", "x": 3.5, "y": 0 }, + { "label": "LeftEncode", "x": 3, "y": 0, "w": 0.5 }, + { "label": "EncoderClick", "x": 3.5, "y": 0 }, + { "label": "RightEncode", "x": 4.5, "y": 0, "w" : 0.5 }, { "label": "Num", "x": 0, "y": 1 }, { "label": "/", "x": 1, "y": 1 }, @@ -18,7 +23,6 @@ { "label": "7", "x": 0, "y": 2 }, { "label": "8", "x": 1, "y": 2 }, { "label": "9", "x": 2, "y": 2 }, - { "label": "LeftEncode", "x": 3, "y": 0, "w": 0.5 }, { "label": "4", "x": 0, "y": 3 }, { "label": "5", "x": 1, "y": 3 }, @@ -28,7 +32,6 @@ { "label": "1", "x": 0, "y": 4 }, { "label": "2", "x": 1, "y": 4 }, { "label": "3", "x": 2, "y": 4 }, - { "label": "RightEncode", "x": 4.5, "y": 0, "w" : 0.25 }, { "label": "0", "x": 0, "y": 5, "w": 2 }, { "label": ".", "x": 2, "y": 5 }, diff --git a/keyboards/wuque/mammoth20x/keymaps/default/keymap.c b/keyboards/wuque/mammoth20x/keymaps/default/keymap.c index 77946f373dd..e19b3bc172f 100644 --- a/keyboards/wuque/mammoth20x/keymaps/default/keymap.c +++ b/keyboards/wuque/mammoth20x/keymaps/default/keymap.c @@ -17,20 +17,20 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_default( - KC_ESC, KC_PAUS, KC_DEL, KC_MUTE, + [0] = LAYOUT( + KC_ESC, KC_PAUS, KC_DEL, KC_VOLU, KC_MUTE, KC_VOLD, KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, KC_VOLU, + KC_P7, KC_P8, KC_P9, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, KC_VOLD, + KC_P1, KC_P2, KC_P3, KC_P0, KC_PDOT, KC_PENT ), - [1] = LAYOUT_default( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ ), }; diff --git a/keyboards/wuque/mammoth20x/keymaps/via/keymap.c b/keyboards/wuque/mammoth20x/keymaps/via/keymap.c index c8c434a60b4..c8f7c1bb854 100644 --- a/keyboards/wuque/mammoth20x/keymaps/via/keymap.c +++ b/keyboards/wuque/mammoth20x/keymaps/via/keymap.c @@ -17,36 +17,36 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_default( - KC_ESC, KC_PAUS, KC_DEL, KC_MUTE, + [0] = LAYOUT( + KC_ESC, KC_PAUS, KC_DEL, KC_VOLU, KC_MUTE, KC_VOLD, KC_LNUM, KC_PSLS, KC_PAST, KC_PMNS, - KC_P7, KC_P8, KC_P9, KC_VOLU, + KC_P7, KC_P8, KC_P9, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_P1, KC_P2, KC_P3, KC_VOLD, + KC_P1, KC_P2, KC_P3, KC_P0, KC_PDOT, KC_PENT ), - [1] = LAYOUT_default( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ ), - [2] = LAYOUT_default( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT_default( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ ), }; diff --git a/keyboards/wuque/mammoth20x/mammoth20x.h b/keyboards/wuque/mammoth20x/mammoth20x.h index cd0d8d4789e..408788bf605 100644 --- a/keyboards/wuque/mammoth20x/mammoth20x.h +++ b/keyboards/wuque/mammoth20x/mammoth20x.h @@ -18,12 +18,12 @@ #include "quantum.h" -#define LAYOUT_default( \ - K00, K01, K02, K03, \ +#define LAYOUT( \ + K00, K01, K02, K23, K03, K43, \ K10, K11, K12, K13, \ - K20, K21, K22, K23, \ + K20, K21, K22, \ K30, K31, K32, K33, \ - K40, K41, K42, K43, \ + K40, K41, K42, \ K50, K52, K53 \ ) { \ { K00, K01, K02, K03 }, \ @@ -33,4 +33,3 @@ { K40, K41, K42, K43 }, \ { K50, KC_NO, K52, K53 }, \ } - diff --git a/keyboards/wuque/mammoth20x/readme.md b/keyboards/wuque/mammoth20x/readme.md index 4b731a159c4..d98175e9bf9 100644 --- a/keyboards/wuque/mammoth20x/readme.md +++ b/keyboards/wuque/mammoth20x/readme.md @@ -1,11 +1,11 @@ # mammoth20x -​ -More Info at[wuquestudio](https://shop.wuquestudio.com/). -​ + +More info at [Wuque Studio](https://shop.wuquestudio.com/). + * Keyboard Maintainer: [spbgzh](https://github.com/spbgzh) * Hardware Supported: mammoth20x Standard -* Hardware Availability: [mammoth20x](https://shop.wuquestudio.com/) -​ +* Hardware Availability: [Wuque Studio](https://shop.wuquestudio.com/) + Make example for this keyboard (after setting up your build environment): make wuque/mammoth20x:default diff --git a/keyboards/wuque/mammoth20x/rules.mk b/keyboards/wuque/mammoth20x/rules.mk index f400415b614..cba836c456d 100644 --- a/keyboards/wuque/mammoth20x/rules.mk +++ b/keyboards/wuque/mammoth20x/rules.mk @@ -19,5 +19,5 @@ NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Enable Encoder +ENCODER_ENABLE = yes # Enable Encoder