From 5319667c5504ab28b5bdb6f81ae22ecfec5e4a46 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 12 Apr 2018 10:03:50 -0700 Subject: [PATCH] Support upcoming caps_unlocked boards in QMK Configurator (#2738) * Change KEYMAP macro to LAYOUT macro * Add CU24 QMK Configurator Support - Change KEYMAP macro to LAYOUT macro - Add new LAYOUTS to support a default numpad * QMK Configurator Support for CU75 Add LAYOUT_all to support all layouts Add corresponding info.json --- keyboards/cu24/cu24.h | 21 ++++++++++++++++- keyboards/cu24/info.json | 16 +++++++++++++ keyboards/cu24/keymaps/default/keymap.c | 4 ++-- keyboards/cu75/cu75.h | 30 +++++++++++++++++++------ keyboards/cu75/info.json | 16 +++++++++++++ keyboards/cu75/keymaps/default/keymap.c | 4 ++-- keyboards/cu75/keymaps/iso/keymap.c | 4 ++-- 7 files changed, 81 insertions(+), 14 deletions(-) create mode 100644 keyboards/cu24/info.json create mode 100644 keyboards/cu75/info.json diff --git a/keyboards/cu24/cu24.h b/keyboards/cu24/cu24.h index e8e6b46e..d329182d 100644 --- a/keyboards/cu24/cu24.h +++ b/keyboards/cu24/cu24.h @@ -22,7 +22,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT_grid( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, k23, \ @@ -39,4 +39,23 @@ { k50, k51, k52, k53 } \ } +#define LAYOUT_numpad( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, \ + k40, k41, k42, k43, \ + k51, k52 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, KC_NO }, \ + { k40, k41, k42, k43 }, \ + { KC_NO, k51, k52, KC_NO } \ +} + + + #endif diff --git a/keyboards/cu24/info.json b/keyboards/cu24/info.json new file mode 100644 index 00000000..7cd9a3f1 --- /dev/null +++ b/keyboards/cu24/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "cu24", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_grid": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"x":3, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3}, {"label":"0", "x":0, "y":4}, {"x":1, "y":4}, {"label":".", "x":2, "y":4}, {"x":3, "y":4}, {"x":0, "y":5}, {"x":1, "y":5}, {"x":2, "y":5}, {"x":3, "y":5}] + }, + + "LAYOUT_numpad": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"x":3, "y":2, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4}, {"x":1, "y":4}, {"label":".", "x":2, "y":4}, {"x":3, "y":4, "h":2}, {"x":0, "y":5, "w":2}, {"x":2, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/cu24/keymaps/default/keymap.c b/keyboards/cu24/keymaps/default/keymap.c index 8e2f6563..73427ee8 100644 --- a/keyboards/cu24/keymaps/default/keymap.c +++ b/keyboards/cu24/keymaps/default/keymap.c @@ -16,7 +16,7 @@ #include "cu24.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( /* Base */ +[0] = LAYOUT_grid( /* Base */ KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, \ MO(1) , KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7 , KC_P8 , KC_P9 , KC_PPLS, \ @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_P0 , KC_P0 , KC_PDOT, KC_PENT ), -[1] = KEYMAP( /* FN */ +[1] = LAYOUT_grid( /* FN */ RGB_TOG, RGB_MOD, BL_STEP, BL_BRTG, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, \ diff --git a/keyboards/cu75/cu75.h b/keyboards/cu75/cu75.h index e4d7f2f9..250217d9 100644 --- a/keyboards/cu75/cu75.h +++ b/keyboards/cu75/cu75.h @@ -75,13 +75,13 @@ void click(uint16_t freq, uint16_t duration); */ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \ - k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ - k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, \ - k51, k52, k53, k54, k57, k59, k5A, k5B, k5C, k5D, k5E, k5F \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, \ + k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, \ + k51, k52, k53, k54, k57, k59, k5A, k5B, k5C, k5D, k5E, k5F \ ) { \ {k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \ {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, KC_NO, k1G}, \ @@ -91,7 +91,23 @@ void click(uint16_t freq, uint16_t duration); {k51, k52, k53, k54, KC_NO, KC_NO, k57, KC_NO, k59, k5A, k5B, k5C, k5D, k5E, k5F, KC_NO}, \ } -#define ISO_KEYMAP( \ +#define LAYOUT_all( \ + k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \ + k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \ + k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, \ + k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, \ + k51, k52, k53, k54, k57, k59, k5A, k5B, k5C, k5D, k5E, k5F \ +) { \ + {k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G}, \ + {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \ + {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, KC_NO}, \ + {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, KC_NO}, \ + {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, KC_NO}, \ + {k51, k52, k53, k54, KC_NO, KC_NO, k57, KC_NO, k59, k5A, k5B, k5C, k5D, k5E, k5F, KC_NO}, \ +} + +#define LAYOUT_iso( \ k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1G, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k3D, k2F, \ diff --git a/keyboards/cu75/info.json b/keyboards/cu75/info.json new file mode 100644 index 00000000..08f7815b --- /dev/null +++ b/keyboards/cu75/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "cu75", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":2.75}, {"x":6.5, "y":5}, {"x":7.5, "y":5, "w":2.5}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + }, + + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":2.75}, {"x":6.5, "y":5}, {"x":7.5, "y":5, "w":2.5}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/cu75/keymaps/default/keymap.c b/keyboards/cu75/keymaps/default/keymap.c index dfd96fbd..7d13e923 100644 --- a/keyboards/cu75/keymaps/default/keymap.c +++ b/keyboards/cu75/keymaps/default/keymap.c @@ -12,7 +12,7 @@ enum keymap_layout { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = KEYMAP( +[VANILLA] = LAYOUT( /* Keymap VANILLA: (Base Layer) Default Layer * ,------------------------------------------------------------.----. * |Esc | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|F13|F14| F15| @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT,KC_SPC, KC_SPC, KC_SPC,KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), -[FUNC] = KEYMAP( +[FUNC] = LAYOUT( /* Keymap VANILLA: Function Layer * ,-------------------------------------------------------------------. * | | | | | | | | | | | | | | | | | diff --git a/keyboards/cu75/keymaps/iso/keymap.c b/keyboards/cu75/keymaps/iso/keymap.c index f00788e6..baf85b92 100644 --- a/keyboards/cu75/keymaps/iso/keymap.c +++ b/keyboards/cu75/keymaps/iso/keymap.c @@ -12,7 +12,7 @@ enum keymap_layout { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[VANILLA] = ISO_KEYMAP( +[VANILLA] = LAYOUT_iso( /* Keymap VANILLA: (Base Layer) Default Layer * ,------------------------------------------------------------.----. * |Esc | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|F13|F14| F15| @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT,KC_SPC, KC_SPC, KC_SPC,KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT), -[FUNC] = KEYMAP( +[FUNC] = LAYOUT( /* Keymap VANILLA: Function Layer * ,-------------------------------------------------------------------. * | | | | | | | | | | | | | | | | |