Update something

This commit is contained in:
lalalademaxiya1 2022-11-12 10:09:43 +08:00
parent ace66de98f
commit b0bd8c0945
33 changed files with 408 additions and 479 deletions

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys

View File

@ -35,6 +35,13 @@
#define DRIVER_ADDR_1 0b1110111
#define DRIVER_ADDR_2 0b1110100
/* Increase I2C speed to 1000 KHz */
#define I2C1_TIMINGR_PRESC 0U
#define I2C1_TIMINGR_SCLDEL 3U
#define I2C1_TIMINGR_SDADEL 0U
#define I2C1_TIMINGR_SCLH 15U
#define I2C1_TIMINGR_SCLL 30U
/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in CKLED2001.h) */
#define SCAN_PHASE_CHANNEL MSKPHASE_9CHANNEL
#define CKLED2001_CURRENT_TUNE \
@ -67,7 +74,7 @@
// #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_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
@ -79,12 +86,12 @@
#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_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_RAIN
// #define ENABLE_RGB_MATRIX_PIXEL_FLOW
// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
@ -92,18 +99,20 @@
#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
// #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_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_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
// #define RGB_MATRIX_KEYPRESSES
// #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES
/* Enable receive custom command from host */
#define RAW_HID_CMD 0xAB

View File

