1
0

Separate RGBLight/RGB Matrix keycode handling (#23679)

* Separate RGBLight/RGB Matrix keycode handling

* Remove `_DISABLE_KEYCODES` handling

* Update RGB Matrix keycode docs

* Update underglow keycodes for previously migrated boards

* Update keycodes for boards with custom handling

* Fix typos

* Fix bad merge
This commit is contained in:
Ryan
2024-10-13 03:43:50 +11:00
committed by GitHub
parent 5c97a78ce6
commit 6fa11bf219
267 changed files with 1228 additions and 2276 deletions

View File

@@ -18,21 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLIGHT_DI_PIN E6
#define RGB_MATRIX_DISABLE_KEYCODES
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

View File

@@ -18,13 +18,13 @@
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_MUTE, KC_MPLY, R_M_TOG, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, MO(1)
KC_MUTE, KC_MPLY, RM_TOGG, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, MO(1)
),
[1] = LAYOUT(
QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, MO(2), _______
QK_BOOT, _______, UG_TOGG, UG_NEXT, UG_HUEU, UG_HUED, UG_SATU, UG_SATD, UG_VALU, UG_VALD, MO(2), _______
),
[2] = LAYOUT(
QK_BOOT, _______, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______, _______
QK_BOOT, _______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, RM_VALU, RM_VALD, _______, _______
)
};
// clang-format on

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "loop.h"
#include "quantum.h"
#if defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {

View File

@@ -1,20 +0,0 @@
/* Copyright 2021 Work Louder
*
* 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/>.
*/
#pragma once
#include "quantum.h"
#include "rgb_functions.h"

View File

@@ -3,22 +3,9 @@
#pragma once
#define RGB_MATRIX_DISABLE_KEYCODES
#define RGBLIGHT_DI_PIN D2
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define WORK_LOUDER_LED_PIN_1 B6
#define WORK_LOUDER_LED_PIN_2 B7
#define WORK_LOUDER_LED_PIN_3 B5

View File

@@ -18,21 +18,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define RGBLIGHT_DI_PIN C7
#define RGB_MATRIX_DISABLE_KEYCODES
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nano.h"
#include "quantum.h"
#if defined(ENCODER_ENABLE)
bool encoder_update_kb(uint8_t index, bool clockwise) {

View File

@@ -1,20 +0,0 @@
/* Copyright 2021 Drashna Jael're
*
* 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/>.
*/
#pragma once
#include "quantum.h"
#include "rgb_functions.h"

View File

@@ -3,23 +3,5 @@
#pragma once
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define RGB_MATRIX_DISABLE_KEYCODES
#define RGBLIGHT_DI_PIN D2
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9

View File

@@ -14,10 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rgb_functions.h"
#include <stdint.h>
#include "quantum.h"
#include "action.h"
#include "rgblight.h"
#include "rgb_matrix.h"
@@ -39,44 +35,3 @@ const rgblight_driver_t rgblight_driver = {
.flush = ws2812_flush,
};
#endif
#ifdef RGB_MATRIX_ENABLE
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) { return false; }
if (record->event.pressed) {
switch(keycode) {
case RGB_MATRIX_TOGGLE: // toggle rgb matrix
rgb_matrix_toggle();
return false;
case RGB_MATRIX_MODE_INC:
rgb_matrix_step();
return false;
case RGB_MATRIX_MODE_DEC:
rgb_matrix_step_reverse();
return false;
case RGB_MATRIX_HUE_INC:
rgb_matrix_increase_hue();
return false;
case RGB_MATRIX_HUE_DEC:
rgb_matrix_decrease_hue();
return false;
case RGB_MATRIX_SAT_INC:
rgb_matrix_increase_sat();
return false;
case RGB_MATRIX_SAT_DEC:
rgb_matrix_decrease_sat();
return false;
case RGB_MATRIX_VAL_INC:
rgb_matrix_increase_val();
return false;
case RGB_MATRIX_VAL_DEC:
rgb_matrix_decrease_val();
return false;
default:
break;
}
}
return true;
}
#endif

View File

@@ -1,57 +0,0 @@
/* Copyright 2020 Neil Brian Ramirez
*
* 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 3 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/>.
*/
#pragma once
#include "keycodes.h"
#ifndef RGB_MATRIX_TOGGLE
# define RGB_MATRIX_TOGGLE QK_KB_0
#endif
#ifndef RGB_MATRIX_MODE_INC
# define RGB_MATRIX_MODE_INC QK_KB_1
#endif
#ifndef RGB_MATRIX_MODE_DEC
# define RGB_MATRIX_MODE_DEC QK_KB_2
#endif
#ifndef RGB_MATRIX_HUE_INC
# define RGB_MATRIX_HUE_INC QK_KB_3
#endif
#ifndef RGB_MATRIX_HUE_DEC
# define RGB_MATRIX_HUE_DEC QK_KB_4
#endif
#ifndef RGB_MATRIX_SAT_INC
# define RGB_MATRIX_SAT_INC QK_KB_5
#endif
#ifndef RGB_MATRIX_SAT_DEC
# define RGB_MATRIX_SAT_DEC QK_KB_6
#endif
#ifndef RGB_MATRIX_VAL_INC
# define RGB_MATRIX_VAL_INC QK_KB_7
#endif
#ifndef RGB_MATRIX_VAL_DEC
# define RGB_MATRIX_VAL_DEC QK_KB_8
#endif
#define R_M_TOG RGB_MATRIX_TOGGLE
#define R_M_MOD RGB_MATRIX_MODE_INC
#define R_M_RMOD RGB_MATRIX_MODE_DEC
#define R_M_HUI RGB_MATRIX_HUE_INC
#define R_M_HUD RGB_MATRIX_HUE_DEC
#define R_M_SAI RGB_MATRIX_SAT_INC
#define R_M_SAD RGB_MATRIX_SAT_DEC
#define R_M_VAI RGB_MATRIX_VAL_INC
#define R_M_VAD RGB_MATRIX_VAL_DEC

View File

@@ -20,5 +20,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_DI_PIN D2
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_GRADIENT + 9
#define RGB_MATRIX_DISABLE_KEYCODES

View File

@@ -50,8 +50,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
[_ADJUST] = LAYOUT(
_______, QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , R_M_TOG,
_______, _______, MU_NEXT, R_M_TOG, R_M_MOD, R_M_HUI, R_M_HUD, R_M_SAI, R_M_SAD, R_M_VAI, R_M_VAD, _______,
_______, QK_BOOT, _______, UG_TOGG, UG_NEXT, UG_HUEU, UG_HUED, UG_SATU, UG_SATD, UG_VALU, UG_VALD, KC_DEL , RM_TOGG,
_______, _______, MU_NEXT, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, RM_VALU, RM_VALD, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)

View File

@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "work_board.h"
#include "quantum.h"
#ifdef OLED_ENABLE
# ifdef RGB_MATRIX_ENABLE

View File

@@ -1,20 +0,0 @@
/* Copyright 2021 Drashna Jael're
*
* 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/>.
*/
#pragma once
#include "quantum.h"
#include "rgb_functions.h"