From 84ea77ead663624a6d8ae451ca3d4318008d9d41 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 4 Nov 2021 21:18:09 +0000 Subject: Remove `BOOTMAGIC_ENABLE = lite` option (#15002) * remove BOOTMAGIC_ENABLE=lite setting * change keyboard BOOTMAGIC_ENABLE rules Edits keyboard-level instances of `BOOTMAGIC_ENABLE = lite` to `BOOTMAGIC_ENABLE = yes`. * change keyboard BOOTMAGIC_ENABLE inline comments Edits keyboard-level BOOTMAGIC_ENABLE inline comments to "Enable Bootmagic Lite". * change keymap BOOTMAGIC_ENABLE rules Edits keymap-level instances of `BOOTMAGIC_ENABLE = lite` to `BOOTMAGIC_ENABLE = yes`. * change keymap BOOTMAGIC_ENABLE inline comments Edits/adds keymap-level BOOTMAGIC_ENABLE inline comments to read "Enable Bootmagic Lite". * change layout/user BOOTMAGIC_ENABLE rules/comments Edits instances of `BOOTMAGIC_ENABLE = lite` to `BOOTMAGIC_ENABLE = yes`. Edits/adds keymap-level BOOTMAGIC_ENABLE inline comments to read "Enable Bootmagic Lite". * update non-rules.mk BOOTMAGIC_ENABLE references in keyboards/ * remove docs references to Full Bootmagic * convert data-driven Bootmagic Lite instances * remove Bootmagic Lite bodge from data-driven generation * Merge remote-tracking branch 'upstream/develop' into rm/bootmagic-full_q4a * update docs/ja/config_options.md per mtei * update docs/faq_misc.md per mtei Remove remaining Full Bootmagic reference. --- keyboards/keychron/q1/rev_0102/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0102/rules.mk b/keyboards/keychron/q1/rev_0102/rules.mk index 6b50d689d3..978cae719e 100644 --- a/keyboards/keychron/q1/rev_0102/rules.mk +++ b/keyboards/keychron/q1/rev_0102/rules.mk @@ -7,7 +7,7 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug -- cgit v1.2.1 From 160b0558f55f1357e1a48175c949e98d32630e6b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 15 Nov 2021 10:41:04 -0800 Subject: Require explicit enabling of RGB Matrix modes (#15018) --- keyboards/keychron/q1/config.h | 63 ++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 15 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/config.h b/keyboards/keychron/q1/config.h index 2a8665c1b4..149280161f 100644 --- a/keyboards/keychron/q1/config.h +++ b/keyboards/keychron/q1/config.h @@ -46,18 +46,51 @@ /* NKRO */ #define FORCE_NKRO -/* Disable a single effect */ -#define DISABLE_RGB_MATRIX_ALPHAS_MODS -#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define DISABLE_RGB_MATRIX_BAND_SAT -#define DISABLE_RGB_MATRIX_BAND_VAL -#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define DISABLE_RGB_MATRIX_HUE_BREATHING -#define DISABLE_RGB_MATRIX_HUE_PENDULUM -#define DISABLE_RGB_MATRIX_HUE_WAVE \ No newline at end of file +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +// #define ENABLE_RGB_MATRIX_ALPHAS_MODS +// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +// #define ENABLE_RGB_MATRIX_BAND_SAT +// #define ENABLE_RGB_MATRIX_BAND_VAL +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +// #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// #define ENABLE_RGB_MATRIX_HUE_BREATHING +// #define ENABLE_RGB_MATRIX_HUE_PENDULUM +// #define ENABLE_RGB_MATRIX_HUE_WAVE +// #define ENABLE_RGB_MATRIX_PIXEL_RAIN +// #define ENABLE_RGB_MATRIX_PIXEL_FLOW +// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -- cgit v1.2.1 From 282e916d86a5d353b7cbdfef3afad3c7b011eb14 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 24 Nov 2021 07:38:49 +0000 Subject: Remove use of __flash due to LTO issues (#15268) --- keyboards/keychron/q1/rev_0100/rev_0100.c | 2 +- keyboards/keychron/q1/rev_0102/rev_0102.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0100/rev_0100.c b/keyboards/keychron/q1/rev_0100/rev_0100.c index abc4f2716c..f424669527 100644 --- a/keyboards/keychron/q1/rev_0100/rev_0100.c +++ b/keyboards/keychron/q1/rev_0100/rev_0100.c @@ -17,7 +17,7 @@ #include "quantum.h" -const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/keychron/q1/rev_0102/rev_0102.c b/keyboards/keychron/q1/rev_0102/rev_0102.c index 722284aaaf..e8a2c85ae3 100644 --- a/keyboards/keychron/q1/rev_0102/rev_0102.c +++ b/keyboards/keychron/q1/rev_0102/rev_0102.c @@ -17,7 +17,7 @@ #include "quantum.h" -const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver * | R location -- cgit v1.2.1 From c12b99767921366c9fa8a1d6ba53872a26aa6127 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 1 Dec 2021 21:13:00 +1100 Subject: Tidy up `SLEEP_LED_ENABLE` rules (#15362) --- keyboards/keychron/q1/rev_0100/rules.mk | 2 -- keyboards/keychron/q1/rev_0102/rules.mk | 2 -- 2 files changed, 4 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0100/rules.mk b/keyboards/keychron/q1/rev_0100/rules.mk index 450ca2e66a..c82a14aab3 100644 --- a/keyboards/keychron/q1/rev_0100/rules.mk +++ b/keyboards/keychron/q1/rev_0100/rules.mk @@ -12,8 +12,6 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality diff --git a/keyboards/keychron/q1/rev_0102/rules.mk b/keyboards/keychron/q1/rev_0102/rules.mk index 978cae719e..d515378fc9 100644 --- a/keyboards/keychron/q1/rev_0102/rules.mk +++ b/keyboards/keychron/q1/rev_0102/rules.mk @@ -12,8 +12,6 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -- cgit v1.2.1 From a8d440e4e043dc8427f17c07631556d0ff3efc20 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 9 Dec 2021 16:05:44 +1100 Subject: Tidy up NKRO_ENABLE rules (#15382) --- keyboards/keychron/q1/rev_0100/rules.mk | 3 +-- keyboards/keychron/q1/rev_0102/rules.mk | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0100/rules.mk b/keyboards/keychron/q1/rev_0100/rules.mk index c82a14aab3..6a512a8faa 100644 --- a/keyboards/keychron/q1/rev_0100/rules.mk +++ b/keyboards/keychron/q1/rev_0100/rules.mk @@ -12,8 +12,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output diff --git a/keyboards/keychron/q1/rev_0102/rules.mk b/keyboards/keychron/q1/rev_0102/rules.mk index d515378fc9..cae73214ae 100644 --- a/keyboards/keychron/q1/rev_0102/rules.mk +++ b/keyboards/keychron/q1/rev_0102/rules.mk @@ -12,8 +12,7 @@ MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = yes # USB Nkey Rollover +NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output -- cgit v1.2.1 From 743f78022127ad15e8ad4c736375516735469d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hor=C3=A1k?= Date: Mon, 27 Dec 2021 02:42:01 +0000 Subject: [Keymap] Add keymap for the Keychron Q1 ISO layout (#14853) * Add keymap for the Keychron Q1 ISO layout - The rightest key column is: Ins, Home, PgUp, PgDn, which differs from the default. - RGB lighting turns off when the computer sleeps - Caps Lock and alpha keys turn red to indicate when Caps Lock is on - When the Fn layer is active, RGB lighting turns off for keys that are not assigned * Update keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.c Suggestion from review Co-authored-by: Drashna Jaelre Co-authored-by: Drashna Jaelre --- .../q1/rev_0102/keymaps/kubahorak/README.md | 16 +++++ .../q1/rev_0102/keymaps/kubahorak/config.h | 25 ++++++++ .../q1/rev_0102/keymaps/kubahorak/keymap.c | 66 +++++++++++++++++++ .../q1/rev_0102/keymaps/kubahorak/keymap_user.h | 28 ++++++++ .../rev_0102/keymaps/kubahorak/rgb_matrix_user.c | 75 ++++++++++++++++++++++ .../rev_0102/keymaps/kubahorak/rgb_matrix_user.h | 24 +++++++ .../q1/rev_0102/keymaps/kubahorak/rules.mk | 6 ++ 7 files changed, 240 insertions(+) create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/README.md create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/config.h create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap.c create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap_user.h create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.c create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.h create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rules.mk (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/README.md b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/README.md new file mode 100644 index 0000000000..3cfae17543 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/README.md @@ -0,0 +1,16 @@ +# kubahorak's Keychron Q1 keymap + +This ISO layout got heavily inspired by gtg465x's ANSI keymap (rev_0100). + +Features: +- The rightest key column is: Ins, Home, PgUp, PgDn, which differs from the default. +- RGB lighting turns off when the computer sleeps +- Caps Lock and alpha keys turn red to indicate when Caps Lock is on +- When the Fn layer is active, RGB lighting turns off for keys that are not assigned + +## Changelog + +### 2021-10-17 - 1.0.0 + +- Initial release + diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/config.h b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/config.h new file mode 100644 index 0000000000..55dbb74d4a --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/config.h @@ -0,0 +1,25 @@ +/* Copyright 2021 Jakub Horak (@kubahorak) + * + * 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 + +#ifdef RGB_MATRIX_ENABLE +/* from rev_0100/keymaps/gtg465x */ +# define RGB_DISABLE_WHEN_USB_SUSPENDED +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +# define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS +# define FN_LAYER_TRANSPARENT_KEYS_OFF +#endif diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap.c b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap.c new file mode 100644 index 0000000000..479988dfa9 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2021 Jakub Horak (@kubahorak) + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_user.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif + +// clang-format off + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_iso_83( + KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_HOME, + 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_PGUP, + 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_PGDN, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_iso_83( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [2] = LAYOUT_iso_83( + KC_ESC, 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_INS, + KC_GRV, 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_HOME, + 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_PGUP, + 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_PGDN, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(3), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [3] = LAYOUT_iso_83( + KC_TRNS, KC_BRID, KC_BRIU, LGUI(KC_TAB), LGUI(KC_E), RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +// clang-format on + +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap_user.h b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap_user.h new file mode 100644 index 0000000000..728114d556 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/keymap_user.h @@ -0,0 +1,28 @@ +/* Copyright 2021 @ Grayson Carr + * + * 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 + +// clang-format off + +enum layers { + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +// clang-format on diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.c b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.c new file mode 100644 index 0000000000..8650f30df1 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.c @@ -0,0 +1,75 @@ +/* Copyright 2021 @ Grayson Carr + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "rgb_matrix_user.h" +#include "keymap_user.h" + +keypos_t led_index_key_position[DRIVER_LED_TOTAL]; + +void rgb_matrix_init_user(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t led_index = g_led_config.matrix_co[row][col]; + if (led_index != NO_LED) { + led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; + } + } + } +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif + break; + case MAC_FN: + case WIN_FN: +#ifdef FN_LAYER_TRANSPARENT_KEYS_OFF + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); +#endif + break; + } +} + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if ((*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +bool is_caps_lock_indicator(uint16_t keycode) { + switch (keycode) { +#ifdef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS + case KC_A ... KC_Z: +#endif + case KC_CAPS: + return true; + default: + return false; + } +} + +bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.h b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.h new file mode 100644 index 0000000000..dead454167 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rgb_matrix_user.h @@ -0,0 +1,24 @@ +/* Copyright 2021 @ Grayson Carr + * + * 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 + +void rgb_matrix_init_user(void); + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); + +bool is_caps_lock_indicator(uint16_t keycode); +bool is_transparent(uint16_t keycode); diff --git a/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rules.mk b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rules.mk new file mode 100644 index 0000000000..af720e37ee --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/kubahorak/rules.mk @@ -0,0 +1,6 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif \ No newline at end of file -- cgit v1.2.1 From 6ec9cd511df29a0bf788818e3cecf636d836af3c Mon Sep 17 00:00:00 2001 From: Victor Savu Gabriel Date: Mon, 27 Dec 2021 11:22:27 +0100 Subject: Addd victorsavu3's Keychron Q1 keymap (ISO) (#15517) Co-authored-by: Savu Victor-Gabriel --- .../q1/rev_0102/keymaps/victorsavu3/config.h | 69 ++++++++++ .../q1/rev_0102/keymaps/victorsavu3/keymap.c | 152 +++++++++++++++++++++ .../q1/rev_0102/keymaps/victorsavu3/readme.md | 4 + .../q1/rev_0102/keymaps/victorsavu3/rules.mk | 3 + 4 files changed, 228 insertions(+) create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/config.h create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/keymap.c create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/readme.md create mode 100644 keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/rules.mk (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/config.h b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/config.h new file mode 100644 index 0000000000..8120a9352a --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/config.h @@ -0,0 +1,69 @@ +/* Copyright 2021 @ Victor-Gabriel Savu + * + * 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 + +// disable all default effects +#undef ENABLE_RGB_MATRIX_BREATHING +#undef ENABLE_RGB_MATRIX_CYCLE_ALL +#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#undef ENABLE_RGB_MATRIX_DUAL_BEACON +#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON +#undef ENABLE_RGB_MATRIX_RAINDROPS +#undef ENABLE_RGB_MATRIX_TYPING_HEATMAP +#undef ENABLE_RGB_MATRIX_DIGITAL_RAIN +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#undef ENABLE_RGB_MATRIX_SPLASH +#undef ENABLE_RGB_MATRIX_MULTISPLASH +#undef ENABLE_RGB_MATRIX_SOLID_SPLASH +#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +// Allow fancy RGB +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS + +// Simple RGB +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT + +// Reactive RGB +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + +#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_TYPING_HEATMAP + +#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50 + +// Unicode for Linux +#define UNICODE_SELECTED_MODES UC_LNX +#define UNICODE_KEY_LNX LCTL(LSFT(KC_U)) + +// Leader config +#define LEADER_PER_KEY_TIMING +#define LEADER_TIMEOUT 500 diff --git a/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/keymap.c b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/keymap.c new file mode 100644 index 0000000000..1f56295fa9 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/keymap.c @@ -0,0 +1,152 @@ +/* Copyright 2021 @ Victor-Gabriel Savu + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +enum unicode_names { + GRIN, + SAD, +}; + +const uint32_t PROGMEM unicode_map[] = { + [GRIN] = 0x1F600, // ๐Ÿ˜€ + [SAD] = 0x1F61E, // ๐Ÿ˜ž +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[MAC_BASE] = LAYOUT_iso_83( + KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[MAC_FN] = LAYOUT_iso_83( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[WIN_BASE] = LAYOUT_iso_83( + KC_ESC, 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, X(SAD), + KC_GRV, 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, X(GRIN), + 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_PGUP, + KC_LEAD, 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_PGDN, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[WIN_FN] = LAYOUT_iso_83( + KC_TRNS, KC_BRID, KC_BRIU, KC_CALC, KC_FLXP, RGB_VAD, RGB_VAI, KC_TRNS, KC_PSCR, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END) + +}; + +static bool wiggle_mouse; +static uint16_t wiggle_timer; +static uint16_t next_wiggle; + + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_LEAD) { + tap_code(KC_CAPS); + } + + SEQ_FOUR_KEYS(KC_I, KC_D, KC_L, KC_E) { + wiggle_mouse = !wiggle_mouse; + wiggle_timer = timer_read(); + } + + SEQ_TWO_KEYS(KC_O, KC_K) { + send_unicode_string("๐Ÿ‘"); + } + + SEQ_THREE_KEYS(KC_S, KC_A, KC_D) { + send_unicode_string("๐Ÿ˜ž"); + } + + SEQ_FIVE_KEYS(KC_C, KC_H, KC_E, KC_C, KC_K) { + send_unicode_string("โœ…"); + } + + SEQ_FIVE_KEYS(KC_C, KC_R, KC_O, KC_S, KC_S) { + send_unicode_string("โŽ"); + } + + SEQ_FIVE_KEYS(KC_T, KC_H, KC_A, KC_N, KC_K) { + send_unicode_string("๐Ÿ™"); + } + + SEQ_FIVE_KEYS(KC_S, KC_M, KC_I, KC_L, KC_E) { + send_unicode_string("๐Ÿ˜Š"); + } + + SEQ_FIVE_KEYS(KC_P, KC_A, KC_R, KC_T, KC_Y) { + send_unicode_string("๐ŸŽ‰"); + } + + SEQ_FOUR_KEYS(KC_E, KC_Y, KC_E, KC_S) { + send_unicode_string("(เฒ _เฒ )"); + } + + SEQ_FIVE_KEYS(KC_M, KC_A, KC_G, KC_I, KC_C) { + send_unicode_string("(เฒ _เฒ ) ๐Ÿช„ โ โญ’*.โœซ.*โญ’โ "); + } + + SEQ_FIVE_KEYS(KC_T, KC_A, KC_B, KC_L, KC_E) { + send_unicode_string("(ใƒŽเฒ ็—Šเฒ )ใƒŽๅฝกโ”ปโ”โ”ป"); + } + + SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) { + send_unicode_string("ยฏ\\_(ใƒ„)_/ยฏ"); + } + } + + if (wiggle_mouse && timer_elapsed(wiggle_timer) > next_wiggle) { + wiggle_timer = timer_read(); + + uint8_t rval = TCNT0 + TCNT1 + TCNT3 + TCNT4; + next_wiggle = rval % 1000; + + if (rval & 1) tap_code(KC_MS_UP); + if (rval & 2) tap_code(KC_MS_DOWN); + if (rval & 4) tap_code(KC_MS_LEFT); + if (rval & 8) tap_code(KC_MS_RIGHT); + } +} diff --git a/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/readme.md b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/readme.md new file mode 100644 index 0000000000..c96130816e --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/readme.md @@ -0,0 +1,4 @@ +# victorsavu3's Keychron Q1 keymap (ISO) + +Very similar to the default layout. Enables reactive and framebuffer RGB, but disables most effects enabled by keychron. +Uses Caps Lock as a leader key for emojis and to enable a random mouse wiggler to prevent the system from going to sleep. diff --git a/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/rules.mk b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/rules.mk new file mode 100644 index 0000000000..853c414ec7 --- /dev/null +++ b/keyboards/keychron/q1/rev_0102/keymaps/victorsavu3/rules.mk @@ -0,0 +1,3 @@ +MOUSEKEY_ENABLE = yes +UNICODEMAP_ENABLE = yes +LEADER_ENABLE = yes -- cgit v1.2.1 From 1b953ac1e2a0b6f4bb91dea71339d1ccfc25f523 Mon Sep 17 00:00:00 2001 From: ripdog Date: Mon, 3 Jan 2022 16:26:16 +1300 Subject: [Keyboard] Keychron Q1: Turn off RGB during PC suspend (#15685) --- keyboards/keychron/q1/config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/config.h b/keyboards/keychron/q1/config.h index 149280161f..8107dd6251 100644 --- a/keyboards/keychron/q1/config.h +++ b/keyboards/keychron/q1/config.h @@ -46,6 +46,9 @@ /* NKRO */ #define FORCE_NKRO +/* Disable RGB lighting when PC is in suspend */ +#define RGB_DISABLE_WHEN_USB_SUSPENDED + // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -- cgit v1.2.1 From ca0f922e073db9804ab0b55c62a43d81a957dce8 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Sat, 15 Jan 2022 02:58:09 +0800 Subject: [Keyboard] Add Keychron_q1 rev_0101 and Keychron q2 series (#15025) Co-authored-by: Joel Challis Co-authored-by: Drashna Jaelre Co-authored-by: Ryan Co-authored-by: Cesar Rojas Co-authored-by: lokher Co-authored-by: Adam Karim --- keyboards/keychron/q1/config.h | 11 +- keyboards/keychron/q1/q1.h | 5 +- .../keychron/q1/rev_0100/keymaps/default/keymap.c | 95 ++++++++----- .../keychron/q1/rev_0100/keymaps/via/keymap.c | 109 +++++++++----- keyboards/keychron/q1/rev_0101/config.h | 37 +++++ .../keychron/q1/rev_0101/keymaps/default/info.json | 97 +++++++++++++ .../keychron/q1/rev_0101/keymaps/default/keymap.c | 90 ++++++++++++ .../keychron/q1/rev_0101/keymaps/via/info.json | 100 +++++++++++++ .../keychron/q1/rev_0101/keymaps/via/keymap.c | 131 +++++++++++++++++ .../keychron/q1/rev_0101/keymaps/via/rules.mk | 2 + keyboards/keychron/q1/rev_0101/readme.md | 4 + keyboards/keychron/q1/rev_0101/rev_0101.c | 156 +++++++++++++++++++++ keyboards/keychron/q1/rev_0101/rev_0101.h | 52 +++++++ keyboards/keychron/q1/rev_0101/rules.mk | 22 +++ .../keychron/q1/rev_0102/keymaps/default/keymap.c | 87 ++++++++---- .../keychron/q1/rev_0102/keymaps/via/keymap.c | 109 +++++++++----- keyboards/keychron/q1/rev_0102/rev_0102.c | 3 +- keyboards/keychron/q2/chconf.h | 30 ++++ keyboards/keychron/q2/config.h | 54 +++++++ keyboards/keychron/q2/halconf.h | 26 ++++ keyboards/keychron/q2/matrix.c | 139 ++++++++++++++++++ keyboards/keychron/q2/mcuconf.h | 27 ++++ keyboards/keychron/q2/q2.c | 33 +++++ keyboards/keychron/q2/q2.h | 29 ++++ keyboards/keychron/q2/readme.md | 19 +++ keyboards/keychron/q2/rev_0110/config.h | 21 +++ keyboards/keychron/q2/rev_0110/info.json | 82 +++++++++++ .../keychron/q2/rev_0110/keymaps/default/keymap.c | 94 +++++++++++++ .../keychron/q2/rev_0110/keymaps/via/keymap.c | 112 +++++++++++++++ .../keychron/q2/rev_0110/keymaps/via/rules.mk | 2 + keyboards/keychron/q2/rev_0110/readme.md | 1 + keyboards/keychron/q2/rev_0110/rev_0110.c | 17 +++ keyboards/keychron/q2/rev_0110/rev_0110.h | 35 +++++ keyboards/keychron/q2/rev_0110/rules.mk | 34 +++++ keyboards/keychron/q2/rev_0111/config.h | 28 ++++ .../keychron/q2/rev_0111/keymaps/default/info.json | 82 +++++++++++ .../keychron/q2/rev_0111/keymaps/default/keymap.c | 94 +++++++++++++ .../keychron/q2/rev_0111/keymaps/via/info.json | 84 +++++++++++ .../keychron/q2/rev_0111/keymaps/via/keymap.c | 154 ++++++++++++++++++++ .../keychron/q2/rev_0111/keymaps/via/rules.mk | 2 + keyboards/keychron/q2/rev_0111/readme.md | 5 + keyboards/keychron/q2/rev_0111/rev_0111.c | 31 ++++ keyboards/keychron/q2/rev_0111/rev_0111.h | 48 +++++++ keyboards/keychron/q2/rev_0111/rules.mk | 34 +++++ keyboards/keychron/q2/rev_0112/config.h | 21 +++ keyboards/keychron/q2/rev_0112/info.json | 83 +++++++++++ .../keychron/q2/rev_0112/keymaps/default/keymap.c | 94 +++++++++++++ .../keychron/q2/rev_0112/keymaps/via/keymap.c | 112 +++++++++++++++ .../keychron/q2/rev_0112/keymaps/via/rules.mk | 2 + keyboards/keychron/q2/rev_0112/readme.md | 1 + keyboards/keychron/q2/rev_0112/rev_0112.c | 17 +++ keyboards/keychron/q2/rev_0112/rev_0112.h | 36 +++++ keyboards/keychron/q2/rev_0112/rules.mk | 34 +++++ keyboards/keychron/q2/rev_0113/config.h | 28 ++++ .../keychron/q2/rev_0113/keymaps/default/info.json | 83 +++++++++++ .../keychron/q2/rev_0113/keymaps/default/keymap.c | 94 +++++++++++++ .../keychron/q2/rev_0113/keymaps/via/info.json | 85 +++++++++++ .../keychron/q2/rev_0113/keymaps/via/keymap.c | 154 ++++++++++++++++++++ .../keychron/q2/rev_0113/keymaps/via/rules.mk | 2 + keyboards/keychron/q2/rev_0113/readme.md | 5 + keyboards/keychron/q2/rev_0113/rev_0113.c | 31 ++++ keyboards/keychron/q2/rev_0113/rev_0113.h | 48 +++++++ keyboards/keychron/q2/rev_0113/rules.mk | 34 +++++ 63 files changed, 3255 insertions(+), 136 deletions(-) create mode 100644 keyboards/keychron/q1/rev_0101/config.h create mode 100644 keyboards/keychron/q1/rev_0101/keymaps/default/info.json create mode 100644 keyboards/keychron/q1/rev_0101/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q1/rev_0101/keymaps/via/info.json create mode 100644 keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q1/rev_0101/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q1/rev_0101/readme.md create mode 100644 keyboards/keychron/q1/rev_0101/rev_0101.c create mode 100644 keyboards/keychron/q1/rev_0101/rev_0101.h create mode 100644 keyboards/keychron/q1/rev_0101/rules.mk create mode 100644 keyboards/keychron/q2/chconf.h create mode 100644 keyboards/keychron/q2/config.h create mode 100644 keyboards/keychron/q2/halconf.h create mode 100644 keyboards/keychron/q2/matrix.c create mode 100644 keyboards/keychron/q2/mcuconf.h create mode 100644 keyboards/keychron/q2/q2.c create mode 100644 keyboards/keychron/q2/q2.h create mode 100644 keyboards/keychron/q2/readme.md create mode 100644 keyboards/keychron/q2/rev_0110/config.h create mode 100644 keyboards/keychron/q2/rev_0110/info.json create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q2/rev_0110/readme.md create mode 100644 keyboards/keychron/q2/rev_0110/rev_0110.c create mode 100644 keyboards/keychron/q2/rev_0110/rev_0110.h create mode 100644 keyboards/keychron/q2/rev_0110/rules.mk create mode 100644 keyboards/keychron/q2/rev_0111/config.h create mode 100644 keyboards/keychron/q2/rev_0111/keymaps/default/info.json create mode 100644 keyboards/keychron/q2/rev_0111/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q2/rev_0111/keymaps/via/info.json create mode 100644 keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q2/rev_0111/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q2/rev_0111/readme.md create mode 100644 keyboards/keychron/q2/rev_0111/rev_0111.c create mode 100644 keyboards/keychron/q2/rev_0111/rev_0111.h create mode 100644 keyboards/keychron/q2/rev_0111/rules.mk create mode 100644 keyboards/keychron/q2/rev_0112/config.h create mode 100644 keyboards/keychron/q2/rev_0112/info.json create mode 100644 keyboards/keychron/q2/rev_0112/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q2/rev_0112/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q2/rev_0112/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q2/rev_0112/readme.md create mode 100644 keyboards/keychron/q2/rev_0112/rev_0112.c create mode 100644 keyboards/keychron/q2/rev_0112/rev_0112.h create mode 100644 keyboards/keychron/q2/rev_0112/rules.mk create mode 100644 keyboards/keychron/q2/rev_0113/config.h create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/default/info.json create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/via/info.json create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q2/rev_0113/readme.md create mode 100644 keyboards/keychron/q2/rev_0113/rev_0113.c create mode 100644 keyboards/keychron/q2/rev_0113/rev_0113.h create mode 100644 keyboards/keychron/q2/rev_0113/rules.mk (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/config.h b/keyboards/keychron/q1/config.h index 8107dd6251..de69b9e929 100644 --- a/keyboards/keychron/q1/config.h +++ b/keyboards/keychron/q1/config.h @@ -16,7 +16,6 @@ #pragma once - /* USB Device descriptor parameter */ #define VENDOR_ID 0x3434 #define MANUFACTURER Keychron @@ -49,6 +48,11 @@ /* Disable RGB lighting when PC is in suspend */ #define RGB_DISABLE_WHEN_USB_SUSPENDED +/* Allow VIA to edit lighting */ +#ifdef VIA_ENABLE +#define VIA_QMK_RGBLIGHT_ENABLE +#endif + // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects @@ -97,3 +101,8 @@ #define ENABLE_RGB_MATRIX_MULTISPLASH #define ENABLE_RGB_MATRIX_SOLID_SPLASH #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +/* Allow VIA to edit lighting */ +#ifdef VIA_ENABLE +#define VIA_QMK_RGBLIGHT_ENABLE +#endif diff --git a/keyboards/keychron/q1/q1.h b/keyboards/keychron/q1/q1.h index eb9a7d69a7..cf6d196213 100644 --- a/keyboards/keychron/q1/q1.h +++ b/keyboards/keychron/q1/q1.h @@ -18,9 +18,10 @@ #include "quantum.h" - #if defined(KEYBOARD_keychron_q1_rev_0100) # include "rev_0100.h" +#elif defined(KEYBOARD_keychron_q1_rev_0101) +# include "rev_0101.h" #elif defined(KEYBOARD_keychron_q1_rev_0102) # include "rev_0102.h" -#endif \ No newline at end of file +#endif diff --git a/keyboards/keychron/q1/rev_0100/keymaps/default/keymap.c b/keyboards/keychron/q1/rev_0100/keymaps/default/keymap.c index e000dd7dd7..d1f71e9da6 100644 --- a/keyboards/keychron/q1/rev_0100/keymaps/default/keymap.c +++ b/keyboards/keychron/q1/rev_0100/keymaps/default/keymap.c @@ -16,49 +16,74 @@ #include QMK_KEYBOARD_H - enum layers{ - MAC_BASE, - MAC_FN, - WIN_BASE, - WIN_FN + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD }; #define KC_TASK LGUI(KC_TAB) #define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[MAC_BASE] = LAYOUT_ansi_82( - KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [MAC_FN] = LAYOUT_ansi_82( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[MAC_FN] = LAYOUT_ansi_82( - KC_TRNS, 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [WIN_BASE] = LAYOUT_ansi_82( + KC_ESC, 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_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[WIN_BASE] = LAYOUT_ansi_82( - KC_ESC, 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_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[WIN_FN] = LAYOUT_ansi_82( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + [WIN_FN] = LAYOUT_ansi_82( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; -}; \ No newline at end of file +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0100/keymaps/via/keymap.c b/keyboards/keychron/q1/rev_0100/keymaps/via/keymap.c index e000dd7dd7..1e6316782d 100644 --- a/keyboards/keychron/q1/rev_0100/keymaps/via/keymap.c +++ b/keyboards/keychron/q1/rev_0100/keymaps/via/keymap.c @@ -16,7 +16,6 @@ #include QMK_KEYBOARD_H - enum layers{ MAC_BASE, MAC_FN, @@ -24,41 +23,85 @@ enum layers{ WIN_FN }; -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD -[MAC_BASE] = LAYOUT_ansi_82( - KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[MAC_FN] = LAYOUT_ansi_82( - KC_TRNS, 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [MAC_FN] = LAYOUT_ansi_82( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[WIN_BASE] = LAYOUT_ansi_82( - KC_ESC, 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_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [WIN_BASE] = LAYOUT_ansi_82( + KC_ESC, 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_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[WIN_FN] = LAYOUT_ansi_82( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + [WIN_FN] = LAYOUT_ansi_82( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; -}; \ No newline at end of file +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0101/config.h b/keyboards/keychron/q1/rev_0101/config.h new file mode 100644 index 0000000000..c127a3630a --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/config.h @@ -0,0 +1,37 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0x0101 +#define DEVICE_VER 0x0100 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D3, D2, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { D5, D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5, F4, F1, F0 } + +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 59 +#define DRIVER_2_LED_TOTAL 23 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +/* Encoder used pins */ +#define ENCODERS_PAD_A { E6 } +#define ENCODERS_PAD_B { B7 } + +/* Specifies the number of pulses the encoder registers between each detent */ +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/keychron/q1/rev_0101/keymaps/default/info.json b/keyboards/keychron/q1/rev_0101/keymaps/default/info.json new file mode 100644 index 0000000000..56bf48acc1 --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/keymaps/default/info.json @@ -0,0 +1,97 @@ +{ + "keyboard_name": "Keychron Q1", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_82": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Delete", "x":14, "y":0}, + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"~", "x":0, "y":1.25}, + {"label":"!", "x":1, "y":1.25}, + {"label":"@", "x":2, "y":1.25}, + {"label":"#", "x":3, "y":1.25}, + {"label":"$", "x":4, "y":1.25}, + {"label":"%", "x":5, "y":1.25}, + {"label":"^", "x":6, "y":1.25}, + {"label":"&", "x":7, "y":1.25}, + {"label":"*", "x":8, "y":1.25}, + {"label":"(", "x":9, "y":1.25}, + {"label":")", "x":10, "y":1.25}, + {"label":"_", "x":11, "y":1.25}, + {"label":"+", "x":12, "y":1.25}, + {"label":"Backspace", "x":13, "y":1.25, "w":2}, + {"label":"Page Up", "x":15.25, "y":1.25}, + + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"{", "x":11.5, "y":2.25}, + {"label":"}", "x":12.5, "y":2.25}, + {"label":"|", "x":13.5, "y":2.25, "w":1.5}, + {"label":"Page Down", "x":15.25, "y":2.25}, + + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":":", "x":10.75, "y":3.25}, + {"label":"\"", "x":11.75, "y":3.25}, + {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":3.25}, + + {"label":"Shift", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"<", "x":9.25, "y":4.25}, + {"label":">", "x":10.25, "y":4.25}, + {"label":"?", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, + {"label":"Alt", "x":10, "y":5.25}, + {"label":"Fn", "x":11, "y":5.25}, + {"label":"Ctrl", "x":12, "y":5.25}, + {"label":"Left", "x":13.25, "y":5.5}, + {"label":"Down", "x":14.25, "y":5.5}, + {"label":"Right", "x":15.25, "y":5.5} ] + } + } +} \ No newline at end of file diff --git a/keyboards/keychron/q1/rev_0101/keymaps/default/keymap.c b/keyboards/keychron/q1/rev_0101/keymaps/default/keymap.c new file mode 100644 index 0000000000..92806bf9fe --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/keymaps/default/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_82( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_ansi_82( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [WIN_BASE] = LAYOUT_ansi_82( + KC_ESC, 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_MUTE, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_ansi_82( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0101/keymaps/via/info.json b/keyboards/keychron/q1/rev_0101/keymaps/via/info.json new file mode 100644 index 0000000000..a921ee3e4c --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/keymaps/via/info.json @@ -0,0 +1,100 @@ +{ + "keyboard_name": "Keychron Q1", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Delete", "x":14, "y":0}, + + {"label":"Mute", "x":15.25, "y":0, "w":0.75}, + {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, + {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, + + {"label":"~", "x":0, "y":1.25}, + {"label":"!", "x":1, "y":1.25}, + {"label":"@", "x":2, "y":1.25}, + {"label":"#", "x":3, "y":1.25}, + {"label":"$", "x":4, "y":1.25}, + {"label":"%", "x":5, "y":1.25}, + {"label":"^", "x":6, "y":1.25}, + {"label":"&", "x":7, "y":1.25}, + {"label":"*", "x":8, "y":1.25}, + {"label":"(", "x":9, "y":1.25}, + {"label":")", "x":10, "y":1.25}, + {"label":"_", "x":11, "y":1}, + {"label":"+", "x":12, "y":1.25}, + {"label":"Backspace", "x":13, "y":1.25, "w":2}, + {"label":"Page Up", "x":15.25, "y":1.25}, + + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"{", "x":11.5, "y":2.25}, + {"label":"}", "x":12.5, "y":2.25}, + {"label":"|", "x":13.5, "y":2.25, "w":1.5}, + {"label":"Page Down", "x":15.25, "y":2.25}, + + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":":", "x":10.75, "y":3.25}, + {"label":"\"", "x":11.75, "y":3.25}, + {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":3.25}, + + {"label":"Shift", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"<", "x":9.25, "y":4.25}, + {"label":">", "x":10.25, "y":4.25}, + {"label":"?", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, + {"label":"Alt", "x":10, "y":5.25}, + {"label":"Fn", "x":11, "y":5.25}, + {"label":"Ctrl", "x":12, "y":5.25}, + {"label":"Left", "x":13.25, "y":5.5}, + {"label":"Down", "x":14.25, "y":5.5}, + {"label":"Right", "x":15.25, "y":5.5} ] + } + } +} diff --git a/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c b/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c new file mode 100644 index 0000000000..1103f74427 --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c @@ -0,0 +1,131 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD +}; + +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD +#define KC_TASK G(KC_TAB) +#define KC_FLXP G(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_all( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_VOLD, KC_VOLU, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_all( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [WIN_BASE] = LAYOUT_all( + KC_ESC, 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_MUTE, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_all( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) + +#define ENCODERS 1 +static uint8_t encoder_state[ENCODERS] = {0}; +static keypos_t encoder_cw[ENCODERS] = {{ 8, 5 }}; +static keypos_t encoder_ccw[ENCODERS] = {{ 7, 5 }}; + +void encoder_action_unregister(void) { + for (int index = 0; index < ENCODERS; ++index) { + if (encoder_state[index]) { + keyevent_t encoder_event = (keyevent_t) { + .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], + .pressed = false, + .time = (timer_read() | 1) + }; + encoder_state[index] = 0; + action_exec(encoder_event); + } + } +} + +void encoder_action_register(uint8_t index, bool clockwise) { + keyevent_t encoder_event = (keyevent_t) { + .key = clockwise ? encoder_cw[index] : encoder_ccw[index], + .pressed = true, + .time = (timer_read() | 1) + }; + encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); + action_exec(encoder_event); +} + +void matrix_scan_user(void) { + encoder_action_unregister(); +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + encoder_action_register(index, clockwise); + return false; +}; + +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0101/keymaps/via/rules.mk b/keyboards/keychron/q1/rev_0101/keymaps/via/rules.mk new file mode 100644 index 0000000000..bee21da528 --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no \ No newline at end of file diff --git a/keyboards/keychron/q1/rev_0101/readme.md b/keyboards/keychron/q1/rev_0101/readme.md new file mode 100644 index 0000000000..d7693349be --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/readme.md @@ -0,0 +1,4 @@ +# The ANSI variant of the Keychron Q1 +- Enable EC11 rotary encoder +- Turn colckwise to increase volume and turn anti-colckwise to decrease volume +- Press top right key pushbutton to mute \ No newline at end of file diff --git a/keyboards/keychron/q1/rev_0101/rev_0101.c b/keyboards/keychron/q1/rev_0101/rev_0101.c new file mode 100644 index 0000000000..dd7f69529e --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/rev_0101.c @@ -0,0 +1,156 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C_1, A_1, B_1}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_14, A_14, B_14}, + {0, C_15, A_15, B_15}, + {0, C_16, A_16, B_16}, + + {0, F_1, D_1, E_1}, + {0, F_2, D_2, E_2}, + {0, F_3, D_3, E_3}, + {0, F_4, D_4, E_4}, + {0, F_5, D_5, E_5}, + {0, F_6, D_6, E_6}, + {0, F_7, D_7, E_7}, + {0, F_8, D_8, E_8}, + {0, F_9, D_9, E_9}, + {0, F_10, D_10, E_10}, + {0, F_11, D_11, E_11}, + {0, F_12, D_12, E_12}, + {0, F_13, D_13, E_13}, + {0, F_14, D_14, E_14}, + {0, F_16, D_16, E_16}, + + {0, I_1, G_1, H_1}, + {0, I_2, G_2, H_2}, + {0, I_3, G_3, H_3}, + {0, I_4, G_4, H_4}, + {0, I_5, G_5, H_5}, + {0, I_6, G_6, H_6}, + {0, I_7, G_7, H_7}, + {0, I_8, G_8, H_8}, + {0, I_9, G_9, H_9}, + {0, I_10, G_10, H_10}, + {0, I_11, G_11, H_11}, + {0, I_12, G_12, H_12}, + {0, I_13, G_13, H_13}, + {0, I_14, G_14, H_14}, + {0, I_16, G_16, H_16}, + + {0, L_1, J_1, K_1}, + {0, L_2, J_2, K_2}, + {0, L_3, J_3, K_3}, + {0, L_4, J_4, K_4}, + {0, L_5, J_5, K_5}, + {0, L_6, J_6, K_6}, + {0, L_7, J_7, K_7}, + {0, L_8, J_8, K_8}, + {0, L_9, J_9, K_9}, + {0, L_10, J_10, K_10}, + {0, L_11, J_11, K_11}, + {0, L_12, J_12, K_12}, + {0, L_14, J_14, K_14}, + {0, L_16, J_16, K_16}, + + {1, C_1, A_1, B_1}, + {1, C_3, A_3, B_3}, + {1, C_4, A_4, B_4}, + {1, C_5, A_5, B_5}, + {1, C_6, A_6, B_6}, + {1, C_7, A_7, B_7}, + {1, C_8, A_8, B_8}, + {1, C_9, A_9, B_9}, + {1, C_10, A_10, B_10}, + {1, C_11, A_11, B_11}, + {1, C_12, A_12, B_12}, + {1, C_14, A_14, B_14}, + {1, C_15, A_15, B_15}, + + {1, F_1, D_1, E_1}, + {1, F_2, D_2, E_2}, + {1, F_3, D_3, E_3}, + {1, F_7, D_7, E_7}, + {1, F_11, D_11, E_11}, + {1, F_12, D_12, E_12}, + {1, F_13, D_13, E_13}, + {1, F_14, D_14, E_14}, + {1, F_15, D_15, E_15}, + {1, F_16, D_16, E_16} +}; + +led_config_t g_led_config = { + { + { 0, NO_LED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 }, + { 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 71, 57, 58 }, + { 59, NO_LED, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 80, 70, 13 }, + { 72, 73, 74, NO_LED, NO_LED, NO_LED, 75, NO_LED, NO_LED, NO_LED, 76, 77, 78, 79, 81 } + }, + { + {0, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {195, 0}, {210, 0}, {224, 0}, + {0,13}, {15,13}, {30,13}, {45,13}, {60,13}, {75,13}, {90,13}, {105,13}, {120,13}, {135,13}, {150,13}, {165,13}, {180,13}, {195,13}, {224,13}, + {0,26}, {15,26}, {30,26}, {45,26}, {60,26}, {75,26}, {90,26}, {105,26}, {120,26}, {135,26}, {150,26}, {165,26}, {180,26}, {195,26}, {224,26}, + {0,39}, {15,39}, {30,39}, {45,39}, {60,39}, {75,39}, {90,39}, {105,39}, {120,39}, {135,39}, {150,39}, {165,39}, {195,39}, {224,39}, + {0,52}, {30,52}, {45,52}, {60,52}, {75,52}, {90,52}, {105,52}, {120,52}, {135,52}, {150,52}, {165,52}, {195,52}, {210,52}, + {0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64} + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + } +}; +#endif + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + return true; +} +#endif diff --git a/keyboards/keychron/q1/rev_0101/rev_0101.h b/keyboards/keychron/q1/rev_0101/rev_0101.h new file mode 100644 index 0000000000..132003c4f1 --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/rev_0101.h @@ -0,0 +1,52 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 xxx KC_NO + +#define LAYOUT_all( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4E, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K3C, \ + K50, K51, K52, K56, K57, K58, K5A, K5B, K5C, K5D, K4C, K5E \ + ) { \ + { K00, xxx, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, xxx, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { K50, K51, K52, xxx, xxx, xxx, K56, K57, K58, xxx, K5A, K5B, K5C, K5D, K5E } \ + } +#define LAYOUT_ansi_82( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4E, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K3C, \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K4C, K5E \ + ) { \ + { K00, xxx, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, xxx, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { K50, K51, K52, xxx, xxx, xxx, K56, xxx, xxx, xxx, K5A, K5B, K5C, K5D, K5E } \ + } diff --git a/keyboards/keychron/q1/rev_0101/rules.mk b/keyboards/keychron/q1/rev_0101/rules.mk new file mode 100644 index 0000000000..8d2be4eb5d --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key 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 +DIP_SWITCH_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = IS31FL3733 \ No newline at end of file diff --git a/keyboards/keychron/q1/rev_0102/keymaps/default/keymap.c b/keyboards/keychron/q1/rev_0102/keymaps/default/keymap.c index b4a7d64427..3d0a9e5c6f 100644 --- a/keyboards/keychron/q1/rev_0102/keymaps/default/keymap.c +++ b/keyboards/keychron/q1/rev_0102/keymaps/default/keymap.c @@ -16,7 +16,6 @@ #include QMK_KEYBOARD_H - enum layers{ MAC_BASE, MAC_FN, @@ -24,41 +23,67 @@ enum layers{ WIN_FN }; +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + #define KC_TASK LGUI(KC_TAB) #define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_83( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[MAC_BASE] = LAYOUT_iso_83( - KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[MAC_FN] = LAYOUT_iso_83( - KC_TRNS, 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [MAC_FN] = LAYOUT_iso_83( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[WIN_BASE] = LAYOUT_iso_83( - KC_ESC, 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_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [WIN_BASE] = LAYOUT_iso_83( + KC_ESC, 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_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[WIN_FN] = LAYOUT_iso_83( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + [WIN_FN] = LAYOUT_iso_83( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + }; -}; \ No newline at end of file +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0102/keymaps/via/keymap.c b/keyboards/keychron/q1/rev_0102/keymaps/via/keymap.c index b4a7d64427..d1652e65da 100644 --- a/keyboards/keychron/q1/rev_0102/keymaps/via/keymap.c +++ b/keyboards/keychron/q1/rev_0102/keymaps/via/keymap.c @@ -16,7 +16,6 @@ #include QMK_KEYBOARD_H - enum layers{ MAC_BASE, MAC_FN, @@ -24,41 +23,85 @@ enum layers{ WIN_FN }; -#define KC_TASK LGUI(KC_TAB) -#define KC_FLXP LGUI(KC_E) +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD -[MAC_BASE] = LAYOUT_iso_83( - KC_ESC, KC_BRID, KC_BRIU, KC_F3, KC_F4, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_83( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[MAC_FN] = LAYOUT_iso_83( - KC_TRNS, 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [MAC_FN] = LAYOUT_iso_83( + KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[WIN_BASE] = LAYOUT_iso_83( - KC_ESC, 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_INS, - KC_GRV, 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_PGUP, - 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_PGDN, - 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_HOME, - 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + [WIN_BASE] = LAYOUT_iso_83( + KC_ESC, 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_INS, + KC_GRV, 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_PGUP, + 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_PGDN, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[WIN_FN] = LAYOUT_iso_83( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + [WIN_FN] = LAYOUT_iso_83( + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; -}; \ No newline at end of file +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q1/rev_0102/rev_0102.c b/keyboards/keychron/q1/rev_0102/rev_0102.c index e8a2c85ae3..f1468d1094 100644 --- a/keyboards/keychron/q1/rev_0102/rev_0102.c +++ b/keyboards/keychron/q1/rev_0102/rev_0102.c @@ -16,7 +16,7 @@ #include "quantum.h" - +#ifdef RGB_MATRIX_ENABLE const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = { /* Refer to IS31 manual for these locations * driver @@ -141,3 +141,4 @@ led_config_t g_led_config = { } }; +#endif diff --git a/keyboards/keychron/q2/chconf.h b/keyboards/keychron/q2/chconf.h new file mode 100644 index 0000000000..a331fdef37 --- /dev/null +++ b/keyboards/keychron/q2/chconf.h @@ -0,0 +1,30 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/acheron/arctic/chconf.h -r platforms/chibios/common/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_FREQUENCY 10000 + +#define CH_CFG_OPTIMIZE_SPEED FALSE + +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +#include_next \ No newline at end of file diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h new file mode 100644 index 0000000000..263be4684f --- /dev/null +++ b/keyboards/keychron/q2/config.h @@ -0,0 +1,54 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x3434 +#define MANUFACTURER Keychron +#define PRODUCT Keychron Q2 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B4, B3, A15, A14, A13 } +#define MATRIX_COL_PINS { C14, C15, A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, A8, A9, H3 } + +/* DIP switch */ +#define DIP_SWITCH_MATRIX_GRID { {4, 4} } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Disable DIP switch in matrix data */ +#define MATRIX_MASKED + +/* NKRO */ +#define FORCE_NKRO + +/* turn off effects when suspended */ +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* Use 5 dynamic keymap layers */ +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 + +/* EEPROM Driver Configuration */ +#define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100010 diff --git a/keyboards/keychron/q2/halconf.h b/keyboards/keychron/q2/halconf.h new file mode 100644 index 0000000000..a9304b8592 --- /dev/null +++ b/keyboards/keychron/q2/halconf.h @@ -0,0 +1,26 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/nk65/halconf.h -r platforms/chibios/QMK_PROTON_C/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_I2C TRUE + +#include_next \ No newline at end of file diff --git a/keyboards/keychron/q2/matrix.c b/keyboards/keychron/q2/matrix.c new file mode 100644 index 0000000000..1e493d33e2 --- /dev/null +++ b/keyboards/keychron/q2/matrix.c @@ -0,0 +1,139 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include +#include +#include +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#ifdef MATRIX_ROW_PINS +static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +#endif // MATRIX_ROW_PINS +#ifdef MATRIX_COL_PINS +static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif // MATRIX_COL_PINS + +#define ROWS_PER_HAND (MATRIX_ROWS) + +/* matrix state(1:on, 0:off) */ +extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values +extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values + +static inline void setPinOutput_writeLow(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinOutput(pin); + writePinLow(pin); + } +} + +static inline void setPinOutput_writeHigh(pin_t pin) { + ATOMIC_BLOCK_FORCEON { + setPinOutput(pin); + writePinHigh(pin); + } +} + +static inline void setPinInputHigh_atomic(pin_t pin) { + ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } +} + +static inline uint8_t readMatrixPin(pin_t pin) { + if (pin != NO_PIN) { + return readPin(pin); + } else { + return 1; + } +} + +static bool select_col(uint8_t col) { + pin_t pin = col_pins[col]; + if (pin != NO_PIN) { + setPinOutput_writeLow(pin); + return true; + } + return false; +} + +static void unselect_col(uint8_t col) { + pin_t pin = col_pins[col]; + if (pin != NO_PIN) { + setPinOutput_writeHigh(pin); + } +} + +static void unselect_cols(void) { + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + unselect_col(x); + } +} + +void matrix_init_pins(void) { + unselect_cols(); + for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { + if (row_pins[x] != NO_PIN) { + setPinInputHigh_atomic(row_pins[x]); + } + } +} + +void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { + bool key_pressed = false; + + // Select col + if (!select_col(current_col)) { // select col + return; // skip NO_PIN col + } + matrix_output_select_delay(); + + // For each row... + for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { + // Check row pin state + if (readMatrixPin(row_pins[row_index]) == 0) { + // Pin LO, set col bit + current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); + key_pressed = true; + } else { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col); + } + } + + // Unselect col + unselect_col(current_col); + matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH +} + +void matrix_init_custom(void) { + // initialize key pins + matrix_init_pins(); +} + +bool matrix_scan_custom(matrix_row_t current_matrix[]) { + matrix_row_t curr_matrix[MATRIX_ROWS] = {0}; + + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { + matrix_read_rows_on_col(curr_matrix, current_col); + } + + bool changed = memcmp(current_matrix, curr_matrix, sizeof(curr_matrix)) != 0; + if (changed) memcpy(current_matrix, curr_matrix, sizeof(curr_matrix)); + + return (uint8_t)changed; +} diff --git a/keyboards/keychron/q2/mcuconf.h b/keyboards/keychron/q2/mcuconf.h new file mode 100644 index 0000000000..6ab916aea1 --- /dev/null +++ b/keyboards/keychron/q2/mcuconf.h @@ -0,0 +1,27 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/acheron/arctic/mcuconf.h -r platforms/chibios/GENERIC_STM32_F072XB/configs/mcuconf.h` + */ + +#pragma once + +#include_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE \ No newline at end of file diff --git a/keyboards/keychron/q2/q2.c b/keyboards/keychron/q2/q2.c new file mode 100644 index 0000000000..03d1ee7db5 --- /dev/null +++ b/keyboards/keychron/q2/q2.c @@ -0,0 +1,33 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "q2.h" + +const matrix_row_t matrix_mask[] = { + 0b1111111111111111, + 0b1111111111111111, + 0b1111111111111111, + 0b1111111111111111, + 0b1111111111101111, +}; + +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) { return false;} + if (index == 0) { + default_layer_set(1UL << (active ? 1 : 0)); + } + return true; +} diff --git a/keyboards/keychron/q2/q2.h b/keyboards/keychron/q2/q2.h new file mode 100644 index 0000000000..22bd1afe8e --- /dev/null +++ b/keyboards/keychron/q2/q2.h @@ -0,0 +1,29 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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" + +#if defined(KEYBOARD_keychron_q2_rev_0110) +# include "rev_0110.h" +#elif defined(KEYBOARD_keychron_q2_rev_0111) +# include "rev_0111.h" +#elif defined(KEYBOARD_keychron_q2_rev_0112) +# include "rev_0112.h" +#elif defined(KEYBOARD_keychron_q2_rev_0113) +# include "rev_0113.h" +#endif diff --git a/keyboards/keychron/q2/readme.md b/keyboards/keychron/q2/readme.md new file mode 100644 index 0000000000..bdceb98d48 --- /dev/null +++ b/keyboards/keychron/q2/readme.md @@ -0,0 +1,19 @@ +# Keychron Q2 + +A customizable 65% keyboard. + +* Keyboard Maintainer: [Keychron](https://github.com/keychron) +* Hardware Supported: Keychron Q2 +* Hardware Availability: [Keychron](https://www.keychron.com) + +Make example for this keyboard (after setting up your build environment): + + make keychron/q2/rev_0110:default + +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) + + make keychron/q2/rev_0110:default:flash + +**Reset Key**: Hold down the key located at *K00*, commonly programmed as *Esc* while plugging in the keyboard. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/keychron/q2/rev_0110/config.h b/keyboards/keychron/q2/rev_0110/config.h new file mode 100644 index 0000000000..d9fc5c1744 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/config.h @@ -0,0 +1,21 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0x0110 +#define DEVICE_VER 0x0100 diff --git a/keyboards/keychron/q2/rev_0110/info.json b/keyboards/keychron/q2/rev_0110/info.json new file mode 100644 index 0000000000..caf3ebf7c9 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_67": { + "layout": [ + {"label":"Insert", "x":15.25, "y":0}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"|", "x":13.5, "y":1.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0110/keymaps/default/keymap.c b/keyboards/keychron/q2/rev_0110/keymaps/default/keymap.c new file mode 100644 index 0000000000..429157eef2 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/default/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_WAVE S(KC_GRV) +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_ansi_67( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0110/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0110/keymaps/via/keymap.c new file mode 100644 index 0000000000..b23c92e95e --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/via/keymap.c @@ -0,0 +1,112 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; + +#define KC_WAVE S(KC_GRV) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_ansi_67( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0110/keymaps/via/rules.mk b/keyboards/keychron/q2/rev_0110/keymaps/via/rules.mk new file mode 100644 index 0000000000..bee21da528 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0110/readme.md b/keyboards/keychron/q2/rev_0110/readme.md new file mode 100644 index 0000000000..d3134cedb5 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/readme.md @@ -0,0 +1 @@ +# The ANSI variant of the Keychron Q2 diff --git a/keyboards/keychron/q2/rev_0110/rev_0110.c b/keyboards/keychron/q2/rev_0110/rev_0110.c new file mode 100644 index 0000000000..d91a41fca1 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/rev_0110.c @@ -0,0 +1,17 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "quantum.h" diff --git a/keyboards/keychron/q2/rev_0110/rev_0110.h b/keyboards/keychron/q2/rev_0110/rev_0110.h new file mode 100644 index 0000000000..669a79d310 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/rev_0110.h @@ -0,0 +1,35 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 XXX KC_NO + +#define LAYOUT_ansi_67( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E,\ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} diff --git a/keyboards/keychron/q2/rev_0110/rules.mk b/keyboards/keychron/q2/rev_0110/rules.mk new file mode 100644 index 0000000000..0d4e745010 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/rules.mk @@ -0,0 +1,34 @@ +# MCU name +# MCU = STM32L432 +MCU = cortex-m4 +ARMV = 7 +MCU_FAMILY = STM32 +MCU_SERIES = STM32L4xx +MCU_LDSCRIPT = STM32L432xB +MCU_STARTUP = stm32l4xx +BOARD = GENERIC_STM32_L433XC +PLATFORM_NAME = platform_l432 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = no # Enable Encoder +DIP_SWITCH_ENABLE = yes +EEPROM_DRIVER = i2c + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# custom matrix setup +CUSTOM_MATRIX = lite + +SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0111/config.h b/keyboards/keychron/q2/rev_0111/config.h new file mode 100644 index 0000000000..cc50d0688a --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/config.h @@ -0,0 +1,28 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0x0111 +#define DEVICE_VER 0x0100 + +/* Encoder used pins */ +#define ENCODERS_PAD_A { A10 } +#define ENCODERS_PAD_B { B5 } + +/* Specifies the number of pulses the encoder registers between each detent */ +#define ENCODER_RESOLUTION 2 diff --git a/keyboards/keychron/q2/rev_0111/keymaps/default/info.json b/keyboards/keychron/q2/rev_0111/keymaps/default/info.json new file mode 100644 index 0000000000..590ed6d115 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/keymaps/default/info.json @@ -0,0 +1,82 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_": { + "layout": [ + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"|", "x":13.5, "y":1.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/default/keymap.c b/keyboards/keychron/q2/rev_0111/keymaps/default/keymap.c new file mode 100644 index 0000000000..f5a0667601 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/keymaps/default/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_WAVE S(KC_GRV) +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_ansi_67( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/via/info.json b/keyboards/keychron/q2/rev_0111/keymaps/via/info.json new file mode 100644 index 0000000000..0e2ad8463f --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/keymaps/via/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_": { + "layout": [ + {"label":"Mute", "x":15.25, "y":0, "w":0.75}, + {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, + {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"|", "x":13.5, "y":1.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c new file mode 100644 index 0000000000..15cdbb027e --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; + +#define KC_WAVE S(KC_GRV) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_all( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_VOLD, KC_VOLU, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_all( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_all( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_all( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_all( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) + +#define ENCODERS 1 +static uint8_t encoder_state[ENCODERS] = {0}; +static keypos_t encoder_cw[ENCODERS] = {{ 8, 4 }}; +static keypos_t encoder_ccw[ENCODERS] = {{ 7, 4 }}; + +void encoder_action_register(uint8_t index, bool clockwise) { + keyevent_t encoder_event = (keyevent_t) { + .key = clockwise ? encoder_cw[index] : encoder_ccw[index], + .pressed = true, + .time = (timer_read() | 1) + }; + encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); + action_exec(encoder_event); +} + +void encoder_action_unregister(void) { + for (int index = 0; index < ENCODERS; ++index) { + if (encoder_state[index]) { + keyevent_t encoder_event = (keyevent_t) { + .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], + .pressed = false, + .time = (timer_read() | 1) + }; + encoder_state[index] = 0; + action_exec(encoder_event); + } + } +} + +void matrix_scan_user(void) { + encoder_action_unregister(); +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + encoder_action_register(index, clockwise); + return false; +}; + +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/via/rules.mk b/keyboards/keychron/q2/rev_0111/keymaps/via/rules.mk new file mode 100644 index 0000000000..bee21da528 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0111/readme.md b/keyboards/keychron/q2/rev_0111/readme.md new file mode 100644 index 0000000000..2bb5d3bca8 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/readme.md @@ -0,0 +1,5 @@ +# The ANSI variant of the Keychron Q2 and support encoder + +- Enable EC11 rotary encoder +- Turn colckwise to increase volume and turn anti-colckwise to decrease volume +- Press top right key pushbutton to mute diff --git a/keyboards/keychron/q2/rev_0111/rev_0111.c b/keyboards/keychron/q2/rev_0111/rev_0111.c new file mode 100644 index 0000000000..c9413d023d --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/rev_0111.c @@ -0,0 +1,31 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "quantum.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } + return true; +} +#endif diff --git a/keyboards/keychron/q2/rev_0111/rev_0111.h b/keyboards/keychron/q2/rev_0111/rev_0111.h new file mode 100644 index 0000000000..0b1cfade1b --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/rev_0111.h @@ -0,0 +1,48 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 XXX KC_NO + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E,\ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K47, K48, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, K47, K48, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} +#define LAYOUT_ansi_67( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E,\ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} diff --git a/keyboards/keychron/q2/rev_0111/rules.mk b/keyboards/keychron/q2/rev_0111/rules.mk new file mode 100644 index 0000000000..52d0bce592 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/rules.mk @@ -0,0 +1,34 @@ +# MCU name +# MCU = STM32L432 +MCU = cortex-m4 +ARMV = 7 +MCU_FAMILY = STM32 +MCU_SERIES = STM32L4xx +MCU_LDSCRIPT = STM32L432xB +MCU_STARTUP = stm32l4xx +BOARD = GENERIC_STM32_L433XC +PLATFORM_NAME = platform_l432 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key 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 +DIP_SWITCH_ENABLE = yes +EEPROM_DRIVER = i2c + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# custom matrix setup +CUSTOM_MATRIX = lite + +SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0112/config.h b/keyboards/keychron/q2/rev_0112/config.h new file mode 100644 index 0000000000..b76640d650 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/config.h @@ -0,0 +1,21 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0x0112 +#define DEVICE_VER 0x0100 diff --git a/keyboards/keychron/q2/rev_0112/info.json b/keyboards/keychron/q2/rev_0112/info.json new file mode 100644 index 0000000000..83a7addfeb --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/info.json @@ -0,0 +1,83 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_iso_68": { + "layout": [ + {"label":"Insert", "x":15.25, "y":0}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"#~", "x":12.75, "y":2.25}, + {"label":"Enter", "x":13.75, "y":2.25, "w":1.25} + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":1.25}, + {"label":"|", "x":1.25, "y":3.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0112/keymaps/default/keymap.c b/keyboards/keychron/q2/rev_0112/keymaps/default/keymap.c new file mode 100644 index 0000000000..75667b44c8 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/keymaps/default/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_WAVE S(KC_GRV) +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_68( + KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_iso_68( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_iso_68( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0112/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0112/keymaps/via/keymap.c new file mode 100644 index 0000000000..0a91857f1e --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/keymaps/via/keymap.c @@ -0,0 +1,112 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; + +#define KC_WAVE S(KC_GRV) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_68( + KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_iso_68( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_iso_68( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0112/keymaps/via/rules.mk b/keyboards/keychron/q2/rev_0112/keymaps/via/rules.mk new file mode 100644 index 0000000000..bee21da528 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0112/readme.md b/keyboards/keychron/q2/rev_0112/readme.md new file mode 100644 index 0000000000..29404e03ca --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/readme.md @@ -0,0 +1 @@ +# The ISO variant of the Keychron Q2 diff --git a/keyboards/keychron/q2/rev_0112/rev_0112.c b/keyboards/keychron/q2/rev_0112/rev_0112.c new file mode 100644 index 0000000000..d91a41fca1 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/rev_0112.c @@ -0,0 +1,17 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "quantum.h" diff --git a/keyboards/keychron/q2/rev_0112/rev_0112.h b/keyboards/keychron/q2/rev_0112/rev_0112.h new file mode 100644 index 0000000000..2ab66fb847 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/rev_0112.h @@ -0,0 +1,36 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 XXX KC_NO + +#define LAYOUT_iso_68( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K1D, K2E,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} + diff --git a/keyboards/keychron/q2/rev_0112/rules.mk b/keyboards/keychron/q2/rev_0112/rules.mk new file mode 100644 index 0000000000..0d4e745010 --- /dev/null +++ b/keyboards/keychron/q2/rev_0112/rules.mk @@ -0,0 +1,34 @@ +# MCU name +# MCU = STM32L432 +MCU = cortex-m4 +ARMV = 7 +MCU_FAMILY = STM32 +MCU_SERIES = STM32L4xx +MCU_LDSCRIPT = STM32L432xB +MCU_STARTUP = stm32l4xx +BOARD = GENERIC_STM32_L433XC +PLATFORM_NAME = platform_l432 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = no # Enable Encoder +DIP_SWITCH_ENABLE = yes +EEPROM_DRIVER = i2c + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# custom matrix setup +CUSTOM_MATRIX = lite + +SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0113/config.h b/keyboards/keychron/q2/rev_0113/config.h new file mode 100644 index 0000000000..21ada693c0 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/config.h @@ -0,0 +1,28 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0x0113 +#define DEVICE_VER 0x0100 + +/* Encoder used pins */ +#define ENCODERS_PAD_A { A10 } +#define ENCODERS_PAD_B { B5 } + +/* Specifies the number of pulses the encoder registers between each detent */ +#define ENCODER_RESOLUTION 2 diff --git a/keyboards/keychron/q2/rev_0113/keymaps/default/info.json b/keyboards/keychron/q2/rev_0113/keymaps/default/info.json new file mode 100644 index 0000000000..8448d4c995 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/default/info.json @@ -0,0 +1,83 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_iso_68": { + "layout": [ + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"#~", "x":12.75, "y":2.25}, + {"label":"Enter", "x":13.75, "y":2.25, "w":1.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":1.25}, + {"label":"|", "x":1.25, "y":3.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/default/keymap.c b/keyboards/keychron/q2/rev_0113/keymaps/default/keymap.c new file mode 100644 index 0000000000..e3e6cf7376 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/default/keymap.c @@ -0,0 +1,94 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_WAVE S(KC_GRV) +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_68( + KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_iso_68( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_iso_68( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_iso_68( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/via/info.json b/keyboards/keychron/q2/rev_0113/keymaps/via/info.json new file mode 100644 index 0000000000..6111f83d23 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/via/info.json @@ -0,0 +1,85 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_iso_68": { + "layout": [ + {"label":"Mute", "x":15.25, "y":0, "w":0.75}, + {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, + {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, + + {"label":"Esc", "x":0, "y":0.25}, + {"label":"!", "x":1, "y":0.25}, + {"label":"@", "x":2, "y":0.25}, + {"label":"", "x":3, "y":0.25}, + {"label":"$", "x":4, "y":0.25}, + {"label":"%", "x":5, "y":0.25}, + {"label":"^", "x":6, "y":0.25}, + {"label":"&", "x":7, "y":0.25}, + {"label":"*", "x":8, "y":0.25}, + {"label":"(", "x":9, "y":0.25}, + {"label":")", "x":10, "y":0.25}, + {"label":"_", "x":11, "y":0.25}, + {"label":"+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"{", "x":11.5, "y":1.25}, + {"label":"}", "x":12.5, "y":1.25}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":":", "x":10.75, "y":2.25}, + {"label":"\"", "x":11.75, "y":2.25}, + {"label":"#~", "x":12.75, "y":2.25}, + {"label":"Enter", "x":13.75, "y":2.25, "w":1.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":1.25}, + {"label":"|", "x":1.25, "y":3.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":"<", "x":9.25, "y":3.25}, + {"label":">", "x":10.25, "y":3.25}, + {"label":"?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c new file mode 100644 index 0000000000..9c7ad72be7 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c @@ -0,0 +1,154 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3 +}; + +enum custom_keycodes { + KC_MISSION_CONTROL = USER00, + KC_LAUNCHPAD, + KC_TASK, + KC_FLXP +}; + +#define KC_WAVE S(KC_GRV) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_VOLD, KC_VOLU, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_all( + KC_ESC, 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_MUTE, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_all( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_all( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_all( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +#if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) + +#define ENCODERS 1 +static uint8_t encoder_state[ENCODERS] = {0}; +static keypos_t encoder_cw[ENCODERS] = {{ 8, 4 }}; +static keypos_t encoder_ccw[ENCODERS] = {{ 7, 4 }}; + +void encoder_action_register(uint8_t index, bool clockwise) { + keyevent_t encoder_event = (keyevent_t) { + .key = clockwise ? encoder_cw[index] : encoder_ccw[index], + .pressed = true, + .time = (timer_read() | 1) + }; + encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); + action_exec(encoder_event); +} + +void encoder_action_unregister(void) { + for (int index = 0; index < ENCODERS; ++index) { + if (encoder_state[index]) { + keyevent_t encoder_event = (keyevent_t) { + .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], + .pressed = false, + .time = (timer_read() | 1) + }; + encoder_state[index] = 0; + action_exec(encoder_event); + } + } +} + +void matrix_scan_user(void) { + encoder_action_unregister(); +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + encoder_action_register(index, clockwise); + return false; +}; + +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_TASK: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_TAB); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_TAB); + } + return false; // Skip all further processing of this key + case KC_FLXP: + if (record->event.pressed) { + register_code(KC_LWIN); + register_code(KC_E); + } else { + unregister_code(KC_LWIN); + unregister_code(KC_E); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/via/rules.mk b/keyboards/keychron/q2/rev_0113/keymaps/via/rules.mk new file mode 100644 index 0000000000..bee21da528 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +MOUSEKEY_ENABLE = no \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0113/readme.md b/keyboards/keychron/q2/rev_0113/readme.md new file mode 100644 index 0000000000..1d808cbb73 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/readme.md @@ -0,0 +1,5 @@ +# The ISO variant of the Keychron Q2 and support encoder + +- Enable EC11 rotary encoder +- Turn colckwise to increase volume and turn anti-colckwise to decrease volume +- Press top right key pushbutton to mute diff --git a/keyboards/keychron/q2/rev_0113/rev_0113.c b/keyboards/keychron/q2/rev_0113/rev_0113.c new file mode 100644 index 0000000000..c9413d023d --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/rev_0113.c @@ -0,0 +1,31 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 . + */ + +#include "quantum.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } + return true; +} +#endif diff --git a/keyboards/keychron/q2/rev_0113/rev_0113.h b/keyboards/keychron/q2/rev_0113/rev_0113.h new file mode 100644 index 0000000000..21d20463e9 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/rev_0113.h @@ -0,0 +1,48 @@ +/* Copyright 2021 @ Keychron (https://www.keychron.com) + * + * 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 XXX KC_NO + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K1D, K2E,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K47, K48, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, K47, K48, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} +#define LAYOUT_iso_68( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E,\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K1D, K2E,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, } \ +} diff --git a/keyboards/keychron/q2/rev_0113/rules.mk b/keyboards/keychron/q2/rev_0113/rules.mk new file mode 100644 index 0000000000..52d0bce592 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/rules.mk @@ -0,0 +1,34 @@ +# MCU name +# MCU = STM32L432 +MCU = cortex-m4 +ARMV = 7 +MCU_FAMILY = STM32 +MCU_SERIES = STM32L4xx +MCU_LDSCRIPT = STM32L432xB +MCU_STARTUP = stm32l4xx +BOARD = GENERIC_STM32_L433XC +PLATFORM_NAME = platform_l432 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Enable N-Key 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 +DIP_SWITCH_ENABLE = yes +EEPROM_DRIVER = i2c + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE + +# custom matrix setup +CUSTOM_MATRIX = lite + +SRC += matrix.c -- cgit v1.2.1 From 57d116796a4eaa1415bc8c6776ece59366001cfb Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Sat, 22 Jan 2022 18:25:51 +0800 Subject: Add rgb matrix support for q2 of keychron. (#15946) * Add new keyboard keychron_q1_rev_0101 for Keychron. * Update keymaps of keychron_q1_rev_0100 and keychron_q1_rev_0102. * Update keyboards/keychron/q1/rev_0101/rev_0101.h Co-authored-by: Joel Challis * Update keymap.c * Add new info.json. * Update info.json * Update keyboards/keychron/q1/rev_0101/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre * Update keyboards/keychron/q1/rev_0101/rev_0101.c Co-authored-by: Drashna Jaelre * Update keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c Co-authored-by: Drashna Jaelre * Update keyboards/keychron/q1/rev_0101/rev_0101.c Co-authored-by: Drashna Jaelre * Update keymap.c * Update info.json * Update all via keymaps keymaps of q1 series. KC_TASK and KC_FLXP are now defined using the VIA user keycodes range so they can be renamed "TASK" and "TILE" as a shortName in VIA. * Add keyboards keychron_q2 series. * Update default keymaps of keychron_q2 series. * Update rules.mk and MCU_LDSCRIPT specified as STM32L432xB. * Update keyboards/keychron/q1/rev_0101/rev_0101.c Co-authored-by: Drashna Jaelre * Update config.h * Update config.h * Update config.h * removed duplicated ifdef * Update keyboards/keychron/q1/rev_0101/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0110/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0110/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0113/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0111/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0111/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0112/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0112/rules.mk Co-authored-by: Ryan * Update keyboards/keychron/q2/rev_0113/rules.mk Co-authored-by: Ryan * Update rev_0101.c * Update rev_0101. * Enable support for edit RGB lighting in VIA. The updated design file at https://git.io/JyE0K includes only the enabled RGB_MATRIX modes. * Update q1. * Add rgb matrix support for q2 of keychron. * Update rule.mk. * Delete comment block which is unwanted. Co-authored-by: Joel Challis Co-authored-by: Drashna Jaelre Co-authored-by: Cesar Rojas Co-authored-by: lokher Co-authored-by: Ryan Co-authored-by: Adam Karim --- keyboards/keychron/q2/chconf.h | 7 +- keyboards/keychron/q2/config.h | 65 ++++++++++++++++++ keyboards/keychron/q2/halconf.h | 7 +- keyboards/keychron/q2/mcuconf.h | 7 +- keyboards/keychron/q2/rev_0110/config.h | 5 ++ keyboards/keychron/q2/rev_0110/rev_0110.c | 106 +++++++++++++++++++++++++++++ keyboards/keychron/q2/rev_0110/rules.mk | 17 +---- keyboards/keychron/q2/rev_0111/config.h | 7 +- keyboards/keychron/q2/rev_0111/rev_0111.c | 106 +++++++++++++++++++++++++++++ keyboards/keychron/q2/rev_0111/rules.mk | 17 +---- keyboards/keychron/q2/rev_0112/config.h | 5 ++ keyboards/keychron/q2/rev_0112/rev_0112.c | 107 ++++++++++++++++++++++++++++++ keyboards/keychron/q2/rev_0112/rules.mk | 17 +---- keyboards/keychron/q2/rev_0113/config.h | 5 ++ keyboards/keychron/q2/rev_0113/rev_0113.c | 107 ++++++++++++++++++++++++++++++ keyboards/keychron/q2/rev_0113/rules.mk | 17 +---- 16 files changed, 527 insertions(+), 75 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q2/chconf.h b/keyboards/keychron/q2/chconf.h index a331fdef37..cbbae31079 100644 --- a/keyboards/keychron/q2/chconf.h +++ b/keyboards/keychron/q2/chconf.h @@ -14,11 +14,6 @@ * along with this program. If not, see . */ -/* - * This file was auto-generated by: - * `qmk chibios-confmigrate -i keyboards/acheron/arctic/chconf.h -r platforms/chibios/common/configs/chconf.h` - */ - #pragma once #define CH_CFG_ST_FREQUENCY 10000 @@ -27,4 +22,4 @@ #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE -#include_next \ No newline at end of file +#include_next diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h index 263be4684f..8252b83df8 100644 --- a/keyboards/keychron/q2/config.h +++ b/keyboards/keychron/q2/config.h @@ -38,6 +38,14 @@ /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 +/* RGB Matrix Driver Configuration */ +#define DRIVER_COUNT 2 +#define DRIVER_ADDR_1 0b1110111 +#define DRIVER_ADDR_2 0b1110100 + +/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in CKLED2001.h) */ +#define PHASE_CHANNEL MSKPHASE_9CHANNEL + /* Disable DIP switch in matrix data */ #define MATRIX_MASKED @@ -50,5 +58,62 @@ /* Use 5 dynamic keymap layers */ #define DYNAMIC_KEYMAP_LAYER_COUNT 5 +/* We have 2KB EEPROM size on STM32L432 */ +#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 2047 + /* EEPROM Driver Configuration */ #define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100010 + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +// #define ENABLE_RGB_MATRIX_ALPHAS_MODS +// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +// #define ENABLE_RGB_MATRIX_BAND_SAT +// #define ENABLE_RGB_MATRIX_BAND_VAL +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +// #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// #define ENABLE_RGB_MATRIX_HUE_BREATHING +// #define ENABLE_RGB_MATRIX_HUE_PENDULUM +// #define ENABLE_RGB_MATRIX_HUE_WAVE +// #define ENABLE_RGB_MATRIX_PIXEL_RAIN +// #define ENABLE_RGB_MATRIX_PIXEL_FLOW +// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +/* Allow VIA to edit lighting */ +#ifdef VIA_ENABLE +# define VIA_QMK_RGBLIGHT_ENABLE +#endif diff --git a/keyboards/keychron/q2/halconf.h b/keyboards/keychron/q2/halconf.h index a9304b8592..41bddcb279 100644 --- a/keyboards/keychron/q2/halconf.h +++ b/keyboards/keychron/q2/halconf.h @@ -14,13 +14,8 @@ * along with this program. If not, see . */ -/* - * This file was auto-generated by: - * `qmk chibios-confmigrate -i keyboards/nk65/halconf.h -r platforms/chibios/QMK_PROTON_C/configs/halconf.h` - */ - #pragma once #define HAL_USE_I2C TRUE -#include_next \ No newline at end of file +#include_next diff --git a/keyboards/keychron/q2/mcuconf.h b/keyboards/keychron/q2/mcuconf.h index 6ab916aea1..0ca8c64850 100644 --- a/keyboards/keychron/q2/mcuconf.h +++ b/keyboards/keychron/q2/mcuconf.h @@ -14,14 +14,9 @@ * along with this program. If not, see . */ -/* - * This file was auto-generated by: - * `qmk chibios-confmigrate -i keyboards/acheron/arctic/mcuconf.h -r platforms/chibios/GENERIC_STM32_F072XB/configs/mcuconf.h` - */ - #pragma once #include_next #undef STM32_I2C_USE_I2C1 -#define STM32_I2C_USE_I2C1 TRUE \ No newline at end of file +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/keychron/q2/rev_0110/config.h b/keyboards/keychron/q2/rev_0110/config.h index d9fc5c1744..e41857d9b2 100644 --- a/keyboards/keychron/q2/rev_0110/config.h +++ b/keyboards/keychron/q2/rev_0110/config.h @@ -19,3 +19,8 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x0110 #define DEVICE_VER 0x0100 + +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 34 +#define DRIVER_2_LED_TOTAL 33 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/keychron/q2/rev_0110/rev_0110.c b/keyboards/keychron/q2/rev_0110/rev_0110.c index d91a41fca1..fe52490177 100644 --- a/keyboards/keychron/q2/rev_0110/rev_0110.c +++ b/keyboards/keychron/q2/rev_0110/rev_0110.c @@ -15,3 +15,109 @@ */ #include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +/* Refer to CKLED manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_14, A_14, B_14}, + {0, C_16, A_16, B_16}, + + {0, F_1, D_1, E_1}, + {0, F_2, D_2, E_2}, + {0, F_3, D_3, E_3}, + {0, F_4, D_4, E_4}, + {0, F_5, D_5, E_5}, + {0, F_6, D_6, E_6}, + {0, F_7, D_7, E_7}, + {0, F_8, D_8, E_8}, + {0, F_9, D_9, E_9}, + {0, F_10, D_10, E_10}, + {0, F_11, D_11, E_11}, + {0, F_12, D_12, E_12}, + {0, F_13, D_13, E_13}, + {0, F_14, D_14, E_14}, + {0, F_16, D_16, E_16}, + + {0, I_1, G_1, H_1}, + {0, I_2, G_2, H_2}, + {0, I_3, G_3, H_3}, + {0, I_4, G_4, H_4}, + {1, I_5, G_5, H_5}, + {1, I_6, G_6, H_6}, + {1, I_7, G_7, H_7}, + {1, I_8, G_8, H_8}, + {1, I_9, G_9, H_9}, + {1, I_10, G_10, H_10}, + {1, I_11, G_11, H_11}, + {1, I_12, G_12, H_12}, + {1, I_14, G_14, H_14}, + {1, I_16, G_16, H_16}, + + {1, C_1, A_1, B_1}, + {1, C_3, A_3, B_3}, + {1, C_4, A_4, B_4}, + {1, C_5, A_5, B_5}, + {1, C_6, A_6, B_6}, + {1, C_7, A_7, B_7}, + {1, C_8, A_8, B_8}, + {1, C_9, A_9, B_9}, + {1, C_10, A_10, B_10}, + {1, C_11, A_11, B_11}, + {1, C_12, A_12, B_12}, + {1, C_14, A_14, B_14}, + {1, C_15, A_15, B_15}, + + {1, F_1, D_1, E_1}, + {1, F_2, D_2, E_2}, + {1, F_3, D_3, E_3}, + {1, F_7, D_7, E_7}, + {1, F_11, D_11, E_11}, + {1, F_12, D_12, E_12}, + {1, F_13, D_13, E_13}, + {1, F_14, D_14, E_14}, + {1, F_15, D_15, E_15}, + {1, F_16, D_16, E_16}, +}; + +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 65, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56 }, + { 57, 58, 59, NO_LED, NO_LED, NO_LED, 60, NO_LED, NO_LED, NO_LED, 61, 62, 63, 64, 66 }, + }, + { + {0, 0}, {15, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {195, 0}, {224, 0}, + {0,16}, {15,16}, {30,16}, {45,16}, {60,16}, {75,16}, {90,16}, {105,16}, {120,16}, {135,16}, {150,16}, {165,16}, {180,16}, {195,16}, {224,16}, + {0,32}, {15,32}, {30,32}, {45,32}, {60,32}, {75,32}, {90,32}, {105,32}, {120,32}, {135,32}, {150,32}, {165,32}, {195,32}, {224,32}, + {0,48}, {30,48}, {45,48}, {60,48}, {75,48}, {90,48}, {105,48}, {120,48}, {135,48}, {150,48}, {165,48}, {180,48}, {210,48}, + {0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64}, + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + } +}; +#endif diff --git a/keyboards/keychron/q2/rev_0110/rules.mk b/keyboards/keychron/q2/rev_0110/rules.mk index 0d4e745010..957680ab11 100644 --- a/keyboards/keychron/q2/rev_0110/rules.mk +++ b/keyboards/keychron/q2/rev_0110/rules.mk @@ -1,13 +1,5 @@ # MCU name -# MCU = STM32L432 -MCU = cortex-m4 -ARMV = 7 -MCU_FAMILY = STM32 -MCU_SERIES = STM32L4xx -MCU_LDSCRIPT = STM32L432xB -MCU_STARTUP = stm32l4xx -BOARD = GENERIC_STM32_L433XC -PLATFORM_NAME = platform_l432 +MCU = STM32L433 # Build Options # change yes to no to disable @@ -23,12 +15,9 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = no # Enable Encoder DIP_SWITCH_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = CKLED2001 EEPROM_DRIVER = i2c # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE - -# custom matrix setup -CUSTOM_MATRIX = lite - -SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0111/config.h b/keyboards/keychron/q2/rev_0111/config.h index cc50d0688a..76cd5d0e78 100644 --- a/keyboards/keychron/q2/rev_0111/config.h +++ b/keyboards/keychron/q2/rev_0111/config.h @@ -20,9 +20,14 @@ #define PRODUCT_ID 0x0111 #define DEVICE_VER 0x0100 +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 34 +#define DRIVER_2_LED_TOTAL 33 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + /* Encoder used pins */ #define ENCODERS_PAD_A { A10 } #define ENCODERS_PAD_B { B5 } /* Specifies the number of pulses the encoder registers between each detent */ -#define ENCODER_RESOLUTION 2 +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/keychron/q2/rev_0111/rev_0111.c b/keyboards/keychron/q2/rev_0111/rev_0111.c index c9413d023d..cbadafc458 100644 --- a/keyboards/keychron/q2/rev_0111/rev_0111.c +++ b/keyboards/keychron/q2/rev_0111/rev_0111.c @@ -16,6 +16,112 @@ #include "quantum.h" +#ifdef RGB_MATRIX_ENABLE +const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +/* Refer to CKLED manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_14, A_14, B_14}, + {0, C_16, A_16, B_16}, + + {0, F_1, D_1, E_1}, + {0, F_2, D_2, E_2}, + {0, F_3, D_3, E_3}, + {0, F_4, D_4, E_4}, + {0, F_5, D_5, E_5}, + {0, F_6, D_6, E_6}, + {0, F_7, D_7, E_7}, + {0, F_8, D_8, E_8}, + {0, F_9, D_9, E_9}, + {0, F_10, D_10, E_10}, + {0, F_11, D_11, E_11}, + {0, F_12, D_12, E_12}, + {0, F_13, D_13, E_13}, + {0, F_14, D_14, E_14}, + {0, F_16, D_16, E_16}, + + {0, I_1, G_1, H_1}, + {0, I_2, G_2, H_2}, + {0, I_3, G_3, H_3}, + {0, I_4, G_4, H_4}, + {1, I_5, G_5, H_5}, + {1, I_6, G_6, H_6}, + {1, I_7, G_7, H_7}, + {1, I_8, G_8, H_8}, + {1, I_9, G_9, H_9}, + {1, I_10, G_10, H_10}, + {1, I_11, G_11, H_11}, + {1, I_12, G_12, H_12}, + {1, I_14, G_14, H_14}, + {1, I_16, G_16, H_16}, + + {1, C_1, A_1, B_1}, + {1, C_3, A_3, B_3}, + {1, C_4, A_4, B_4}, + {1, C_5, A_5, B_5}, + {1, C_6, A_6, B_6}, + {1, C_7, A_7, B_7}, + {1, C_8, A_8, B_8}, + {1, C_9, A_9, B_9}, + {1, C_10, A_10, B_10}, + {1, C_11, A_11, B_11}, + {1, C_12, A_12, B_12}, + {1, C_14, A_14, B_14}, + {1, C_15, A_15, B_15}, + + {1, F_1, D_1, E_1}, + {1, F_2, D_2, E_2}, + {1, F_3, D_3, E_3}, + {1, F_7, D_7, E_7}, + {1, F_11, D_11, E_11}, + {1, F_12, D_12, E_12}, + {1, F_13, D_13, E_13}, + {1, F_14, D_14, E_14}, + {1, F_15, D_15, E_15}, + {1, F_16, D_16, E_16}, +}; + +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 65, 42, 43 }, + { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED, 55, 56 }, + { 57, 58, 59, NO_LED, NO_LED, NO_LED, 60, NO_LED, NO_LED, NO_LED, 61, 62, 63, 64, 66 }, + }, + { + {0, 0}, {15, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {195, 0}, {224, 0}, + {0,16}, {15,16}, {30,16}, {45,16}, {60,16}, {75,16}, {90,16}, {105,16}, {120,16}, {135,16}, {150,16}, {165,16}, {180,16}, {195,16}, {224,16}, + {0,32}, {15,32}, {30,32}, {45,32}, {60,32}, {75,32}, {90,32}, {105,32}, {120,32}, {135,32}, {150,32}, {165,32}, {195,32}, {224,32}, + {0,48}, {30,48}, {45,48}, {60,48}, {75,48}, {90,48}, {105,48}, {120,48}, {135,48}, {150,48}, {165,48}, {180,48}, {210,48}, + {0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64}, + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + } +}; +#endif + #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } diff --git a/keyboards/keychron/q2/rev_0111/rules.mk b/keyboards/keychron/q2/rev_0111/rules.mk index 52d0bce592..3b931ef9fe 100644 --- a/keyboards/keychron/q2/rev_0111/rules.mk +++ b/keyboards/keychron/q2/rev_0111/rules.mk @@ -1,13 +1,5 @@ # MCU name -# MCU = STM32L432 -MCU = cortex-m4 -ARMV = 7 -MCU_FAMILY = STM32 -MCU_SERIES = STM32L4xx -MCU_LDSCRIPT = STM32L432xB -MCU_STARTUP = stm32l4xx -BOARD = GENERIC_STM32_L433XC -PLATFORM_NAME = platform_l432 +MCU = STM32L433 # Build Options # change yes to no to disable @@ -23,12 +15,9 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Enable Encoder DIP_SWITCH_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = CKLED2001 EEPROM_DRIVER = i2c # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE - -# custom matrix setup -CUSTOM_MATRIX = lite - -SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0112/config.h b/keyboards/keychron/q2/rev_0112/config.h index b76640d650..70a60fd026 100644 --- a/keyboards/keychron/q2/rev_0112/config.h +++ b/keyboards/keychron/q2/rev_0112/config.h @@ -19,3 +19,8 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x0112 #define DEVICE_VER 0x0100 + +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 34 +#define DRIVER_2_LED_TOTAL 34 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/keychron/q2/rev_0112/rev_0112.c b/keyboards/keychron/q2/rev_0112/rev_0112.c index d91a41fca1..b994679725 100644 --- a/keyboards/keychron/q2/rev_0112/rev_0112.c +++ b/keyboards/keychron/q2/rev_0112/rev_0112.c @@ -15,3 +15,110 @@ */ #include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_14, A_14, B_14}, + {0, C_16, A_16, B_16}, + + {0, F_1, D_1, E_1}, + {0, F_2, D_2, E_2}, + {0, F_3, D_3, E_3}, + {0, F_4, D_4, E_4}, + {0, F_5, D_5, E_5}, + {0, F_6, D_6, E_6}, + {0, F_7, D_7, E_7}, + {0, F_8, D_8, E_8}, + {0, F_9, D_9, E_9}, + {0, F_10, D_10, E_10}, + {0, F_11, D_11, E_11}, + {0, F_12, D_12, E_12}, + {0, F_13, D_13, E_13}, + {0, F_16, D_16, E_16}, + + {0, I_1, G_1, H_1}, + {0, I_2, G_2, H_2}, + {0, I_3, G_3, H_3}, + {0, I_4, G_4, H_4}, + {1, I_5, G_5, H_5}, + {1, I_6, G_6, H_6}, + {1, I_7, G_7, H_7}, + {1, I_8, G_8, H_8}, + {1, I_9, G_9, H_9}, + {1, I_10, G_10, H_10}, + {1, I_11, G_11, H_11}, + {1, I_12, G_12, H_12}, + {1, I_14, G_14, H_14}, + {0, F_14, D_14, E_14}, + {1, I_16, G_16, H_16}, + + {1, C_1, A_1, B_1}, + {1, C_2, A_2, B_2}, + {1, C_3, A_3, B_3}, + {1, C_4, A_4, B_4}, + {1, C_5, A_5, B_5}, + {1, C_6, A_6, B_6}, + {1, C_7, A_7, B_7}, + {1, C_8, A_8, B_8}, + {1, C_9, A_9, B_9}, + {1, C_10, A_10, B_10}, + {1, C_11, A_11, B_11}, + {1, C_12, A_12, B_12}, + {1, C_14, A_14, B_14}, + {1, C_15, A_15, B_15}, + + {1, F_1, D_1, E_1}, + {1, F_2, D_2, E_2}, + {1, F_3, D_3, E_3}, + {1, F_7, D_7, E_7}, + {1, F_11, D_11, E_11}, + {1, F_12, D_12, E_12}, + {1, F_13, D_13, E_13}, + {1, F_14, D_14, E_14}, + {1, F_15, D_15, E_15}, + {1, F_16, D_16, E_16} +}; + +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 42, 28 }, + { 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 66, 41, 43 }, + { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NO_LED, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 67 } + }, + { + {0, 0}, {15, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {195, 0}, {224, 0}, + {0,16}, {15,16}, {30,16}, {45,16}, {60,16}, {75,16}, {90,16}, {105,16}, {120,16}, {135,16}, {150,16}, {165,16}, {180,16}, {224,16}, + {0,32}, {15,32}, {30,32}, {45,32}, {60,32}, {75,32}, {90,32}, {105,32}, {120,32}, {135,32}, {150,32}, {165,32}, {180,32}, {195,16}, {224,32}, + {0,48}, {15,48}, {30,48}, {45,48}, {60,48}, {75,48}, {90,48}, {105,48}, {120,48}, {135,48}, {150,48}, {165,48}, {180,48}, {210,48}, + {0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64} + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + } +}; +#endif diff --git a/keyboards/keychron/q2/rev_0112/rules.mk b/keyboards/keychron/q2/rev_0112/rules.mk index 0d4e745010..957680ab11 100644 --- a/keyboards/keychron/q2/rev_0112/rules.mk +++ b/keyboards/keychron/q2/rev_0112/rules.mk @@ -1,13 +1,5 @@ # MCU name -# MCU = STM32L432 -MCU = cortex-m4 -ARMV = 7 -MCU_FAMILY = STM32 -MCU_SERIES = STM32L4xx -MCU_LDSCRIPT = STM32L432xB -MCU_STARTUP = stm32l4xx -BOARD = GENERIC_STM32_L433XC -PLATFORM_NAME = platform_l432 +MCU = STM32L433 # Build Options # change yes to no to disable @@ -23,12 +15,9 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = no # Enable Encoder DIP_SWITCH_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = CKLED2001 EEPROM_DRIVER = i2c # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE - -# custom matrix setup -CUSTOM_MATRIX = lite - -SRC += matrix.c diff --git a/keyboards/keychron/q2/rev_0113/config.h b/keyboards/keychron/q2/rev_0113/config.h index 21ada693c0..92b9c2e364 100644 --- a/keyboards/keychron/q2/rev_0113/config.h +++ b/keyboards/keychron/q2/rev_0113/config.h @@ -20,6 +20,11 @@ #define PRODUCT_ID 0x0113 #define DEVICE_VER 0x0100 +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 34 +#define DRIVER_2_LED_TOTAL 34 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + /* Encoder used pins */ #define ENCODERS_PAD_A { A10 } #define ENCODERS_PAD_B { B5 } diff --git a/keyboards/keychron/q2/rev_0113/rev_0113.c b/keyboards/keychron/q2/rev_0113/rev_0113.c index c9413d023d..e1d66976dd 100644 --- a/keyboards/keychron/q2/rev_0113/rev_0113.c +++ b/keyboards/keychron/q2/rev_0113/rev_0113.c @@ -16,6 +16,113 @@ #include "quantum.h" +#ifdef RGB_MATRIX_ENABLE +const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C_1, A_1, B_1}, + {0, C_2, A_2, B_2}, + {0, C_3, A_3, B_3}, + {0, C_4, A_4, B_4}, + {0, C_5, A_5, B_5}, + {0, C_6, A_6, B_6}, + {0, C_7, A_7, B_7}, + {0, C_8, A_8, B_8}, + {0, C_9, A_9, B_9}, + {0, C_10, A_10, B_10}, + {0, C_11, A_11, B_11}, + {0, C_12, A_12, B_12}, + {0, C_13, A_13, B_13}, + {0, C_14, A_14, B_14}, + {0, C_16, A_16, B_16}, + + {0, F_1, D_1, E_1}, + {0, F_2, D_2, E_2}, + {0, F_3, D_3, E_3}, + {0, F_4, D_4, E_4}, + {0, F_5, D_5, E_5}, + {0, F_6, D_6, E_6}, + {0, F_7, D_7, E_7}, + {0, F_8, D_8, E_8}, + {0, F_9, D_9, E_9}, + {0, F_10, D_10, E_10}, + {0, F_11, D_11, E_11}, + {0, F_12, D_12, E_12}, + {0, F_13, D_13, E_13}, + {0, F_16, D_16, E_16}, + + {0, I_1, G_1, H_1}, + {0, I_2, G_2, H_2}, + {0, I_3, G_3, H_3}, + {0, I_4, G_4, H_4}, + {1, I_5, G_5, H_5}, + {1, I_6, G_6, H_6}, + {1, I_7, G_7, H_7}, + {1, I_8, G_8, H_8}, + {1, I_9, G_9, H_9}, + {1, I_10, G_10, H_10}, + {1, I_11, G_11, H_11}, + {1, I_12, G_12, H_12}, + {1, I_14, G_14, H_14}, + {0, F_14, D_14, E_14}, + {1, I_16, G_16, H_16}, + + {1, C_1, A_1, B_1}, + {1, C_2, A_2, B_2}, + {1, C_3, A_3, B_3}, + {1, C_4, A_4, B_4}, + {1, C_5, A_5, B_5}, + {1, C_6, A_6, B_6}, + {1, C_7, A_7, B_7}, + {1, C_8, A_8, B_8}, + {1, C_9, A_9, B_9}, + {1, C_10, A_10, B_10}, + {1, C_11, A_11, B_11}, + {1, C_12, A_12, B_12}, + {1, C_14, A_14, B_14}, + {1, C_15, A_15, B_15}, + + {1, F_1, D_1, E_1}, + {1, F_2, D_2, E_2}, + {1, F_3, D_3, E_3}, + {1, F_7, D_7, E_7}, + {1, F_11, D_11, E_11}, + {1, F_12, D_12, E_12}, + {1, F_13, D_13, E_13}, + {1, F_14, D_14, E_14}, + {1, F_15, D_15, E_15}, + {1, F_16, D_16, E_16} +}; + +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, + { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 42, 28 }, + { 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 66, 41, 43 }, + { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NO_LED, 56, 57 }, + { 58, 59, 60, NO_LED, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 67 } + }, + { + {0, 0}, {15, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {120, 0}, {135, 0}, {150, 0}, {165, 0}, {180, 0}, {195, 0}, {224, 0}, + {0,16}, {15,16}, {30,16}, {45,16}, {60,16}, {75,16}, {90,16}, {105,16}, {120,16}, {135,16}, {150,16}, {165,16}, {180,16}, {224,16}, + {0,32}, {15,32}, {30,32}, {45,32}, {60,32}, {75,32}, {90,32}, {105,32}, {120,32}, {135,32}, {150,32}, {165,32}, {180,32}, {195,16}, {224,32}, + {0,48}, {15,48}, {30,48}, {45,48}, {60,48}, {75,48}, {90,48}, {105,48}, {120,48}, {135,48}, {150,48}, {165,48}, {180,48}, {210,48}, + {0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64} + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + } +}; +#endif + #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } diff --git a/keyboards/keychron/q2/rev_0113/rules.mk b/keyboards/keychron/q2/rev_0113/rules.mk index 52d0bce592..3b931ef9fe 100644 --- a/keyboards/keychron/q2/rev_0113/rules.mk +++ b/keyboards/keychron/q2/rev_0113/rules.mk @@ -1,13 +1,5 @@ # MCU name -# MCU = STM32L432 -MCU = cortex-m4 -ARMV = 7 -MCU_FAMILY = STM32 -MCU_SERIES = STM32L4xx -MCU_LDSCRIPT = STM32L432xB -MCU_STARTUP = stm32l4xx -BOARD = GENERIC_STM32_L433XC -PLATFORM_NAME = platform_l432 +MCU = STM32L433 # Build Options # change yes to no to disable @@ -23,12 +15,9 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Enable Encoder DIP_SWITCH_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = CKLED2001 EEPROM_DRIVER = i2c # Enter lower-power sleep mode when on the ChibiOS idle thread OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE - -# custom matrix setup -CUSTOM_MATRIX = lite - -SRC += matrix.c -- cgit v1.2.1 From 1bc1b1b3133ef85426fb537ff576998958f693f5 Mon Sep 17 00:00:00 2001 From: dnlsmy Date: Sat, 22 Jan 2022 10:03:50 -0500 Subject: Update readme.md (#15989) Spelling correction --- keyboards/keychron/q1/rev_0101/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0101/readme.md b/keyboards/keychron/q1/rev_0101/readme.md index d7693349be..b89c9ad7ad 100644 --- a/keyboards/keychron/q1/rev_0101/readme.md +++ b/keyboards/keychron/q1/rev_0101/readme.md @@ -1,4 +1,4 @@ # The ANSI variant of the Keychron Q1 - Enable EC11 rotary encoder -- Turn colckwise to increase volume and turn anti-colckwise to decrease volume -- Press top right key pushbutton to mute \ No newline at end of file +- Turn clockwise to increase volume and turn anti-clockwise to decrease volume +- Press top right key pushbutton to mute -- cgit v1.2.1 From a211887978b5f2f1fef6cee42bb15c601d56c312 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 26 Jan 2022 21:16:09 -0800 Subject: Keychron QMK Configurator Refactor (#16034) --- keyboards/keychron/q1/rev_0101/info.json | 191 +++++++++++++++++++++ .../keychron/q1/rev_0101/keymaps/default/info.json | 97 ----------- .../keychron/q1/rev_0101/keymaps/via/info.json | 100 ----------- .../keychron/q1/rev_0101/keymaps/via/keymap.c | 16 +- keyboards/keychron/q1/rev_0101/rev_0101.h | 4 +- keyboards/keychron/q2/rev_0110/info.json | 136 +++++++-------- keyboards/keychron/q2/rev_0111/info.json | 159 +++++++++++++++++ .../keychron/q2/rev_0111/keymaps/default/info.json | 82 --------- .../keychron/q2/rev_0111/keymaps/via/info.json | 84 --------- .../keychron/q2/rev_0111/keymaps/via/keymap.c | 20 +-- keyboards/keychron/q2/rev_0111/rev_0111.h | 4 +- keyboards/keychron/q2/rev_0112/info.json | 138 +++++++-------- keyboards/keychron/q2/rev_0113/info.json | 161 +++++++++++++++++ .../keychron/q2/rev_0113/keymaps/default/info.json | 83 --------- .../keychron/q2/rev_0113/keymaps/via/info.json | 85 --------- .../keychron/q2/rev_0113/keymaps/via/keymap.c | 20 +-- keyboards/keychron/q2/rev_0113/rev_0113.h | 4 +- 17 files changed, 682 insertions(+), 702 deletions(-) create mode 100644 keyboards/keychron/q1/rev_0101/info.json delete mode 100644 keyboards/keychron/q1/rev_0101/keymaps/default/info.json delete mode 100644 keyboards/keychron/q1/rev_0101/keymaps/via/info.json create mode 100644 keyboards/keychron/q2/rev_0111/info.json delete mode 100644 keyboards/keychron/q2/rev_0111/keymaps/default/info.json delete mode 100644 keyboards/keychron/q2/rev_0111/keymaps/via/info.json create mode 100644 keyboards/keychron/q2/rev_0113/info.json delete mode 100644 keyboards/keychron/q2/rev_0113/keymaps/default/info.json delete mode 100644 keyboards/keychron/q2/rev_0113/keymaps/via/info.json (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q1/rev_0101/info.json b/keyboards/keychron/q1/rev_0101/info.json new file mode 100644 index 0000000000..75fb2d04e8 --- /dev/null +++ b/keyboards/keychron/q1/rev_0101/info.json @@ -0,0 +1,191 @@ +{ + "keyboard_name": "Keychron Q1", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_82": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"Delete", "x":14, "y":0}, + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"`~", "x":0, "y":1.25}, + {"label":"1!", "x":1, "y":1.25}, + {"label":"2@", "x":2, "y":1.25}, + {"label":"3#", "x":3, "y":1.25}, + {"label":"4$", "x":4, "y":1.25}, + {"label":"5%", "x":5, "y":1.25}, + {"label":"6^", "x":6, "y":1.25}, + {"label":"7&", "x":7, "y":1.25}, + {"label":"8*", "x":8, "y":1.25}, + {"label":"9(", "x":9, "y":1.25}, + {"label":"0)", "x":10, "y":1.25}, + {"label":"-_", "x":11, "y":1.25}, + {"label":"=+", "x":12, "y":1.25}, + {"label":"Backspace", "x":13, "y":1.25, "w":2}, + {"label":"Page Up", "x":15.25, "y":1.25}, + + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"[{", "x":11.5, "y":2.25}, + {"label":"]}", "x":12.5, "y":2.25}, + {"label":"\\|", "x":13.5, "y":2.25, "w":1.5}, + {"label":"Page Down", "x":15.25, "y":2.25}, + + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":";:", "x":10.75, "y":3.25}, + {"label":"'\"", "x":11.75, "y":3.25}, + {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":3.25}, + + {"label":"Shift", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":",<", "x":9.25, "y":4.25}, + {"label":".>", "x":10.25, "y":4.25}, + {"label":"/?", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.5}, + + {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, + {"label":"Alt", "x":10, "y":5.25}, + {"label":"Fn", "x":11, "y":5.25}, + {"label":"Ctrl", "x":12, "y":5.25}, + {"label":"Left", "x":13.25, "y":5.5}, + {"label":"Down", "x":14.25, "y":5.5}, + {"label":"Right", "x":15.25, "y":5.5} + ] + }, + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0.5}, + {"label":"F1", "x":1.25, "y":0.5}, + {"label":"F2", "x":2.25, "y":0.5}, + {"label":"F3", "x":3.25, "y":0.5}, + {"label":"F4", "x":4.25, "y":0.5}, + {"label":"F5", "x":5.5, "y":0.5}, + {"label":"F6", "x":6.5, "y":0.5}, + {"label":"F7", "x":7.5, "y":0.5}, + {"label":"F8", "x":8.5, "y":0.5}, + {"label":"F9", "x":9.75, "y":0.5}, + {"label":"F10", "x":10.75, "y":0.5}, + {"label":"F11", "x":11.75, "y":0.5}, + {"label":"F12", "x":12.75, "y":0.5}, + {"label":"Delete", "x":14, "y":0.5}, + {"label":"CCW", "x":15.15, "y":0, "w":0.6, "h":0.5}, + {"label":"Mute", "x":15.25, "y":0.5}, + {"label":"CW", "x":15.75, "y":0, "w":0.6, "h":0.5}, + + {"label":"`~", "x":0, "y":1.75}, + {"label":"1!", "x":1, "y":1.75}, + {"label":"2@", "x":2, "y":1.75}, + {"label":"3#", "x":3, "y":1.75}, + {"label":"4$", "x":4, "y":1.75}, + {"label":"5%", "x":5, "y":1.75}, + {"label":"6^", "x":6, "y":1.75}, + {"label":"7&", "x":7, "y":1.75}, + {"label":"8*", "x":8, "y":1.75}, + {"label":"9(", "x":9, "y":1.75}, + {"label":"0)", "x":10, "y":1.75}, + {"label":"-_", "x":11, "y":1.75}, + {"label":"=+", "x":12, "y":1.75}, + {"label":"Backspace", "x":13, "y":1.75, "w":2}, + {"label":"Page Up", "x":15.25, "y":1.75}, + + {"label":"Tab", "x":0, "y":2.75, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.75}, + {"label":"W", "x":2.5, "y":2.75}, + {"label":"E", "x":3.5, "y":2.75}, + {"label":"R", "x":4.5, "y":2.75}, + {"label":"T", "x":5.5, "y":2.75}, + {"label":"Y", "x":6.5, "y":2.75}, + {"label":"U", "x":7.5, "y":2.75}, + {"label":"I", "x":8.5, "y":2.75}, + {"label":"O", "x":9.5, "y":2.75}, + {"label":"P", "x":10.5, "y":2.75}, + {"label":"[{", "x":11.5, "y":2.75}, + {"label":"]}", "x":12.5, "y":2.75}, + {"label":"\\|", "x":13.5, "y":2.75, "w":1.5}, + {"label":"Page Down", "x":15.25, "y":2.75}, + + {"label":"Caps Lock", "x":0, "y":3.75, "w":1.75}, + {"label":"A", "x":1.75, "y":3.75}, + {"label":"S", "x":2.75, "y":3.75}, + {"label":"D", "x":3.75, "y":3.75}, + {"label":"F", "x":4.75, "y":3.75}, + {"label":"G", "x":5.75, "y":3.75}, + {"label":"H", "x":6.75, "y":3.75}, + {"label":"J", "x":7.75, "y":3.75}, + {"label":"K", "x":8.75, "y":3.75}, + {"label":"L", "x":9.75, "y":3.75}, + {"label":";:", "x":10.75, "y":3.75}, + {"label":"'\"", "x":11.75, "y":3.75}, + {"label":"Enter", "x":12.75, "y":3.75, "w":2.25}, + {"label":"Home", "x":15.25, "y":3.75}, + + {"label":"Shift", "x":0, "y":4.75, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.75}, + {"label":"X", "x":3.25, "y":4.75}, + {"label":"C", "x":4.25, "y":4.75}, + {"label":"V", "x":5.25, "y":4.75}, + {"label":"B", "x":6.25, "y":4.75}, + {"label":"N", "x":7.25, "y":4.75}, + {"label":"M", "x":8.25, "y":4.75}, + {"label":",<", "x":9.25, "y":4.75}, + {"label":".>", "x":10.25, "y":4.75}, + {"label":"/?", "x":11.25, "y":4.75}, + {"label":"Shift", "x":12.25, "y":4.75, "w":1.75}, + {"label":"Up", "x":14.25, "y":5}, + + {"label":"Ctrl", "x":0, "y":5.75, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.75, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.75, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.75, "w":6.25}, + {"label":"Alt", "x":10, "y":5.75}, + {"label":"Fn", "x":11, "y":5.75}, + {"label":"Ctrl", "x":12, "y":5.75}, + {"label":"Left", "x":13.25, "y":6}, + {"label":"Down", "x":14.25, "y":6}, + {"label":"Right", "x":15.25, "y":6} + ] + } + } +} diff --git a/keyboards/keychron/q1/rev_0101/keymaps/default/info.json b/keyboards/keychron/q1/rev_0101/keymaps/default/info.json deleted file mode 100644 index 56bf48acc1..0000000000 --- a/keyboards/keychron/q1/rev_0101/keymaps/default/info.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "keyboard_name": "Keychron Q1", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_ansi_82": { - "layout": [ - {"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"Delete", "x":14, "y":0}, - {"label":"Mute", "x":15.25, "y":0}, - - {"label":"~", "x":0, "y":1.25}, - {"label":"!", "x":1, "y":1.25}, - {"label":"@", "x":2, "y":1.25}, - {"label":"#", "x":3, "y":1.25}, - {"label":"$", "x":4, "y":1.25}, - {"label":"%", "x":5, "y":1.25}, - {"label":"^", "x":6, "y":1.25}, - {"label":"&", "x":7, "y":1.25}, - {"label":"*", "x":8, "y":1.25}, - {"label":"(", "x":9, "y":1.25}, - {"label":")", "x":10, "y":1.25}, - {"label":"_", "x":11, "y":1.25}, - {"label":"+", "x":12, "y":1.25}, - {"label":"Backspace", "x":13, "y":1.25, "w":2}, - {"label":"Page Up", "x":15.25, "y":1.25}, - - {"label":"Tab", "x":0, "y":2.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.25}, - {"label":"W", "x":2.5, "y":2.25}, - {"label":"E", "x":3.5, "y":2.25}, - {"label":"R", "x":4.5, "y":2.25}, - {"label":"T", "x":5.5, "y":2.25}, - {"label":"Y", "x":6.5, "y":2.25}, - {"label":"U", "x":7.5, "y":2.25}, - {"label":"I", "x":8.5, "y":2.25}, - {"label":"O", "x":9.5, "y":2.25}, - {"label":"P", "x":10.5, "y":2.25}, - {"label":"{", "x":11.5, "y":2.25}, - {"label":"}", "x":12.5, "y":2.25}, - {"label":"|", "x":13.5, "y":2.25, "w":1.5}, - {"label":"Page Down", "x":15.25, "y":2.25}, - - {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, - {"label":"A", "x":1.75, "y":3.25}, - {"label":"S", "x":2.75, "y":3.25}, - {"label":"D", "x":3.75, "y":3.25}, - {"label":"F", "x":4.75, "y":3.25}, - {"label":"G", "x":5.75, "y":3.25}, - {"label":"H", "x":6.75, "y":3.25}, - {"label":"J", "x":7.75, "y":3.25}, - {"label":"K", "x":8.75, "y":3.25}, - {"label":"L", "x":9.75, "y":3.25}, - {"label":":", "x":10.75, "y":3.25}, - {"label":"\"", "x":11.75, "y":3.25}, - {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, - {"label":"Home", "x":15.25, "y":3.25}, - - {"label":"Shift", "x":0, "y":4.25, "w":2.25}, - {"label":"Z", "x":2.25, "y":4.25}, - {"label":"X", "x":3.25, "y":4.25}, - {"label":"C", "x":4.25, "y":4.25}, - {"label":"V", "x":5.25, "y":4.25}, - {"label":"B", "x":6.25, "y":4.25}, - {"label":"N", "x":7.25, "y":4.25}, - {"label":"M", "x":8.25, "y":4.25}, - {"label":"<", "x":9.25, "y":4.25}, - {"label":">", "x":10.25, "y":4.25}, - {"label":"?", "x":11.25, "y":4.25}, - {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":4.5}, - - {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, - {"label":"Alt", "x":10, "y":5.25}, - {"label":"Fn", "x":11, "y":5.25}, - {"label":"Ctrl", "x":12, "y":5.25}, - {"label":"Left", "x":13.25, "y":5.5}, - {"label":"Down", "x":14.25, "y":5.5}, - {"label":"Right", "x":15.25, "y":5.5} ] - } - } -} \ No newline at end of file diff --git a/keyboards/keychron/q1/rev_0101/keymaps/via/info.json b/keyboards/keychron/q1/rev_0101/keymaps/via/info.json deleted file mode 100644 index a921ee3e4c..0000000000 --- a/keyboards/keychron/q1/rev_0101/keymaps/via/info.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "keyboard_name": "Keychron Q1", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_all": { - "layout": [ - {"label":"Esc", "x":0, "y":0}, - {"label":"F1", "x":1.25, "y":0}, - {"label":"F2", "x":2.25, "y":0}, - {"label":"F3", "x":3.25, "y":0}, - {"label":"F4", "x":4.25, "y":0}, - {"label":"F5", "x":5.5, "y":0}, - {"label":"F6", "x":6.5, "y":0}, - {"label":"F7", "x":7.5, "y":0}, - {"label":"F8", "x":8.5, "y":0}, - {"label":"F9", "x":9.75, "y":0}, - {"label":"F10", "x":10.75, "y":0}, - {"label":"F11", "x":11.75, "y":0}, - {"label":"F12", "x":12.75, "y":0}, - {"label":"Delete", "x":14, "y":0}, - - {"label":"Mute", "x":15.25, "y":0, "w":0.75}, - {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, - {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, - - {"label":"~", "x":0, "y":1.25}, - {"label":"!", "x":1, "y":1.25}, - {"label":"@", "x":2, "y":1.25}, - {"label":"#", "x":3, "y":1.25}, - {"label":"$", "x":4, "y":1.25}, - {"label":"%", "x":5, "y":1.25}, - {"label":"^", "x":6, "y":1.25}, - {"label":"&", "x":7, "y":1.25}, - {"label":"*", "x":8, "y":1.25}, - {"label":"(", "x":9, "y":1.25}, - {"label":")", "x":10, "y":1.25}, - {"label":"_", "x":11, "y":1}, - {"label":"+", "x":12, "y":1.25}, - {"label":"Backspace", "x":13, "y":1.25, "w":2}, - {"label":"Page Up", "x":15.25, "y":1.25}, - - {"label":"Tab", "x":0, "y":2.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":2.25}, - {"label":"W", "x":2.5, "y":2.25}, - {"label":"E", "x":3.5, "y":2.25}, - {"label":"R", "x":4.5, "y":2.25}, - {"label":"T", "x":5.5, "y":2.25}, - {"label":"Y", "x":6.5, "y":2.25}, - {"label":"U", "x":7.5, "y":2.25}, - {"label":"I", "x":8.5, "y":2.25}, - {"label":"O", "x":9.5, "y":2.25}, - {"label":"P", "x":10.5, "y":2.25}, - {"label":"{", "x":11.5, "y":2.25}, - {"label":"}", "x":12.5, "y":2.25}, - {"label":"|", "x":13.5, "y":2.25, "w":1.5}, - {"label":"Page Down", "x":15.25, "y":2.25}, - - {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, - {"label":"A", "x":1.75, "y":3.25}, - {"label":"S", "x":2.75, "y":3.25}, - {"label":"D", "x":3.75, "y":3.25}, - {"label":"F", "x":4.75, "y":3.25}, - {"label":"G", "x":5.75, "y":3.25}, - {"label":"H", "x":6.75, "y":3.25}, - {"label":"J", "x":7.75, "y":3.25}, - {"label":"K", "x":8.75, "y":3.25}, - {"label":"L", "x":9.75, "y":3.25}, - {"label":":", "x":10.75, "y":3.25}, - {"label":"\"", "x":11.75, "y":3.25}, - {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, - {"label":"Home", "x":15.25, "y":3.25}, - - {"label":"Shift", "x":0, "y":4.25, "w":2.25}, - {"label":"Z", "x":2.25, "y":4.25}, - {"label":"X", "x":3.25, "y":4.25}, - {"label":"C", "x":4.25, "y":4.25}, - {"label":"V", "x":5.25, "y":4.25}, - {"label":"B", "x":6.25, "y":4.25}, - {"label":"N", "x":7.25, "y":4.25}, - {"label":"M", "x":8.25, "y":4.25}, - {"label":"<", "x":9.25, "y":4.25}, - {"label":">", "x":10.25, "y":4.25}, - {"label":"?", "x":11.25, "y":4.25}, - {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":4.5}, - - {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, - {"label":"Alt", "x":10, "y":5.25}, - {"label":"Fn", "x":11, "y":5.25}, - {"label":"Ctrl", "x":12, "y":5.25}, - {"label":"Left", "x":13.25, "y":5.5}, - {"label":"Down", "x":14.25, "y":5.5}, - {"label":"Right", "x":15.25, "y":5.5} ] - } - } -} diff --git a/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c b/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c index 1103f74427..ad053648e5 100644 --- a/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c +++ b/keyboards/keychron/q1/rev_0101/keymaps/via/keymap.c @@ -35,36 +35,36 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_all( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_MUTE, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_VOLD, KC_MUTE, KC_VOLU, KC_GRV, 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_PGUP, 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_PGDN, 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_HOME, 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_VOLD, KC_VOLU, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(MAC_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN] = LAYOUT_all( - KC_TRNS, 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_TRNS, KC_TRNS, + KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [WIN_BASE] = LAYOUT_all( - KC_ESC, 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_MUTE, + KC_ESC, 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_VOLD, KC_MUTE, KC_VOLU, KC_GRV, 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_PGUP, 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_PGDN, 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_HOME, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [WIN_FN] = LAYOUT_all( - KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; #if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) diff --git a/keyboards/keychron/q1/rev_0101/rev_0101.h b/keyboards/keychron/q1/rev_0101/rev_0101.h index 132003c4f1..e4e8205b71 100644 --- a/keyboards/keychron/q1/rev_0101/rev_0101.h +++ b/keyboards/keychron/q1/rev_0101/rev_0101.h @@ -21,12 +21,12 @@ #define xxx KC_NO #define LAYOUT_all( \ - K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4E, K0E, \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K4E, K57, K0E, K58, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K3C, \ - K50, K51, K52, K56, K57, K58, K5A, K5B, K5C, K5D, K4C, K5E \ + K50, K51, K52, K56, K5A, K5B, K5C, K5D, K4C, K5E \ ) { \ { K00, xxx, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ diff --git a/keyboards/keychron/q2/rev_0110/info.json b/keyboards/keychron/q2/rev_0110/info.json index caf3ebf7c9..fb34a2427a 100644 --- a/keyboards/keychron/q2/rev_0110/info.json +++ b/keyboards/keychron/q2/rev_0110/info.json @@ -5,78 +5,78 @@ "layouts": { "LAYOUT_ansi_67": { "layout": [ - {"label":"Insert", "x":15.25, "y":0}, + {"label":"Esc", "x":0, "y":0.25}, + {"label":"1!", "x":1, "y":0.25}, + {"label":"2@", "x":2, "y":0.25}, + {"label":"3#", "x":3, "y":0.25}, + {"label":"4$", "x":4, "y":0.25}, + {"label":"5%", "x":5, "y":0.25}, + {"label":"6^", "x":6, "y":0.25}, + {"label":"7&", "x":7, "y":0.25}, + {"label":"8*", "x":8, "y":0.25}, + {"label":"9(", "x":9, "y":0.25}, + {"label":"0)", "x":10, "y":0.25}, + {"label":"-_", "x":11, "y":0.25}, + {"label":"=+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Insert", "x":15.25, "y":0}, - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"[{", "x":11.5, "y":1.25}, + {"label":"]}", "x":12.5, "y":1.25}, + {"label":"\\|", "x":13.5, "y":1.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.25}, - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"|", "x":13.5, "y":1.25, "w":1.5}, - {"label":"Delete", "x":15.25, "y":1.25}, + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":";:", "x":10.75, "y":2.25}, + {"label":"'\"", "x":11.75, "y":2.25}, + {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.25}, - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, - {"label":"Home", "x":15.25, "y":2.25}, + {"label":"Shift", "x":0, "y":3.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":",<", "x":9.25, "y":3.25}, + {"label":".>", "x":10.25, "y":3.25}, + {"label":"/?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, - {"label":"Shift", "x":0, "y":3.25, "w":2.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} + ] } } } diff --git a/keyboards/keychron/q2/rev_0111/info.json b/keyboards/keychron/q2/rev_0111/info.json new file mode 100644 index 0000000000..f6ce1d9b27 --- /dev/null +++ b/keyboards/keychron/q2/rev_0111/info.json @@ -0,0 +1,159 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_ansi_67": { + "layout": [ + {"label":"Esc", "x":0, "y":0.25}, + {"label":"1!", "x":1, "y":0.25}, + {"label":"2@", "x":2, "y":0.25}, + {"label":"3#", "x":3, "y":0.25}, + {"label":"4$", "x":4, "y":0.25}, + {"label":"5%", "x":5, "y":0.25}, + {"label":"6^", "x":6, "y":0.25}, + {"label":"7&", "x":7, "y":0.25}, + {"label":"8*", "x":8, "y":0.25}, + {"label":"9(", "x":9, "y":0.25}, + {"label":"0)", "x":10, "y":0.25}, + {"label":"-_", "x":11, "y":0.25}, + {"label":"=+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"[{", "x":11.5, "y":1.25}, + {"label":"]}", "x":12.5, "y":1.25}, + {"label":"\\|", "x":13.5, "y":1.25, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":";:", "x":10.75, "y":2.25}, + {"label":"'\"", "x":11.75, "y":2.25}, + {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":",<", "x":9.25, "y":3.25}, + {"label":".>", "x":10.25, "y":3.25}, + {"label":"/?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} + ] + }, + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0.75}, + {"label":"1!", "x":1, "y":0.75}, + {"label":"2@", "x":2, "y":0.75}, + {"label":"3#", "x":3, "y":0.75}, + {"label":"4$", "x":4, "y":0.75}, + {"label":"5%", "x":5, "y":0.75}, + {"label":"6^", "x":6, "y":0.75}, + {"label":"7&", "x":7, "y":0.75}, + {"label":"8*", "x":8, "y":0.75}, + {"label":"9(", "x":9, "y":0.75}, + {"label":"0)", "x":10, "y":0.75}, + {"label":"-_", "x":11, "y":0.75}, + {"label":"=+", "x":12, "y":0.75}, + {"label":"Backspace", "x":13, "y":0.75, "w":2}, + {"label":"CCW", "x":15.15, "y":0, "w":0.6, "h":0.5}, + {"label":"Mute", "x":15.25, "y":0.5}, + {"label":"CW", "x":15.75, "y":0, "w":0.6, "h":0.5}, + + {"label":"Tab", "x":0, "y":1.75, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.75}, + {"label":"W", "x":2.5, "y":1.75}, + {"label":"E", "x":3.5, "y":1.75}, + {"label":"R", "x":4.5, "y":1.75}, + {"label":"T", "x":5.5, "y":1.75}, + {"label":"Y", "x":6.5, "y":1.75}, + {"label":"U", "x":7.5, "y":1.75}, + {"label":"I", "x":8.5, "y":1.75}, + {"label":"O", "x":9.5, "y":1.75}, + {"label":"P", "x":10.5, "y":1.75}, + {"label":"[{", "x":11.5, "y":1.75}, + {"label":"]}", "x":12.5, "y":1.75}, + {"label":"\\|", "x":13.5, "y":1.75, "w":1.5}, + {"label":"Delete", "x":15.25, "y":1.75}, + + {"label":"Caps Lock", "x":0, "y":2.75, "w":1.75}, + {"label":"A", "x":1.75, "y":2.75}, + {"label":"S", "x":2.75, "y":2.75}, + {"label":"D", "x":3.75, "y":2.75}, + {"label":"F", "x":4.75, "y":2.75}, + {"label":"G", "x":5.75, "y":2.75}, + {"label":"H", "x":6.75, "y":2.75}, + {"label":"J", "x":7.75, "y":2.75}, + {"label":"K", "x":8.75, "y":2.75}, + {"label":"L", "x":9.75, "y":2.75}, + {"label":";:", "x":10.75, "y":2.75}, + {"label":"'\"", "x":11.75, "y":2.75}, + {"label":"Enter", "x":12.75, "y":2.75, "w":2.25}, + {"label":"Home", "x":15.25, "y":2.75}, + + {"label":"Shift", "x":0, "y":3.75, "w":2.25}, + {"label":"Z", "x":2.25, "y":3.75}, + {"label":"X", "x":3.25, "y":3.75}, + {"label":"C", "x":4.25, "y":3.75}, + {"label":"V", "x":5.25, "y":3.75}, + {"label":"B", "x":6.25, "y":3.75}, + {"label":"N", "x":7.25, "y":3.75}, + {"label":"M", "x":8.25, "y":3.75}, + {"label":",<", "x":9.25, "y":3.75}, + {"label":".>", "x":10.25, "y":3.75}, + {"label":"/?", "x":11.25, "y":3.75}, + {"label":"Shift", "x":12.25, "y":3.75, "w":1.75}, + {"label":"Up", "x":14.25, "y":4}, + + {"label":"Ctrl", "x":0, "y":4.75, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.75, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.75, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.75, "w":6.25}, + {"label":"Alt", "x":10, "y":4.75}, + {"label":"Fn1", "x":11, "y":4.75}, + {"label":"Fn2", "x":12, "y":4.75}, + {"label":"Left", "x":13.25, "y":5}, + {"label":"Down", "x":14.25, "y":5}, + {"label":"Right", "x":15.25, "y":5} + ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/default/info.json b/keyboards/keychron/q2/rev_0111/keymaps/default/info.json deleted file mode 100644 index 590ed6d115..0000000000 --- a/keyboards/keychron/q2/rev_0111/keymaps/default/info.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "keyboard_name": "Keychron Q2", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_ansi_": { - "layout": [ - {"label":"Mute", "x":15.25, "y":0}, - - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, - - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"|", "x":13.5, "y":1.25, "w":1.5}, - {"label":"Delete", "x":15.25, "y":1.25}, - - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, - {"label":"Home", "x":15.25, "y":2.25}, - - {"label":"Shift", "x":0, "y":3.25, "w":2.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] - } - } -} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/via/info.json b/keyboards/keychron/q2/rev_0111/keymaps/via/info.json deleted file mode 100644 index 0e2ad8463f..0000000000 --- a/keyboards/keychron/q2/rev_0111/keymaps/via/info.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "keyboard_name": "Keychron Q2", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_ansi_": { - "layout": [ - {"label":"Mute", "x":15.25, "y":0, "w":0.75}, - {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, - {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, - - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, - - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"|", "x":13.5, "y":1.25, "w":1.5}, - {"label":"Delete", "x":15.25, "y":1.25}, - - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, - {"label":"Home", "x":15.25, "y":2.25}, - - {"label":"Shift", "x":0, "y":3.25, "w":2.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] - } - } -} diff --git a/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c index 15cdbb027e..a22143eb02 100644 --- a/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c +++ b/keyboards/keychron/q2/rev_0111/keymaps/via/keymap.c @@ -37,39 +37,39 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_all( - KC_ESC, 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_MUTE, + KC_ESC, 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_VOLD, KC_MUTE, KC_VOLU, 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_DEL, 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_HOME, 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_VOLD, KC_VOLU, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), [WIN_BASE] = LAYOUT_all( - KC_ESC, 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_MUTE, + KC_ESC, 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_VOLD, KC_MUTE, KC_VOLU, 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_DEL, 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_HOME, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), [_FN1] = LAYOUT_all( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN2] = LAYOUT_all( - KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN3] = LAYOUT_all( - KC_WAVE, 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_TRNS, KC_TRNS, + KC_WAVE, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; #if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) diff --git a/keyboards/keychron/q2/rev_0111/rev_0111.h b/keyboards/keychron/q2/rev_0111/rev_0111.h index 0b1cfade1b..5033db61fc 100644 --- a/keyboards/keychron/q2/rev_0111/rev_0111.h +++ b/keyboards/keychron/q2/rev_0111/rev_0111.h @@ -21,11 +21,11 @@ #define XXX KC_NO #define LAYOUT_all( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K47, K0E, K48, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E,\ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K47, K48, K4A, K4B, K4C, K4D, K2C, K4E \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ diff --git a/keyboards/keychron/q2/rev_0112/info.json b/keyboards/keychron/q2/rev_0112/info.json index 83a7addfeb..5f0d4ab249 100644 --- a/keyboards/keychron/q2/rev_0112/info.json +++ b/keyboards/keychron/q2/rev_0112/info.json @@ -5,79 +5,79 @@ "layouts": { "LAYOUT_iso_68": { "layout": [ - {"label":"Insert", "x":15.25, "y":0}, + {"label":"Esc", "x":0, "y":0.25}, + {"label":"1!", "x":1, "y":0.25}, + {"label":"2\"", "x":2, "y":0.25}, + {"label":"3\u00a3", "x":3, "y":0.25}, + {"label":"4$", "x":4, "y":0.25}, + {"label":"5%", "x":5, "y":0.25}, + {"label":"6^", "x":6, "y":0.25}, + {"label":"7&", "x":7, "y":0.25}, + {"label":"8*", "x":8, "y":0.25}, + {"label":"9(", "x":9, "y":0.25}, + {"label":"0)", "x":10, "y":0.25}, + {"label":"-_", "x":11, "y":0.25}, + {"label":"=+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Insert", "x":15.25, "y":0}, - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"[{", "x":11.5, "y":1.25}, + {"label":"]}", "x":12.5, "y":1.25}, + {"label":"Delete", "x":15.25, "y":1.25}, - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"Delete", "x":15.25, "y":1.25}, + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":";:", "x":10.75, "y":2.25}, + {"label":"'@", "x":11.75, "y":2.25}, + {"label":"#~", "x":12.75, "y":2.25}, + {"label":"Enter", "x":13.75, "y":1.25, "w":1.25, "h":2}, + {"label":"Home", "x":15.25, "y":2.25}, - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"#~", "x":12.75, "y":2.25}, - {"label":"Enter", "x":13.75, "y":2.25, "w":1.25} - {"label":"Home", "x":15.25, "y":2.25}, + {"label":"Shift", "x":0, "y":3.25, "w":1.25}, + {"label":"\\|", "x":1.25, "y":3.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":",<", "x":9.25, "y":3.25}, + {"label":".>", "x":10.25, "y":3.25}, + {"label":"/?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, - {"label":"Shift", "x":0, "y":3.25, "w":1.25}, - {"label":"|", "x":1.25, "y":3.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} + ] } } } diff --git a/keyboards/keychron/q2/rev_0113/info.json b/keyboards/keychron/q2/rev_0113/info.json new file mode 100644 index 0000000000..151f42455d --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/info.json @@ -0,0 +1,161 @@ +{ + "keyboard_name": "Keychron Q2", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "layouts": { + "LAYOUT_iso_68": { + "layout": [ + {"label":"Esc", "x":0, "y":0.25}, + {"label":"1!", "x":1, "y":0.25}, + {"label":"2\"", "x":2, "y":0.25}, + {"label":"3\u00a3", "x":3, "y":0.25}, + {"label":"4$", "x":4, "y":0.25}, + {"label":"5%", "x":5, "y":0.25}, + {"label":"6^", "x":6, "y":0.25}, + {"label":"7&", "x":7, "y":0.25}, + {"label":"8*", "x":8, "y":0.25}, + {"label":"9(", "x":9, "y":0.25}, + {"label":"0)", "x":10, "y":0.25}, + {"label":"-_", "x":11, "y":0.25}, + {"label":"=+", "x":12, "y":0.25}, + {"label":"Backspace", "x":13, "y":0.25, "w":2}, + {"label":"Mute", "x":15.25, "y":0}, + + {"label":"Tab", "x":0, "y":1.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.25}, + {"label":"W", "x":2.5, "y":1.25}, + {"label":"E", "x":3.5, "y":1.25}, + {"label":"R", "x":4.5, "y":1.25}, + {"label":"T", "x":5.5, "y":1.25}, + {"label":"Y", "x":6.5, "y":1.25}, + {"label":"U", "x":7.5, "y":1.25}, + {"label":"I", "x":8.5, "y":1.25}, + {"label":"O", "x":9.5, "y":1.25}, + {"label":"P", "x":10.5, "y":1.25}, + {"label":"[{", "x":11.5, "y":1.25}, + {"label":"]}", "x":12.5, "y":1.25}, + {"label":"Delete", "x":15.25, "y":1.25}, + + {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, + {"label":"A", "x":1.75, "y":2.25}, + {"label":"S", "x":2.75, "y":2.25}, + {"label":"D", "x":3.75, "y":2.25}, + {"label":"F", "x":4.75, "y":2.25}, + {"label":"G", "x":5.75, "y":2.25}, + {"label":"H", "x":6.75, "y":2.25}, + {"label":"J", "x":7.75, "y":2.25}, + {"label":"K", "x":8.75, "y":2.25}, + {"label":"L", "x":9.75, "y":2.25}, + {"label":";:", "x":10.75, "y":2.25}, + {"label":"'@", "x":11.75, "y":2.25}, + {"label":"#~", "x":12.75, "y":2.25}, + {"label":"Enter", "x":13.75, "y":1.25, "w":1.25, "h":2}, + {"label":"Home", "x":15.25, "y":2.25}, + + {"label":"Shift", "x":0, "y":3.25, "w":1.25}, + {"label":"\\|", "x":1.25, "y":3.25}, + {"label":"Z", "x":2.25, "y":3.25}, + {"label":"X", "x":3.25, "y":3.25}, + {"label":"C", "x":4.25, "y":3.25}, + {"label":"V", "x":5.25, "y":3.25}, + {"label":"B", "x":6.25, "y":3.25}, + {"label":"N", "x":7.25, "y":3.25}, + {"label":"M", "x":8.25, "y":3.25}, + {"label":",<", "x":9.25, "y":3.25}, + {"label":".>", "x":10.25, "y":3.25}, + {"label":"/?", "x":11.25, "y":3.25}, + {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, + {"label":"Up", "x":14.25, "y":3.5}, + + {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, + {"label":"Alt", "x":10, "y":4.25}, + {"label":"Fn1", "x":11, "y":4.25}, + {"label":"Fn2", "x":12, "y":4.25}, + {"label":"Left", "x":13.25, "y":4.5}, + {"label":"Down", "x":14.25, "y":4.5}, + {"label":"Right", "x":15.25, "y":4.5} + ] + }, + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0.75}, + {"label":"1!", "x":1, "y":0.75}, + {"label":"2\"", "x":2, "y":0.75}, + {"label":"3\u00a3", "x":3, "y":0.75}, + {"label":"4$", "x":4, "y":0.75}, + {"label":"5%", "x":5, "y":0.75}, + {"label":"6^", "x":6, "y":0.75}, + {"label":"7&", "x":7, "y":0.75}, + {"label":"8*", "x":8, "y":0.75}, + {"label":"9(", "x":9, "y":0.75}, + {"label":"0)", "x":10, "y":0.75}, + {"label":"-_", "x":11, "y":0.75}, + {"label":"=+", "x":12, "y":0.75}, + {"label":"Backspace", "x":13, "y":0.75, "w":2}, + {"label":"CCW", "x":15.15, "y":0, "w":0.6, "h":0.5}, + {"label":"Mute", "x":15.25, "y":0.5}, + {"label":"CW", "x":15.75, "y":0, "w":0.6, "h":0.5}, + + {"label":"Tab", "x":0, "y":1.75, "w":1.5}, + {"label":"Q", "x":1.5, "y":1.75}, + {"label":"W", "x":2.5, "y":1.75}, + {"label":"E", "x":3.5, "y":1.75}, + {"label":"R", "x":4.5, "y":1.75}, + {"label":"T", "x":5.5, "y":1.75}, + {"label":"Y", "x":6.5, "y":1.75}, + {"label":"U", "x":7.5, "y":1.75}, + {"label":"I", "x":8.5, "y":1.75}, + {"label":"O", "x":9.5, "y":1.75}, + {"label":"P", "x":10.5, "y":1.75}, + {"label":"[{", "x":11.5, "y":1.75}, + {"label":"]}", "x":12.5, "y":1.75}, + {"label":"Delete", "x":15.25, "y":1.75}, + + {"label":"Caps Lock", "x":0, "y":2.75, "w":1.75}, + {"label":"A", "x":1.75, "y":2.75}, + {"label":"S", "x":2.75, "y":2.75}, + {"label":"D", "x":3.75, "y":2.75}, + {"label":"F", "x":4.75, "y":2.75}, + {"label":"G", "x":5.75, "y":2.75}, + {"label":"H", "x":6.75, "y":2.75}, + {"label":"J", "x":7.75, "y":2.75}, + {"label":"K", "x":8.75, "y":2.75}, + {"label":"L", "x":9.75, "y":2.75}, + {"label":";:", "x":10.75, "y":2.75}, + {"label":"'@", "x":11.75, "y":2.75}, + {"label":"#~", "x":12.75, "y":2.75}, + {"label":"Enter", "x":13.75, "y":1.75, "w":1.25, "h":2}, + {"label":"Home", "x":15.25, "y":2.75}, + + {"label":"Shift", "x":0, "y":3.75, "w":1.25}, + {"label":"\\|", "x":1.25, "y":3.75}, + {"label":"Z", "x":2.25, "y":3.75}, + {"label":"X", "x":3.25, "y":3.75}, + {"label":"C", "x":4.25, "y":3.75}, + {"label":"V", "x":5.25, "y":3.75}, + {"label":"B", "x":6.25, "y":3.75}, + {"label":"N", "x":7.25, "y":3.75}, + {"label":"M", "x":8.25, "y":3.75}, + {"label":",<", "x":9.25, "y":3.75}, + {"label":".>", "x":10.25, "y":3.75}, + {"label":"/?", "x":11.25, "y":3.75}, + {"label":"Shift", "x":12.25, "y":3.75, "w":1.75}, + {"label":"Up", "x":14.25, "y":4}, + + {"label":"Ctrl", "x":0, "y":4.75, "w":1.25}, + {"label":"Win", "x":1.25, "y":4.75, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4.75, "w":1.25}, + {"label":"Space", "x":3.75, "y":4.75, "w":6.25}, + {"label":"Alt", "x":10, "y":4.75}, + {"label":"Fn1", "x":11, "y":4.75}, + {"label":"Fn2", "x":12, "y":4.75}, + {"label":"Left", "x":13.25, "y":5}, + {"label":"Down", "x":14.25, "y":5}, + {"label":"Right", "x":15.25, "y":5} + ] + } + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/default/info.json b/keyboards/keychron/q2/rev_0113/keymaps/default/info.json deleted file mode 100644 index 8448d4c995..0000000000 --- a/keyboards/keychron/q2/rev_0113/keymaps/default/info.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "keyboard_name": "Keychron Q2", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_iso_68": { - "layout": [ - {"label":"Mute", "x":15.25, "y":0}, - - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, - - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"Delete", "x":15.25, "y":1.25}, - - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"#~", "x":12.75, "y":2.25}, - {"label":"Enter", "x":13.75, "y":2.25, "w":1.25}, - {"label":"Home", "x":15.25, "y":2.25}, - - {"label":"Shift", "x":0, "y":3.25, "w":1.25}, - {"label":"|", "x":1.25, "y":3.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] - } - } -} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/via/info.json b/keyboards/keychron/q2/rev_0113/keymaps/via/info.json deleted file mode 100644 index 6111f83d23..0000000000 --- a/keyboards/keychron/q2/rev_0113/keymaps/via/info.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "keyboard_name": "Keychron Q2", - "url": "https://github.com/Keychron", - "maintainer": "lalalademaxiya1", - "layouts": { - "LAYOUT_iso_68": { - "layout": [ - {"label":"Mute", "x":15.25, "y":0, "w":0.75}, - {"label":"Vol-", "x":16, "y":0, "w":0.75, "h":0.5}, - {"label":"Vol+", "x":16, "y":0.5, "w":0.75, "h":0.5}, - - {"label":"Esc", "x":0, "y":0.25}, - {"label":"!", "x":1, "y":0.25}, - {"label":"@", "x":2, "y":0.25}, - {"label":"", "x":3, "y":0.25}, - {"label":"$", "x":4, "y":0.25}, - {"label":"%", "x":5, "y":0.25}, - {"label":"^", "x":6, "y":0.25}, - {"label":"&", "x":7, "y":0.25}, - {"label":"*", "x":8, "y":0.25}, - {"label":"(", "x":9, "y":0.25}, - {"label":")", "x":10, "y":0.25}, - {"label":"_", "x":11, "y":0.25}, - {"label":"+", "x":12, "y":0.25}, - {"label":"Backspace", "x":13, "y":0.25, "w":2}, - - {"label":"Tab", "x":0, "y":1.25, "w":1.5}, - {"label":"Q", "x":1.5, "y":1.25}, - {"label":"W", "x":2.5, "y":1.25}, - {"label":"E", "x":3.5, "y":1.25}, - {"label":"R", "x":4.5, "y":1.25}, - {"label":"T", "x":5.5, "y":1.25}, - {"label":"Y", "x":6.5, "y":1.25}, - {"label":"U", "x":7.5, "y":1.25}, - {"label":"I", "x":8.5, "y":1.25}, - {"label":"O", "x":9.5, "y":1.25}, - {"label":"P", "x":10.5, "y":1.25}, - {"label":"{", "x":11.5, "y":1.25}, - {"label":"}", "x":12.5, "y":1.25}, - {"label":"Delete", "x":15.25, "y":1.25}, - - {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, - {"label":"A", "x":1.75, "y":2.25}, - {"label":"S", "x":2.75, "y":2.25}, - {"label":"D", "x":3.75, "y":2.25}, - {"label":"F", "x":4.75, "y":2.25}, - {"label":"G", "x":5.75, "y":2.25}, - {"label":"H", "x":6.75, "y":2.25}, - {"label":"J", "x":7.75, "y":2.25}, - {"label":"K", "x":8.75, "y":2.25}, - {"label":"L", "x":9.75, "y":2.25}, - {"label":":", "x":10.75, "y":2.25}, - {"label":"\"", "x":11.75, "y":2.25}, - {"label":"#~", "x":12.75, "y":2.25}, - {"label":"Enter", "x":13.75, "y":2.25, "w":1.25}, - {"label":"Home", "x":15.25, "y":2.25}, - - {"label":"Shift", "x":0, "y":3.25, "w":1.25}, - {"label":"|", "x":1.25, "y":3.25}, - {"label":"Z", "x":2.25, "y":3.25}, - {"label":"X", "x":3.25, "y":3.25}, - {"label":"C", "x":4.25, "y":3.25}, - {"label":"V", "x":5.25, "y":3.25}, - {"label":"B", "x":6.25, "y":3.25}, - {"label":"N", "x":7.25, "y":3.25}, - {"label":"M", "x":8.25, "y":3.25}, - {"label":"<", "x":9.25, "y":3.25}, - {"label":">", "x":10.25, "y":3.25}, - {"label":"?", "x":11.25, "y":3.25}, - {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, - {"label":"Up", "x":14.25, "y":3.5}, - - {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, - {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, - {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, - {"label":"Space", "x":3.75, "y":4.25, "w":6.25}, - {"label":"Alt", "x":10, "y":4.25}, - {"label":"Fn1", "x":11, "y":4.25}, - {"label":"Fn2", "x":12, "y":4.25}, - {"label":"Left", "x":13.25, "y":4.5}, - {"label":"Down", "x":14.25, "y":4.5}, - {"label":"Right", "x":15.25, "y":4.5} ] - } - } -} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c b/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c index 9c7ad72be7..4e3b431bdf 100644 --- a/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c +++ b/keyboards/keychron/q2/rev_0113/keymaps/via/keymap.c @@ -37,39 +37,39 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_all( - KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MUTE, + KC_ESC, KC_1, KC_2, KC_F3, KC_F4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_VOLD, KC_MUTE, KC_VOLU, 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_DEL, 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_HOME, 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_VOLD, KC_VOLU, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), [WIN_BASE] = LAYOUT_all( - KC_ESC, 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_MUTE, + KC_ESC, 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_VOLD, KC_MUTE, KC_VOLU, 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_DEL, 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_HOME, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_VOLD, KC_VOLU, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), [_FN1] = LAYOUT_all( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN2] = LAYOUT_all( - KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN3] = LAYOUT_all( - KC_WAVE, 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_TRNS, KC_TRNS, + KC_WAVE, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; #if defined(VIA_ENABLE) && defined(ENCODER_ENABLE) diff --git a/keyboards/keychron/q2/rev_0113/rev_0113.h b/keyboards/keychron/q2/rev_0113/rev_0113.h index 21d20463e9..3b0b2d3377 100644 --- a/keyboards/keychron/q2/rev_0113/rev_0113.h +++ b/keyboards/keychron/q2/rev_0113/rev_0113.h @@ -21,11 +21,11 @@ #define XXX KC_NO #define LAYOUT_all( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K47, K0E, K48,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E,\ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K1D, K2E,\ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K41, K42, K46, K47, K48, K4A, K4B, K4C, K4D, K2C, K4E \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K2C, K4E \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, }, \ -- cgit v1.2.1 From f4f3bf81c79516b3ad1a0e8c05ef8986f8b546eb Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 5 Feb 2022 16:55:24 +1100 Subject: Add missing `BOOTLOADER` for a handful of boards (#16225) --- keyboards/keychron/q2/rev_0110/rules.mk | 3 +++ keyboards/keychron/q2/rev_0111/rules.mk | 3 +++ keyboards/keychron/q2/rev_0112/rules.mk | 3 +++ keyboards/keychron/q2/rev_0113/rules.mk | 3 +++ 4 files changed, 12 insertions(+) (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q2/rev_0110/rules.mk b/keyboards/keychron/q2/rev_0110/rules.mk index 957680ab11..30394028b3 100644 --- a/keyboards/keychron/q2/rev_0110/rules.mk +++ b/keyboards/keychron/q2/rev_0110/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0111/rules.mk b/keyboards/keychron/q2/rev_0111/rules.mk index 3b931ef9fe..a295f48e10 100644 --- a/keyboards/keychron/q2/rev_0111/rules.mk +++ b/keyboards/keychron/q2/rev_0111/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0112/rules.mk b/keyboards/keychron/q2/rev_0112/rules.mk index 957680ab11..30394028b3 100644 --- a/keyboards/keychron/q2/rev_0112/rules.mk +++ b/keyboards/keychron/q2/rev_0112/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # diff --git a/keyboards/keychron/q2/rev_0113/rules.mk b/keyboards/keychron/q2/rev_0113/rules.mk index 3b931ef9fe..a295f48e10 100644 --- a/keyboards/keychron/q2/rev_0113/rules.mk +++ b/keyboards/keychron/q2/rev_0113/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = STM32L433 +# Bootloader selection +BOOTLOADER = stm32-dfu + # Build Options # change yes to no to disable # -- cgit v1.2.1 From efdaa7f97205f8964c076677519d1848c5ac4b41 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 9 Feb 2022 15:50:13 +1100 Subject: Add support for driving unselected row/col. (#16278) --- keyboards/keychron/q2/config.h | 2 + keyboards/keychron/q2/matrix.c | 139 ----------------------------------------- 2 files changed, 2 insertions(+), 139 deletions(-) delete mode 100644 keyboards/keychron/q2/matrix.c (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h index 8252b83df8..d019bcee15 100644 --- a/keyboards/keychron/q2/config.h +++ b/keyboards/keychron/q2/config.h @@ -29,6 +29,8 @@ #define MATRIX_ROW_PINS { B4, B3, A15, A14, A13 } #define MATRIX_COL_PINS { C14, C15, A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, A8, A9, H3 } +#define MATRIX_UNSELECT_DRIVE_HIGH + /* DIP switch */ #define DIP_SWITCH_MATRIX_GRID { {4, 4} } diff --git a/keyboards/keychron/q2/matrix.c b/keyboards/keychron/q2/matrix.c deleted file mode 100644 index 1e493d33e2..0000000000 --- a/keyboards/keychron/q2/matrix.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright 2021 @ Keychron (https://www.keychron.com) - * - * 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 . - */ - -#include -#include -#include -#include "util.h" -#include "matrix.h" -#include "debounce.h" -#include "quantum.h" - -#ifdef MATRIX_ROW_PINS -static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -#endif // MATRIX_ROW_PINS -#ifdef MATRIX_COL_PINS -static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -#endif // MATRIX_COL_PINS - -#define ROWS_PER_HAND (MATRIX_ROWS) - -/* matrix state(1:on, 0:off) */ -extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values -extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values - -static inline void setPinOutput_writeLow(pin_t pin) { - ATOMIC_BLOCK_FORCEON { - setPinOutput(pin); - writePinLow(pin); - } -} - -static inline void setPinOutput_writeHigh(pin_t pin) { - ATOMIC_BLOCK_FORCEON { - setPinOutput(pin); - writePinHigh(pin); - } -} - -static inline void setPinInputHigh_atomic(pin_t pin) { - ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); } -} - -static inline uint8_t readMatrixPin(pin_t pin) { - if (pin != NO_PIN) { - return readPin(pin); - } else { - return 1; - } -} - -static bool select_col(uint8_t col) { - pin_t pin = col_pins[col]; - if (pin != NO_PIN) { - setPinOutput_writeLow(pin); - return true; - } - return false; -} - -static void unselect_col(uint8_t col) { - pin_t pin = col_pins[col]; - if (pin != NO_PIN) { - setPinOutput_writeHigh(pin); - } -} - -static void unselect_cols(void) { - for (uint8_t x = 0; x < MATRIX_COLS; x++) { - unselect_col(x); - } -} - -void matrix_init_pins(void) { - unselect_cols(); - for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { - if (row_pins[x] != NO_PIN) { - setPinInputHigh_atomic(row_pins[x]); - } - } -} - -void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { - bool key_pressed = false; - - // Select col - if (!select_col(current_col)) { // select col - return; // skip NO_PIN col - } - matrix_output_select_delay(); - - // For each row... - for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { - // Check row pin state - if (readMatrixPin(row_pins[row_index]) == 0) { - // Pin LO, set col bit - current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col); - key_pressed = true; - } else { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col); - } - } - - // Unselect col - unselect_col(current_col); - matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH -} - -void matrix_init_custom(void) { - // initialize key pins - matrix_init_pins(); -} - -bool matrix_scan_custom(matrix_row_t current_matrix[]) { - matrix_row_t curr_matrix[MATRIX_ROWS] = {0}; - - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { - matrix_read_rows_on_col(curr_matrix, current_col); - } - - bool changed = memcmp(current_matrix, curr_matrix, sizeof(curr_matrix)) != 0; - if (changed) memcpy(current_matrix, curr_matrix, sizeof(curr_matrix)); - - return (uint8_t)changed; -} -- cgit v1.2.1 From 92d38c37ec06aba943464a272886c70ba88e5f68 Mon Sep 17 00:00:00 2001 From: Dan Hertz Date: Wed, 23 Mar 2022 09:34:42 -0700 Subject: [Keymap] Add dhertz keychron map v0 (#16571) --- keyboards/keychron/q2/rev_0113/config.h | 2 +- .../keychron/q2/rev_0113/keymaps/dhertz/keymap.c | 94 ++++++++++++++++++++++ .../keychron/q2/rev_0113/keymaps/dhertz/rules.mk | 1 + 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/dhertz/keymap.c create mode 100644 keyboards/keychron/q2/rev_0113/keymaps/dhertz/rules.mk (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q2/rev_0113/config.h b/keyboards/keychron/q2/rev_0113/config.h index 92b9c2e364..486d3fd3b8 100644 --- a/keyboards/keychron/q2/rev_0113/config.h +++ b/keyboards/keychron/q2/rev_0113/config.h @@ -30,4 +30,4 @@ #define ENCODERS_PAD_B { B5 } /* Specifies the number of pulses the encoder registers between each detent */ -#define ENCODER_RESOLUTION 2 +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/keychron/q2/rev_0113/keymaps/dhertz/keymap.c b/keyboards/keychron/q2/rev_0113/keymaps/dhertz/keymap.c new file mode 100644 index 0000000000..16c2a6d784 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/dhertz/keymap.c @@ -0,0 +1,94 @@ +// Copyright 2022 Dan Hertz (@dhertz) +// SPDX-License-Identifier: GPL-3.0 + +#include QMK_KEYBOARD_H +#include "dhertz.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp|( )| + * |---------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Enter|Del| + * |------------------------------------------------------` |---| + * |SrCtl | A| S| D| F| G| H| J| K| L| ;| '| \| |Hom| + * |---------------------------------------------------------------| + * |Shif| #| Z| X| C| V| B| N| M| ,| .| /|Shift |Up | | + * |---------------------------------------------------------------| + * |NcCtl| Alt| CTab| LyrSpc |CGv|Alt|CSL|Lef|Dow|Rig| + * `---------------------------------------------------------------' + */ + [0] = LAYOUT_iso_68( + KC_ESC, 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_MUTE, + 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_DEL, + SRCH_CTL, 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_HOME, + KC_LSFT, HSH_TLD, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + NC_CTL, KC_LALT, CMD_TAB_CMD, LYR_SPC, CMD_GRV_CMD, KC_RALT, CMD_SFT_ALT_A, KC_LEFT, KC_DOWN, KC_RIGHT + ), + /* Layer 1: Special + * ,---------------------------------------------------------------. + * | ยง| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |( )| + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |------------------------------------------------------` |---| + * | | | | | | | | | |CSL| | | `| | | + * |---------------------------------------------------------------| + * | | `| | |CAC| | | | | | | | |PgU| | + * |---------------------------------------------------------------| + * | | | | | | | |Hom|PgD|End| + * `---------------------------------------------------------------' + */ + [1] = LAYOUT_iso_68( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F10, KC_F11, KC_TRNS, CMD_SFT_A, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CMD_SFT_L, KC_TRNS, KC_TRNS, KC_NUBS, KC_TRNS, KC_END, + KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, CMD_ALT_C, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDOWN, KC_END + ), +}; + +void keyboard_post_init_user(void) { + rgb_matrix_mode(RGB_MATRIX_NONE); + rgb_matrix_set_color_all(RGB_BLACK); +} + +uint32_t cancel_cmd(uint32_t trigger_time, void *cb_arg) { + if (get_highest_layer(layer_state|default_layer_state) > 0) { + return 20; + } + unregister_code(KC_LCMD); + return 0; +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (get_highest_layer(layer_state|default_layer_state) == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } else { + if ((get_mods() & MOD_BIT(KC_LCMD)) != MOD_BIT(KC_LCMD)) { + register_code(KC_LCMD); + defer_exec(20, cancel_cmd, NULL); + } + if (clockwise) { + tap_code(KC_TAB); + } else { + tap_code16(S(KC_TAB)); + } + } + return false; +} + +void rgb_matrix_indicators_kb(void) { + switch(get_highest_layer(layer_state|default_layer_state)) { + case 1: + rgb_matrix_set_color_all(RGB_BLACK); + rgb_matrix_set_color_all(25, 25, 112); + break; + default: + rgb_matrix_set_color_all(RGB_BLACK); + break; + } +} diff --git a/keyboards/keychron/q2/rev_0113/keymaps/dhertz/rules.mk b/keyboards/keychron/q2/rev_0113/keymaps/dhertz/rules.mk new file mode 100644 index 0000000000..199bad85f3 --- /dev/null +++ b/keyboards/keychron/q2/rev_0113/keymaps/dhertz/rules.mk @@ -0,0 +1 @@ +DEFERRED_EXEC_ENABLE = yes -- cgit v1.2.1 From 336791b915f11056ae0f701b1cd5ba18e719c0bb Mon Sep 17 00:00:00 2001 From: Ladduro Date: Fri, 22 Apr 2022 10:21:15 +0300 Subject: Keychron Q2 add Caps Lock indicator and layer RGB (#16641) --- .../keychron/q2/rev_0110/keymaps/ladduro/config.h | 25 ++++++ .../keychron/q2/rev_0110/keymaps/ladduro/keymap.c | 96 ++++++++++++++++++++++ .../q2/rev_0110/keymaps/ladduro/keymap_user.h | 27 ++++++ .../keychron/q2/rev_0110/keymaps/ladduro/readme.md | 29 +++++++ .../q2/rev_0110/keymaps/ladduro/rgb_matrix_user.c | 72 ++++++++++++++++ .../q2/rev_0110/keymaps/ladduro/rgb_matrix_user.h | 25 ++++++ .../keychron/q2/rev_0110/keymaps/ladduro/rules.mk | 5 ++ 7 files changed, 279 insertions(+) create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/config.h create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap.c create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap_user.h create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/readme.md create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.c create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.h create mode 100644 keyboards/keychron/q2/rev_0110/keymaps/ladduro/rules.mk (limited to 'keyboards/keychron') diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/config.h b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/config.h new file mode 100644 index 0000000000..a8ad37d003 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/config.h @@ -0,0 +1,25 @@ +/* Copyright 2022 @ Ionut Micu + * + * 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 + +/* RGB Matrix Configuration */ +#ifdef RGB_MATRIX_ENABLE +# define RGB_DISABLE_WHEN_USB_SUSPENDED +# define CAPS_LOCK_INDICATOR_COLOR RGB_RED +# define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS +# define FN_LAYER_TRANSPARENT_KEYS_OFF +#endif \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap.c b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap.c new file mode 100644 index 0000000000..cc83640b39 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2022 @ Ionut Micu + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_user.h" +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_user.h" +#endif + +enum custom_keycodes { + KC_MISSION_CONTROL = SAFE_RANGE, + KC_LAUNCHPAD +}; + +#define KC_WAVE S(KC_GRV) +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) +#define KC_MCTL KC_MISSION_CONTROL +#define KC_LPAD KC_LAUNCHPAD + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_67( + KC_ESC, 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_INS, + 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_DEL, + 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_HOME, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_ansi_67( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_ansi_67( + KC_WAVE, 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_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD,RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +void matrix_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_init_user(); +#endif +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MISSION_CONTROL: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + case KC_LAUNCHPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; // Skip all further processing of this key + default: + return true; // Process all other keycodes normally + } +} diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap_user.h b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap_user.h new file mode 100644 index 0000000000..ded78ae1b8 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/keymap_user.h @@ -0,0 +1,27 @@ +/* Copyright 2022 @ Ionut Micu + * + * 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 + +// clang-format off + +enum layers{ + MAC_BASE, + WIN_BASE, + _FN1, + _FN2, + _FN3, +}; \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/readme.md b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/readme.md new file mode 100644 index 0000000000..42ca81a1a1 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/readme.md @@ -0,0 +1,29 @@ +# Ladduro keymap for Keychron Q2 (ANSI rev_0110) v1.01 + +This keymap ports Q1 logic (by gtg465x) for RGB caps lock indicator and layer RBG assigned key. + +## Features: +- On macOS, F3 opens Mission Control and F4 opens Launchpad without needing to configure shortcuts in System Preferences +- RGB lighting turns off when the computer sleeps +- Caps Lock and alpha keys turn red to indicate when Caps Lock is on +- When the Fn layer is active, RGB lighting turns off for keys that are not assigned + +Make example for this keyboard (after setting up your build environment): + + make keychron/q2/rev_0110:ladduro + +Flashing example for this keyboard: + + make keychron/q2/rev_0110:ladduro:flash + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Changelog + +### 14/03/2021 - 1. + +- Initial release + +### 02/04/2021 - 1.01 + +- Remove via enable from rules.mk as it breaks the layout for some reason diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.c b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.c new file mode 100644 index 0000000000..19ddd54aa8 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.c @@ -0,0 +1,72 @@ +/* Copyright 2022 @ Ionut Micu + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "rgb_matrix_user.h" +#include "keymap_user.h" + +keypos_t led_index_key_position[DRIVER_LED_TOTAL]; + +void rgb_matrix_init_user(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + uint8_t led_index = g_led_config.matrix_co[row][col]; + if (led_index != NO_LED) { + led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; + } + } + } +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t current_layer = get_highest_layer(layer_state); + switch (current_layer) { + case MAC_BASE: + case WIN_BASE: +#ifdef CAPS_LOCK_INDICATOR_COLOR + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); + } +#endif + break; + case _FN1: + case _FN2: + case _FN3: +#ifdef FN_LAYER_TRANSPARENT_KEYS_OFF + rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, RGB_OFF); +#endif + break; + } +} + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { + for (uint8_t i = led_min; i < led_max; i++) { + uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); + if ((*is_keycode)(keycode)) { + rgb_matrix_set_color(i, red, green, blue); + } + } +} + +bool is_caps_lock_indicator(uint16_t keycode) { +#ifdef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS + return (KC_A <= keycode && keycode <= KC_Z) || keycode == KC_CAPS; +#else + return keycode == KC_CAPS; +#endif +} + +bool is_transparent(uint16_t keycode) { return keycode == KC_TRNS; } \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.h b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.h new file mode 100644 index 0000000000..4d33f483ae --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rgb_matrix_user.h @@ -0,0 +1,25 @@ + +/* Copyright 2022 @ Ionut Micu + * + * 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 + +void rgb_matrix_init_user(void); + +void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); + +bool is_caps_lock_indicator(uint16_t keycode); +bool is_transparent(uint16_t keycode); \ No newline at end of file diff --git a/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rules.mk b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rules.mk new file mode 100644 index 0000000000..c0ee640cd2 --- /dev/null +++ b/keyboards/keychron/q2/rev_0110/keymaps/ladduro/rules.mk @@ -0,0 +1,5 @@ +MOUSEKEY_ENABLE = no + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_matrix_user.c +endif -- cgit v1.2.1