Skip to content

Commit

Permalink
The goods
Browse files Browse the repository at this point in the history
  • Loading branch information
Phara0h committed Oct 2, 2023
1 parent 00af20f commit d743276
Show file tree
Hide file tree
Showing 21 changed files with 550 additions and 42 deletions.
7 changes: 7 additions & 0 deletions builddefs/common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,13 @@ ifeq ($(strip $(LED_TABLES)), yes)
SRC += $(QUANTUM_DIR)/led_tables.c
endif

ifeq ($(strip $(OPENRGB_ENABLE)), yes)

RAW_ENABLE := yes
SRC += $(QUANTUM_DIR)/openrgb.c
OPT_DEFS += -DOPENRGB_ENABLE
endif

ifeq ($(strip $(VIA_ENABLE)), yes)
DYNAMIC_KEYMAP_ENABLE := yes
RAW_ENABLE := yes
Expand Down
3 changes: 2 additions & 1 deletion builddefs/show_options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ BUILD_OPTION_NAMES = \
SPLIT_KEYBOARD \
DYNAMIC_KEYMAP_ENABLE \
USB_HID_ENABLE \
OPENRGB_ENABLE \
VIA_ENABLE

HARDWARE_OPTION_NAMES = \
SLEEP_LED_ENABLE \
BACKLIGHT_ENABLE \
Expand Down
30 changes: 2 additions & 28 deletions keyboards/keychron/bluetooth/indicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,25 +477,7 @@ void indicator_task(void) {

#if defined(LED_MATRIX_ENABLE) || defined(RGB_MATRIX_ENABLE)
__attribute__((weak)) void os_state_indicate(void) {
# if defined(NUM_LOCK_INDEX)
if (host_keyboard_led_state().num_lock) {
SET_LED_ON(NUM_LOCK_INDEX);
}
# endif
# if defined(CAPS_LOCK_INDEX)
if (host_keyboard_led_state().caps_lock) {
# if defined(DIM_CAPS_LOCK)
SET_LED_OFF(CAPS_LOCK_INDEX);
# else
SET_LED_ON(CAPS_LOCK_INDEX);
# endif
}
# endif
# if defined(SCROLL_LOCK_INDEX)
if (host_keyboard_led_state().scroll_lock) {
SET_LED_ON(SCROLL_LOCK_INDEX);
}
# endif

# if defined(COMPOSE_LOCK_INDEX)
if (host_keyboard_led_state().compose) {
SET_LED_ON(COMPOSE_LOCK_INDEX);
Expand Down Expand Up @@ -585,15 +567,7 @@ void LED_NONE_INDICATORS_KB(void) {

# if defined(LED_MATRIX_DRIVER_SHUTDOWN_ENABLE) || defined(RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE)
bool LED_DRIVER_ALLOW_SHUTDOWN(void) {
# if defined(NUM_LOCK_INDEX)
if (host_keyboard_led_state().num_lock) return false;
# endif
# if defined(CAPS_LOCK_INDEX) && !defined(DIM_CAPS_LOCK)
if (host_keyboard_led_state().caps_lock) return false;
# endif
# if defined(SCROLL_LOCK_INDEX)
if (host_keyboard_led_state().scroll_lock) return false;
# endif

# if defined(COMPOSE_LOCK_INDEX)
if (host_keyboard_led_state().compose) return false;
# endif
Expand Down
23 changes: 21 additions & 2 deletions keyboards/keychron/q6_pro/ansi_encoder/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum layers{
WIN_FN,
};

#define SWITCH_MODE 0x1688

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_109_ansi(
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_MUTE, KC_SNAP, KC_SIRI, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16,
Expand All @@ -35,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_FN] = LAYOUT_109_ansi(
_______, 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_TOG, _______, _______, _______, _______,
_______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, SWITCH_MODE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
Expand All @@ -49,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[WIN_FN] = LAYOUT_109_ansi(
_______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, RGB_TOG, _______, _______, RGB_TOG, _______, _______, _______, _______,
_______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, SWITCH_MODE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
Expand All @@ -63,3 +65,20 @@ const uint16_t PROGMEM encoder_map[][1][2] = {
[WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }
};
#endif // ENCODER_MAP_ENABLE

extern uint8_t is_orgb_mode;

bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode) {
case SWITCH_MODE:
#ifdef OPENRGB_ENABLE
if (record->event.pressed) {
is_orgb_mode = !is_orgb_mode;
}
#endif
return false;
}

return true;
}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ENCODER_MAP_ENABLE = yes
OPENRGB_ENABLE = yes
RGB_MATRIX_ENABLE = yes
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
23 changes: 21 additions & 2 deletions keyboards/keychron/q6_pro/ansi_encoder/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum layers{
WIN_FN,
};

#define SWITCH_MODE 0x1688

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_BASE] = LAYOUT_109_ansi(
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_MUTE, KC_SNAP, KC_SIRI, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16,
Expand All @@ -35,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[MAC_FN] = LAYOUT_109_ansi(
_______, 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_TOG, _______, _______, _______, _______,
_______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, SWITCH_MODE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
Expand All @@ -49,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[WIN_FN] = LAYOUT_109_ansi(
_______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, RGB_TOG, _______, _______, RGB_TOG, _______, _______, _______, _______,
_______, BT_HST1, BT_HST2, BT_HST3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, SWITCH_MODE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
Expand All @@ -63,3 +65,20 @@ const uint16_t PROGMEM encoder_map[][1][2] = {
[WIN_FN] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }
};
#endif // ENCODER_MAP_ENABLE

extern uint8_t is_orgb_mode;

bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode) {
case SWITCH_MODE:
#ifdef OPENRGB_ENABLE
if (record->event.pressed) {
is_orgb_mode = !is_orgb_mode;
}
#endif
return false;
}

return true;
}
3 changes: 2 additions & 1 deletion keyboards/keychron/q6_pro/ansi_encoder/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
OPENRGB_ENABLE = yes
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes
ENCODER_MAP_ENABLE = yes
2 changes: 1 addition & 1 deletion keyboards/keychron/q6_pro/ansi_encoder/rules.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This file intentionally left blank
# This file intentionally left blankOPENRGB_ENABLE = yes
3 changes: 2 additions & 1 deletion keyboards/keychron/q6_pro/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"solid_reactive_multiwide": true,
"solid_reactive_multinexus": true,
"splash": true,
"solid_splash": true
"solid_splash": true,
"openrgb_direct": true
}
},
"matrix_pins": {
Expand Down
1 change: 1 addition & 0 deletions keyboards/keychron/q6_pro/q6_pro.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,4 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
}
}
#endif

1 change: 1 addition & 0 deletions keyboards/keychron/q6_pro/q6_pro.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once

#include "quantum.h"

#ifdef VIA_ENABLE
# include "via.h"
#endif
Expand Down
1 change: 1 addition & 0 deletions keyboards/keychron/q6_pro/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Enter lower-power sleep mode when on the ChibiOS idle thread

OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
OPT_DEFS += -DNO_USB_STARTUP_CHECK -DENABLE_FACTORY_TEST

Expand Down
Loading

0 comments on commit d743276

Please sign in to comment.