Skip to content

Commit

Permalink
Ducky One2mini Layout Macro fixes (qmk#14002)
Browse files Browse the repository at this point in the history
  • Loading branch information
noroadsleft authored and Victor Isaac Chavez Escamilla committed Aug 28, 2021
1 parent 357f7db commit 5d480b9
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 60 deletions.
58 changes: 30 additions & 28 deletions keyboards/ducky/one2mini/1861st/1861st.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "quantum.h"

#define XXX KC_NO

/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
Expand All @@ -30,39 +32,39 @@
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, KC_NO }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \
{ k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, XXX }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, XXX }, \
{ k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX } \
}

#define LAYOUT_ansi( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
#define LAYOUT_60_ansi( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, KC_NO }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, KC_NO }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \
{ k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, XXX }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, XXX }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, XXX }, \
{ k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, XXX }, \
{ k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX } \
}

#define LAYOUT_iso( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
#define LAYOUT_60_iso( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, KC_NO, }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, KC_NO, KC_NO, }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO, }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO, }, \
{ k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, XXX }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, XXX, XXX }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, XXX }, \
{ k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d, XXX } \
}
24 changes: 19 additions & 5 deletions keyboards/ducky/one2mini/1861st/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"keyboard_name": "Ducky One 2 Mini",
"width": 14,
"height": 5,
"layout_aliases": {
"LAYOUT_iso": "LAYOUT_60_iso"
},
"layouts": {
"LAYOUT_all": {
"layout": [
Expand All @@ -19,6 +22,7 @@
{ "x": 11, "y": 0, "w": 1, "label": "DASH" },
{ "x": 12, "y": 0, "w": 1, "label": "EQUALSIGN" },
{ "x": 13, "y": 0, "w": 2, "label": "BACKSPACE" },

{ "x": 0, "y": 1, "w": 1.5, "label": "TAB" },
{ "x": 1.5, "y": 1, "w": 1, "label": "Q" },
{ "x": 2.5, "y": 1, "w": 1, "label": "W" },
Expand All @@ -33,6 +37,7 @@
{ "x": 11.5, "y": 1, "w": 1, "label": "LBRACKET" },
{ "x": 12.5, "y": 1, "w": 1, "label": "RBRACKET" },
{ "x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH" },

{ "x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK" },
{ "x": 1.75, "y": 2, "w": 1, "label": "A" },
{ "x": 2.75, "y": 2, "w": 1, "label": "S" },
Expand All @@ -47,6 +52,7 @@
{ "x": 11.75, "y": 2, "w": 1, "label": "QUOTE" },
{ "x": 12.75, "y": 2, "w": 1, "label": "ISOHASH" },
{ "x": 13.75, "y": 2, "w": 1.25, "label": "ENTER" },

{ "x": 0, "y": 3, "w": 1.25, "label": "LSHIFT" },
{ "x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH" },
{ "x": 2.25, "y": 3, "w": 1, "label": "Z" },
Expand All @@ -59,7 +65,8 @@
{ "x": 9.25, "y": 3, "w": 1, "label": "COMMA" },
{ "x": 10.25, "y": 3, "w": 1, "label": "PERIOD" },
{ "x": 11.25, "y": 3, "w": 1, "label": "SLASH" },
{ "x": 12.25, "y": 3, "w": 2.25, "label": "RSHIFT" },
{ "x": 12.25, "y": 3, "w": 2.75, "label": "RSHIFT" },

{ "x": 0, "y": 4, "w": 1.25, "label": "LCTRL" },
{ "x": 1.25, "y": 4, "w": 1.25, "label": "LCMD" },
{ "x": 2.5, "y": 4, "w": 1.25, "label": "LALT" },
Expand All @@ -71,7 +78,7 @@
]
},

"LAYOUT_ansi": {
"LAYOUT_60_ansi": {
"layout": [
{ "x": 0, "y": 0, "w": 1, "label": "ESC" },
{ "x": 1, "y": 0, "w": 1, "label": "1" },
Expand All @@ -87,6 +94,7 @@
{ "x": 11, "y": 0, "w": 1, "label": "DASH" },
{ "x": 12, "y": 0, "w": 1, "label": "EQUALSIGN" },
{ "x": 13, "y": 0, "w": 2, "label": "BACKSPACE" },

{ "x": 0, "y": 1, "w": 1.5, "label": "TAB" },
{ "x": 1.5, "y": 1, "w": 1, "label": "Q" },
{ "x": 2.5, "y": 1, "w": 1, "label": "W" },
Expand All @@ -101,6 +109,7 @@
{ "x": 11.5, "y": 1, "w": 1, "label": "LBRACKET" },
{ "x": 12.5, "y": 1, "w": 1, "label": "RBRACKET" },
{ "x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH" },

{ "x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK" },
{ "x": 1.75, "y": 2, "w": 1, "label": "A" },
{ "x": 2.75, "y": 2, "w": 1, "label": "S" },
Expand All @@ -113,8 +122,8 @@
{ "x": 9.75, "y": 2, "w": 1, "label": "L" },
{ "x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON" },
{ "x": 11.75, "y": 2, "w": 1, "label": "QUOTE" },
{ "x": 12.75, "y": 2, "w": 1, "label": "ISOHASH" },
{ "x": 12.75, "y": 2, "w": 2.25, "label": "ENTER" },

{ "x": 0, "y": 3, "w": 2.25, "label": "LSHIFT" },
{ "x": 2.25, "y": 3, "w": 1, "label": "Z" },
{ "x": 3.25, "y": 3, "w": 1, "label": "X" },
Expand All @@ -127,6 +136,7 @@
{ "x": 10.25, "y": 3, "w": 1, "label": "PERIOD" },
{ "x": 11.25, "y": 3, "w": 1, "label": "SLASH" },
{ "x": 12.25, "y": 3, "w": 2.75, "label": "RSHIFT" },

{ "x": 0, "y": 4, "w": 1.25, "label": "LCTRL" },
{ "x": 1.25, "y": 4, "w": 1.25, "label": "LCMD" },
{ "x": 2.5, "y": 4, "w": 1.25, "label": "LALT" },
Expand All @@ -138,7 +148,7 @@
]
},

"LAYOUT_iso": {
"LAYOUT_60_iso": {
"layout": [
{ "x": 0, "y": 0, "w": 1, "label": "ESC" },
{ "x": 1, "y": 0, "w": 1, "label": "1" },
Expand All @@ -154,6 +164,7 @@
{ "x": 11, "y": 0, "w": 1, "label": "DASH" },
{ "x": 12, "y": 0, "w": 1, "label": "EQUALSIGN" },
{ "x": 13, "y": 0, "w": 2, "label": "BACKSPACE" },

{ "x": 0, "y": 1, "w": 1.5, "label": "TAB" },
{ "x": 1.5, "y": 1, "w": 1, "label": "Q" },
{ "x": 2.5, "y": 1, "w": 1, "label": "W" },
Expand All @@ -167,7 +178,7 @@
{ "x": 10.5, "y": 1, "w": 1, "label": "P" },
{ "x": 11.5, "y": 1, "w": 1, "label": "LBRACKET" },
{ "x": 12.5, "y": 1, "w": 1, "label": "RBRACKET" },
{ "x": 13.75, "y": 1, "w": 1.25, "h": 2, "label": "ENTER" },

{ "x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK" },
{ "x": 1.75, "y": 2, "w": 1, "label": "A" },
{ "x": 2.75, "y": 2, "w": 1, "label": "S" },
Expand All @@ -181,6 +192,8 @@
{ "x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON" },
{ "x": 11.75, "y": 2, "w": 1, "label": "QUOTE" },
{ "x": 12.75, "y": 2, "w": 1, "label": "ISOHASH" },
{ "x": 13.75, "y": 1, "w": 1.25, "h": 2, "label": "ENTER" },

{ "x": 0, "y": 3, "w": 1.25, "label": "LSHIFT" },
{ "x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH" },
{ "x": 2.25, "y": 3, "w": 1, "label": "Z" },
Expand All @@ -194,6 +207,7 @@
{ "x": 10.25, "y": 3, "w": 1, "label": "PERIOD" },
{ "x": 11.25, "y": 3, "w": 1, "label": "SLASH" },
{ "x": 12.25, "y": 3, "w": 2.75, "label": "RSHIFT" },

{ "x": 0, "y": 4, "w": 1.25, "label": "LCTRL" },
{ "x": 1.25, "y": 4, "w": 1.25, "label": "LCMD" },
{ "x": 2.5, "y": 4, "w": 1.25, "label": "LALT" },
Expand Down
24 changes: 12 additions & 12 deletions keyboards/ducky/one2mini/keymaps/ansi/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@ enum Layer {

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

[_QWERTY] = LAYOUT_ansi(
[_QWERTY] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14
KC_GESC, 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_BSPC,
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_NUBS,
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_NUHS, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL
),

[_FUNCTION] = LAYOUT_ansi(
[_FUNCTION] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
_______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, _______,
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, KC_SLCK, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, _______, KC_ENT,
_______, _______, KC_APP, _______, _______, _______, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, KC_APP, MO(_CLR), _______, _______, KC_APP, _______, _______
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, KC_SLCK, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, KC_ENT,
_______, _______, KC_APP, _______, _______, _______, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, KC_APP, MO(_CLR), _______, _______, KC_APP, _______, _______
),

[_COLOUR] = LAYOUT_ansi(
[_COLOUR] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, RGB_TOG, _______, _______, _______, _______
_______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, RGB_TOG, _______, _______, _______, _______
),
};
12 changes: 6 additions & 6 deletions keyboards/ducky/one2mini/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_GESC, 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_BSPC,
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_BSLS,
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_NUHS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN), KC_RCTL
),

[_FUNCTION] = LAYOUT_all(
// 2 3 4 5 6 7 8 9 10 11 12 13 14
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
_______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, _______,
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, KC_SLCK, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, _______, KC_ENT,
_______, _______, _______, KC_APP, _______, _______, _______, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, _______, MO(_CLR), KC_MPLY, _______, KC_APP, _______, _______
_______, _______, _______, KC_APP, _______, _______, _______, KC_CALC, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, _______, MO(_CLR), KC_MPLY, _______, KC_APP, _______, _______
),

[_COLOUR] = LAYOUT_all(
// 2 3 4 5 6 7 8 9 10 11 12 13 14
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, RGB_TOG, _______, _______, _______, _______
_______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, RGB_TOG, _______, _______, _______, _______
),
};
Loading

0 comments on commit 5d480b9

Please sign in to comment.