@ -65,11 +65,15 @@ static uint8_t light_brightness_get(void) {
return value;
}
void rgb_matrix_indicators_kb(void) {
bool rgb_matrix_indicators_kb(void) {
if (rgb_matrix_indicators_user()) {
return false;
}
if (host_keyboard_led_state().caps_lock) {
uint8_t v = light_brightness_get();
rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, v, v, v); // white, with the adjusted brightness
}
return true;
}
void rgb_matrix_indicators_none_kb(void) {

View File

@ -19,7 +19,7 @@
/* RGB Matrix Configuration */
#define DRIVER_1_LED_TOTAL 37
#define DRIVER_2_LED_TOTAL 35
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 32

View File

@ -6,87 +6,87 @@
"usb": {
"vid": "0x3434",
"pid": "0x0170",
"device_version": "1.0.5"
"device_version": "1.0.6"
},
"layouts": {
"LAYOUT_ansi_72": {
"layout": [
{"label":"Esc", "x":0, "y":0},
{"label":"1!", "x":1, "y":0},
{"label":"2@", "x":2, "y":0},
{"label":"3#", "x":3, "y":0},
{"label":"4$", "x":4, "y":0},
{"label":"5%", "x":5, "y":0},
{"label":"6^", "x":6, "y":0},
{"label":"7&", "x":7, "y":0},
{"label":"8*", "x":8, "y":0},
{"label":"9(", "x":9, "y":0},
{"label":"0)", "x":10, "y":0},
{"label":"-_", "x":11, "y":0},
{"label":"=+", "x":12, "y":0},
{"label":"Backspace", "x":13, "y":0, "w":2},
{"label":"Insert", "x":15, "y":0},
{"label":"Light", "x":16, "y":0},
{"matrix":[0, 0], "x":0, "y":0},
{"matrix":[0, 1], "x":1, "y":0},
{"matrix":[0, 2], "x":2, "y":0},
{"matrix":[0, 3], "x":3, "y":0},
{"matrix":[0, 4], "x":4, "y":0},
{"matrix":[0, 5], "x":5, "y":0},
{"matrix":[0, 6], "x":6, "y":0},
{"matrix":[0, 7], "x":7, "y":0},
{"matrix":[0, 8], "x":8, "y":0},
{"matrix":[0, 9], "x":9, "y":0},
{"matrix":[0,10], "x":10, "y":0},
{"matrix":[0,11], "x":11, "y":0},
{"matrix":[0,12], "x":12, "y":0},
{"matrix":[0,13], "x":13, "y":0, "w":2},
{"matrix":[0,14], "x":15, "y":0},
{"matrix":[0,15], "x":16, "y":0},
{"label":"Tab", "x":0, "y":1, "w":1.5},
{"label":"Q", "x":1.5, "y":1},
{"label":"W", "x":2.5, "y":1},
{"label":"E", "x":3.5, "y":1},
{"label":"R", "x":4.5, "y":1},
{"label":"T", "x":5.5, "y":1},
{"label":"Y", "x":6.5, "y":1},
{"label":"U", "x":7.5, "y":1},
{"label":"I", "x":8.5, "y":1},
{"label":"O", "x":9.5, "y":1},
{"label":"P", "x":10.5, "y":1},
{"label":"[{", "x":11.5, "y":1},
{"label":"]}", "x":12.5, "y":1},
{"label":"\\|", "x":13.5, "y":1, "w":1.5},
{"label":"End", "x":15, "y":1},
{"label":"Delete", "x":16, "y":1},
{"matrix":[1, 0], "x":0, "y":1, "w":1.5},
{"matrix":[1, 1], "x":1.5, "y":1},
{"matrix":[1, 2], "x":2.5, "y":1},
{"matrix":[1, 3], "x":3.5, "y":1},
{"matrix":[1, 4], "x":4.5, "y":1},
{"matrix":[1, 5], "x":5.5, "y":1},
{"matrix":[1, 6], "x":6.5, "y":1},
{"matrix":[1, 7], "x":7.5, "y":1},
{"matrix":[1, 8], "x":8.5, "y":1},
{"matrix":[1, 9], "x":9.5, "y":1},
{"matrix":[1,10], "x":10.5, "y":1},
{"matrix":[1,11], "x":11.5, "y":1},
{"matrix":[1,12], "x":12.5, "y":1},
{"matrix":[1,13], "x":13.5, "y":1, "w":1.5},
{"matrix":[1,14], "x":15, "y":1},
{"matrix":[1,15], "x":16, "y":1},
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
{"label":"A", "x":1.75, "y":2},
{"label":"S", "x":2.75, "y":2},
{"label":"D", "x":3.75, "y":2},
{"label":"F", "x":4.75, "y":2},
{"label":"G", "x":5.75, "y":2},
{"label":"H", "x":6.75, "y":2},
{"label":"J", "x":7.75, "y":2},
{"label":"K", "x":8.75, "y":2},
{"label":"L", "x":9.75, "y":2},
{"label":";:", "x":10.75, "y":2},
{"label":"'\"", "x":11.75, "y":2},
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
{"label":"Home", "x":15, "y":2},
{"label":"Pgup", "x":16, "y":2},
{"matrix":[2, 0], "x":0, "y":2, "w":1.75},
{"matrix":[2, 1], "x":1.75, "y":2},
{"matrix":[2, 2], "x":2.75, "y":2},
{"matrix":[2, 3], "x":3.75, "y":2},
{"matrix":[2, 4], "x":4.75, "y":2},
{"matrix":[2, 5], "x":5.75, "y":2},
{"matrix":[2, 6], "x":6.75, "y":2},
{"matrix":[2, 7], "x":7.75, "y":2},
{"matrix":[2, 8], "x":8.75, "y":2},
{"matrix":[2, 9], "x":9.75, "y":2},
{"matrix":[2,10], "x":10.75, "y":2},
{"matrix":[2,11], "x":11.75, "y":2},
{"matrix":[2,13], "x":12.75, "y":2, "w":2.25},
{"matrix":[2,14], "x":15, "y":2},
{"matrix":[2,15], "x":16, "y":2},
{"label":"Shift", "x":0, "y":3, "w":2.25},
{"label":"Z", "x":2.25, "y":3},
{"label":"X", "x":3.25, "y":3},
{"label":"C", "x":4.25, "y":3},
{"label":"V", "x":5.25, "y":3},
{"label":"B", "x":6.25, "y":3},
{"label":"N", "x":7.25, "y":3},
{"label":"M", "x":8.25, "y":3},
{"label":",<", "x":9.25, "y":3},
{"label":".>", "x":10.25, "y":3},
{"label":"/?", "x":11.25, "y":3},
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
{"label":"Up", "x":15, "y":3},
{"label":"Pgdn", "x":16, "y":3},
{"matrix":[3, 0], "x":0, "y":3, "w":2.25},
{"matrix":[3, 2], "x":2.25, "y":3},
{"matrix":[3, 3], "x":3.25, "y":3},
{"matrix":[3, 4], "x":4.25, "y":3},
{"matrix":[3, 5], "x":5.25, "y":3},
{"matrix":[3, 6], "x":6.25, "y":3},
{"matrix":[3, 7], "x":7.25, "y":3},
{"matrix":[3, 8], "x":8.25, "y":3},
{"matrix":[3, 9], "x":9.25, "y":3},
{"matrix":[3,10], "x":10.25, "y":3},
{"matrix":[3,11], "x":11.25, "y":3},
{"matrix":[3,13], "x":12.25, "y":3, "w":2.75},
{"matrix":[3,14], "x":15, "y":3},
{"matrix":[3,15], "x":16, "y":3},
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
{"label":"Win", "x":1.25, "y":4, "w":1.25},
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
{"label":"Space", "x":3.75, "y":4, "w":6.25},
{"label":"Alt", "x":10, "y":4},
{"label":"Ctrl", "x":11, "y":4},
{"label":"Fn1", "x":12, "y":4},
{"label":"Fn2", "x":13, "y":4},
{"label":"Left", "x":14, "y":4},
{"label":"Down", "x":15, "y":4},
{"label":"Right", "x":16, "y":4}
{"matrix":[4, 0], "x":0, "y":4, "w":1.25},
{"matrix":[4, 1], "x":1.25, "y":4, "w":1.25},
{"matrix":[4, 2], "x":2.5, "y":4, "w":1.25},
{"matrix":[4, 6], "x":3.75, "y":4, "w":6.25},
{"matrix":[4, 9], "x":10, "y":4},
{"matrix":[4,10], "x":11, "y":4},
{"matrix":[4,11], "x":12, "y":4},
{"matrix":[4,12], "x":13, "y":4},
{"matrix":[4,13], "x":14, "y":4},
{"matrix":[4,14], "x":15, "y":4},
{"matrix":[4,15], "x":16, "y":4}
]
}
}

View File

@ -26,27 +26,8 @@ enum layers{
_FN3
};
enum custom_keycodes {
KC_MISSION_CONTROL = SAFE_RANGE,
KC_LAUNCHPAD,
KC_TASK_VIEW,
KC_FILE_EXPLORER
};
#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK KC_TASK_VIEW
#define KC_FLXP KC_FILE_EXPLORER
typedef struct PACKED {
uint8_t len;
uint8_t keycode[2];
} key_combination_t;
key_combination_t key_comb_list[2] = {
{2, {KC_LWIN, KC_TAB}},
{2, {KC_LWIN, KC_E}}
};
#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_ansi_72(
@ -64,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_ansi_72(
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, _______, _______, RGB_TOG,
KC_GRV, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
@ -84,38 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MCTL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LPAD:
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:
case KC_FLXP:
if (record->event.pressed) {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
register_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
} else {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
unregister_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}

View File

@ -1 +0,0 @@
SRC += factory/secondary/q2/test.c

View File

@ -0,0 +1,96 @@
/* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "keychron_common.h"
// clang-format off
enum layers{
MAC_BASE,
WIN_BASE,
_FN1,
_FN2,
_FN3
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_ansi_72(
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, RGB_MOD,
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_END, 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_PGUP,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[WIN_BASE] = LAYOUT_ansi_72(
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, RGB_MOD,
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_END, 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_PGUP,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_ansi_72(
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, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_FN2] = LAYOUT_ansi_72(
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, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_FN3] = LAYOUT_ansi_72(
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
void housekeeping_task_user(void) {
housekeeping_task_keychron();
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_keychron(keycode, record)) {
return false;
}
return true;
}
#ifdef RAW_ENABLE
bool dip_switch_update_user(uint8_t index, bool active) {
if (!dip_switch_update_keychron(index, active)) {
return false;
}
return true;
}
#endif // RAW_ENABLE
#ifdef RGB_MATRIX_ENABLE
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) {
return false;
}
return true;
}
#endif // RGB_MATRIX_ENABLE

View File

@ -0,0 +1,5 @@
VIA_ENABLE = yes
VPATH += keyboards/keychron/common
SRC += keychron_common.c
SRC += keychron_factory_test_common.c

View File

@ -26,33 +26,8 @@ enum layers{
_FN3
};
enum custom_keycodes {
KC_MISSION_CONTROL = USER00,
KC_LAUNCHPAD,
KC_LOPTN,
KC_ROPTN,
KC_LCMMD,
KC_RCMMD,
KC_TASK_VIEW,
KC_FILE_EXPLORER
};
#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK KC_TASK_VIEW
#define KC_FLXP KC_FILE_EXPLORER
typedef struct PACKED {
uint8_t len;
uint8_t keycode[2];
} key_combination_t;
key_combination_t key_comb_list[2] = {
{2, {KC_LWIN, KC_TAB}},
{2, {KC_LWIN, KC_E}}
};
static uint8_t mac_keycode[4] = { KC_LOPT, KC_ROPT, KC_LCMD, KC_RCMD };
#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_ansi_72(
@ -60,17 +35,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_END, 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_PGUP,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[WIN_BASE] = LAYOUT_ansi_72(
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, RGB_MOD,
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_END, 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_PGUP,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_ansi_72(
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, _______, _______, RGB_TOG,
KC_GRV, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
@ -90,48 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MCTL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LOPTN:
case KC_ROPTN:
case KC_LCMMD:
case KC_RCMMD:
if (record->event.pressed) {
register_code(mac_keycode[keycode - KC_LOPTN]);
} else {
unregister_code(mac_keycode[keycode - KC_LOPTN]);
}
return false; // Skip all further processing of this key
case KC_TASK:
case KC_FLXP:
if (record->event.pressed) {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
register_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
} else {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
unregister_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}

View File

@ -1,2 +1 @@
VIA_ENABLE = yes
SRC += factory/secondary/q2/test.c

View File

@ -18,7 +18,9 @@
#ifdef RGB_MATRIX_ENABLE
const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = {
// clang-format off
const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to CKLED manual for these locations
* driver
* | R location
@ -126,7 +128,7 @@ led_config_t g_led_config = {
// RGB LED Index to Flag
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
}

View File

@ -17,19 +17,3 @@
#pragma once
#include "quantum.h"
#define XXX KC_NO
#define LAYOUT_ansi_72( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, K2F, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \
K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E, K2F }, \
{ K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, K3F }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, K49, K4A, K4B, K4C, K4D, K4E, K4F } \
}

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
@ -20,7 +20,6 @@ DIP_SWITCH_ENABLE = yes
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = CKLED2001
RAW_ENABLE = yes
LTO_ENABLE = yes
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash

View File

@ -19,7 +19,7 @@
/* RGB Matrix Configuration */
#define DRIVER_1_LED_TOTAL 37
#define DRIVER_2_LED_TOTAL 36
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
/* Enable caps-lock LED */
#define CAPS_LOCK_LED_INDEX 31

View File

@ -6,88 +6,88 @@
"usb": {
"vid": "0x3434",
"pid": "0x0172",
"device_version": "1.0.3"
"device_version": "1.0.4"
},
"layouts": {
"LAYOUT_iso_73": {
"layout": [
{"label":"Esc", "x":0, "y":0},
{"label":"1!", "x":1, "y":0},
{"label":"2@", "x":2, "y":0},
{"label":"3#", "x":3, "y":0},
{"label":"4$", "x":4, "y":0},
{"label":"5%", "x":5, "y":0},
{"label":"6^", "x":6, "y":0},
{"label":"7&", "x":7, "y":0},
{"label":"8*", "x":8, "y":0},
{"label":"9(", "x":9, "y":0},
{"label":"0)", "x":10, "y":0},
{"label":"-_", "x":11, "y":0},
{"label":"=+", "x":12, "y":0},
{"label":"Backspace", "x":13, "y":0, "w":2},
{"label":"Insert", "x":15, "y":0},
{"label":"RMOD", "x":16, "y":0},
{"matrix":[0, 0], "x":0, "y":0},
{"matrix":[0, 1], "x":1, "y":0},
{"matrix":[0, 2], "x":2, "y":0},
{"matrix":[0, 3], "x":3, "y":0},
{"matrix":[0, 4], "x":4, "y":0},
{"matrix":[0, 5], "x":5, "y":0},
{"matrix":[0, 6], "x":6, "y":0},
{"matrix":[0, 7], "x":7, "y":0},
{"matrix":[0, 8], "x":8, "y":0},
{"matrix":[0, 9], "x":9, "y":0},
{"matrix":[0,10], "x":10, "y":0},
{"matrix":[0,11], "x":11, "y":0},
{"matrix":[0,12], "x":12, "y":0},
{"matrix":[0,13], "x":13, "y":0, "w":2},
{"matrix":[0,14], "x":15, "y":0},
{"matrix":[0,15], "x":16, "y":0},
{"label":"Tab", "x":0, "y":1, "w":1.5},
{"label":"Q", "x":1.5, "y":1},
{"label":"W", "x":2.5, "y":1},
{"label":"E", "x":3.5, "y":1},
{"label":"R", "x":4.5, "y":1},
{"label":"T", "x":5.5, "y":1},
{"label":"Y", "x":6.5, "y":1},
{"label":"U", "x":7.5, "y":1},
{"label":"I", "x":8.5, "y":1},
{"label":"O", "x":9.5, "y":1},
{"label":"P", "x":10.5, "y":1},
{"label":"[{", "x":11.5, "y":1},
{"label":"]}", "x":12.5, "y":1},
{"label":"End", "x":15, "y":1},
{"label":"Delete", "x":16, "y":1},
{"matrix":[1, 0], "x":0, "y":1, "w":1.5},
{"matrix":[1, 1], "x":1.5, "y":1},
{"matrix":[1, 2], "x":2.5, "y":1},
{"matrix":[1, 3], "x":3.5, "y":1},
{"matrix":[1, 4], "x":4.5, "y":1},
{"matrix":[1, 5], "x":5.5, "y":1},
{"matrix":[1, 6], "x":6.5, "y":1},
{"matrix":[1, 7], "x":7.5, "y":1},
{"matrix":[1, 8], "x":8.5, "y":1},
{"matrix":[1, 9], "x":9.5, "y":1},
{"matrix":[1,10], "x":10.5, "y":1},
{"matrix":[1,11], "x":11.5, "y":1},
{"matrix":[1,12], "x":12.5, "y":1},
{"matrix":[1,14], "x":15, "y":1},
{"matrix":[1,15], "x":16, "y":1},
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
{"label":"A", "x":1.75, "y":2},
{"label":"S", "x":2.75, "y":2},
{"label":"D", "x":3.75, "y":2},
{"label":"F", "x":4.75, "y":2},
{"label":"G", "x":5.75, "y":2},
{"label":"H", "x":6.75, "y":2},
{"label":"J", "x":7.75, "y":2},
{"label":"K", "x":8.75, "y":2},
{"label":"L", "x":9.75, "y":2},
{"label":";:", "x":10.75, "y":2},
{"label":"'\"", "x":11.75, "y":2},
{"label":"#~", "x":12.75, "y":2},
{"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2},
{"label":"Home", "x":15, "y":2},
{"label":"Pgup", "x":16, "y":2},
{"matrix":[2, 0], "x":0, "y":2, "w":1.75},
{"matrix":[2, 1], "x":1.75, "y":2},
{"matrix":[2, 2], "x":2.75, "y":2},
{"matrix":[2, 3], "x":3.75, "y":2},
{"matrix":[2, 4], "x":4.75, "y":2},
{"matrix":[2, 5], "x":5.75, "y":2},
{"matrix":[2, 6], "x":6.75, "y":2},
{"matrix":[2, 7], "x":7.75, "y":2},
{"matrix":[2, 8], "x":8.75, "y":2},
{"matrix":[2, 9], "x":9.75, "y":2},
{"matrix":[2,10], "x":10.75, "y":2},
{"matrix":[2,11], "x":11.75, "y":2},
{"matrix":[2,13], "x":12.75, "y":2},
{"matrix":[1,13], "x":13.75, "y":1, "w":1.25, "h":2},
{"matrix":[2,14], "x":15, "y":2},
{"matrix":[2,15], "x":16, "y":2},
{"label":"Shift", "x":0, "y":3, "w":1.25},
{"label":"\\|", "x":1.25, "y":3},
{"label":"Z", "x":2.25, "y":3},
{"label":"X", "x":3.25, "y":3},
{"label":"C", "x":4.25, "y":3},
{"label":"V", "x":5.25, "y":3},
{"label":"B", "x":6.25, "y":3},
{"label":"N", "x":7.25, "y":3},
{"label":"M", "x":8.25, "y":3},
{"label":",<", "x":9.25, "y":3},
{"label":".>", "x":10.25, "y":3},
{"label":"/?", "x":11.25, "y":3},
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
{"label":"Up", "x":15, "y":3},
{"label":"Pgdn", "x":16, "y":3},
{"matrix":[3, 0], "x":0, "y":3, "w":1.25},
{"matrix":[3, 1], "x":1.25, "y":3},
{"matrix":[3, 2], "x":2.25, "y":3},
{"matrix":[3, 3], "x":3.25, "y":3},
{"matrix":[3, 4], "x":4.25, "y":3},
{"matrix":[3, 5], "x":5.25, "y":3},
{"matrix":[3, 6], "x":6.25, "y":3},
{"matrix":[3, 7], "x":7.25, "y":3},
{"matrix":[3, 8], "x":8.25, "y":3},
{"matrix":[3, 9], "x":9.25, "y":3},
{"matrix":[3,10], "x":10.25, "y":3},
{"matrix":[3,11], "x":11.25, "y":3},
{"matrix":[3,13], "x":12.25, "y":3, "w":2.75},
{"matrix":[3,14], "x":15, "y":3},
{"matrix":[3,15], "x":16, "y":3},
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
{"label":"Win", "x":1.25, "y":4, "w":1.25},
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
{"label":"Space", "x":3.75, "y":4, "w":6.25},
{"label":"Alt", "x":10, "y":4},
{"label":"Ctrl", "x":11, "y":4},
{"label":"Fn1", "x":12, "y":4},
{"label":"Fn2", "x":13, "y":4},
{"label":"Left", "x":14, "y":4},
{"label":"Down", "x":15, "y":4},
{"label":"Right", "x":16, "y":4}
{"matrix":[4, 0], "x":0, "y":4, "w":1.25},
{"matrix":[4, 1], "x":1.25, "y":4, "w":1.25},
{"matrix":[4, 2], "x":2.5, "y":4, "w":1.25},
{"matrix":[4, 6], "x":3.75, "y":4, "w":6.25},
{"matrix":[4, 9], "x":10, "y":4},
{"matrix":[4,10], "x":11, "y":4},
{"matrix":[4,11], "x":12, "y":4},
{"matrix":[4,12], "x":13, "y":4},
{"matrix":[4,13], "x":14, "y":4},
{"matrix":[4,14], "x":15, "y":4},
{"matrix":[4,15], "x":16, "y":4}
]
}
}

View File

@ -26,27 +26,8 @@ enum layers{
_FN3
};
enum custom_keycodes {
KC_MISSION_CONTROL = SAFE_RANGE,
KC_LAUNCHPAD,
KC_TASK_VIEW,
KC_FILE_EXPLORER
};
#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK KC_TASK_VIEW
#define KC_FLXP KC_FILE_EXPLORER
typedef struct PACKED {
uint8_t len;
uint8_t keycode[2];
} key_combination_t;
key_combination_t key_comb_list[2] = {
{2, {KC_LWIN, KC_TAB}},
{2, {KC_LWIN, KC_E}}
};
#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_iso_73(
@ -64,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_iso_73(
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, _______, _______, RGB_TOG,
KC_GRV, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
@ -84,38 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MCTL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LPAD:
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:
case KC_FLXP:
if (record->event.pressed) {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
register_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
} else {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
unregister_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}

View File

@ -1 +0,0 @@
SRC += factory/secondary/q2/test.c

View File

@ -0,0 +1,96 @@
/* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "keychron_common.h"
// clang-format off
enum layers{
MAC_BASE,
WIN_BASE,
_FN1,
_FN2,
_FN3
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_iso_73(
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, RGB_MOD,
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_END, 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_PGUP,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[WIN_BASE] = LAYOUT_iso_73(
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, RGB_MOD,
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_END, 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_PGUP,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_iso_73(
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, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_FN2] = LAYOUT_iso_73(
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, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_FN3] = LAYOUT_iso_73(
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
void housekeeping_task_user(void) {
housekeeping_task_keychron();
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_record_keychron(keycode, record)) {
return false;
}
return true;
}
#ifdef RAW_ENABLE
bool dip_switch_update_user(uint8_t index, bool active) {
if (!dip_switch_update_keychron(index, active)) {
return false;
}
return true;
}
#endif // RAW_ENABLE
#ifdef RGB_MATRIX_ENABLE
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) {
return false;
}
return true;
}
#endif // RGB_MATRIX_ENABLE

View File

@ -0,0 +1,5 @@
VIA_ENABLE = yes
VPATH += keyboards/keychron/common
SRC += keychron_common.c
SRC += keychron_factory_test_common.c

View File

@ -26,33 +26,8 @@ enum layers{
_FN3
};
enum custom_keycodes {
KC_MISSION_CONTROL = USER00,
KC_LAUNCHPAD,
KC_LOPTN,
KC_ROPTN,
KC_LCMMD,
KC_RCMMD,
KC_TASK_VIEW,
KC_FILE_EXPLORER
};
#define KC_MCTL KC_MISSION_CONTROL
#define KC_LPAD KC_LAUNCHPAD
#define KC_TASK KC_TASK_VIEW
#define KC_FLXP KC_FILE_EXPLORER
typedef struct PACKED {
uint8_t len;
uint8_t keycode[2];
} key_combination_t;
key_combination_t key_comb_list[2] = {
{2, {KC_LWIN, KC_TAB}},
{2, {KC_LWIN, KC_E}}
};
static uint8_t mac_keycode[4] = { KC_LOPT, KC_ROPT, KC_LCMD, KC_RCMD };
#define KC_TASK LGUI(KC_TAB)
#define KC_FLXP LGUI(KC_E)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_iso_73(
@ -60,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_END, 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_PGUP,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, KC_RCTL, MO(_FN1), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[WIN_BASE] = LAYOUT_iso_73(
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, RGB_MOD,
@ -70,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(_FN2), MO(_FN3), KC_LEFT, KC_DOWN, KC_RGHT),
[_FN1] = LAYOUT_iso_73(
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, _______, _______, RGB_TOG,
KC_GRV, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______,
@ -90,48 +65,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
};
// clang-format on
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_MCTL:
if (record->event.pressed) {
host_consumer_send(0x29F);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LPAD:
if (record->event.pressed) {
host_consumer_send(0x2A0);
} else {
host_consumer_send(0);
}
return false; // Skip all further processing of this key
case KC_LOPTN:
case KC_ROPTN:
case KC_LCMMD:
case KC_RCMMD:
if (record->event.pressed) {
register_code(mac_keycode[keycode - KC_LOPTN]);
} else {
unregister_code(mac_keycode[keycode - KC_LOPTN]);
}
return false; // Skip all further processing of this key
case KC_TASK:
case KC_FLXP:
if (record->event.pressed) {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
register_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
} else {
for (uint8_t i = 0; i < key_comb_list[keycode - KC_TASK].len; i++) {
unregister_code(key_comb_list[keycode - KC_TASK].keycode[i]);
}
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}

View File

@ -1,2 +1 @@
VIA_ENABLE = yes
SRC += factory/secondary/q2/test.c

View File

@ -18,7 +18,7 @@
#ifdef RGB_MATRIX_ENABLE
const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = {
const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
/* Refer to CKLED manual for these locations
* driver
* | R location
@ -127,7 +127,7 @@ led_config_t g_led_config = {
// RGB LED Index to Flag
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
}

View File

@ -17,19 +17,3 @@
#pragma once
#include "quantum.h"
#define XXX KC_NO
#define LAYOUT_iso_73( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K1D, K2E, K2F, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \
K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4E, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E, K3F }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, K49, K4A, K4B, K4C, K4D, K4E, K4F } \
}

View File

@ -5,7 +5,7 @@ MCU = STM32L432
BOOTLOADER = stm32-dfu
# Build Options
# change yes to no to disable.
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
@ -20,10 +20,8 @@ DIP_SWITCH_ENABLE = yes
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = CKLED2001
RAW_ENABLE = yes
LTO_ENABLE = yes
EEPROM_DRIVER = wear_leveling
WEAR_LEVELING_DRIVER = embedded_flash
# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

View File

@ -17,4 +17,3 @@ Flashing example for this keyboard ([after setting up the bootloadHID flashing e
**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).