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:
parent
5c97a78ce6
commit
6fa11bf219
267 changed files with 1228 additions and 2276 deletions
|
@ -18,20 +18,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
|
||||
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(RGBLIGHT_ENABLE)
|
||||
#define RGB_MATRIX_DISABLE_KEYCODES
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hotswap.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = {
|
||||
|
@ -163,43 +163,3 @@ bool rgb_matrix_indicators_kb(void) {
|
|||
}
|
||||
|
||||
#endif //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) {
|
||||
#if defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
case RGB_MATRIX_TOGGLE: // toggle rgb matrix
|
||||
rgb_matrix_toggle();
|
||||
return false;
|
||||
case RGB_MATRIX_STEP:
|
||||
rgb_matrix_step();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_HUE:
|
||||
rgb_matrix_increase_hue();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_HUE:
|
||||
rgb_matrix_decrease_hue();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_SAT:
|
||||
rgb_matrix_increase_sat();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_SAT:
|
||||
rgb_matrix_decrease_sat();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_VAL:
|
||||
rgb_matrix_increase_val();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_VAL:
|
||||
rgb_matrix_decrease_val();
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
* @file hotswap.h
|
||||
*
|
||||
Copyright 2020 astro <yuleiz@gmail.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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#if defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
# ifndef RGB_MATRIX_TOGGLE
|
||||
# define RGB_MATRIX_TOGGLE KC_F16
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_STEP
|
||||
# define RGB_MATRIX_STEP KC_F17
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_HUE
|
||||
# define RGB_MATRIX_INC_HUE KC_F18
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_HUE
|
||||
# define RGB_MATRIX_DEC_HUE KC_F19
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_SAT
|
||||
# define RGB_MATRIX_INC_SAT KC_F20
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_SAT
|
||||
# define RGB_MATRIX_DEC_SAT KC_F21
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_VAL
|
||||
# define RGB_MATRIX_INC_VAL KC_F22
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_VAL
|
||||
# define RGB_MATRIX_DEC_VAL KC_F23
|
||||
# endif
|
||||
#endif
|
|
@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[1] = LAYOUT_60_ansi_tsangan_split_bs_rshift(
|
||||
_______, 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_PSCR,
|
||||
QK_BOOT,RGB_TOG,RGB_MOD,_______, KC_F16, KC_F17,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,
|
||||
QK_BOOT,UG_TOGG,UG_NEXT,_______, RM_TOGG, RM_NEXT,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,
|
||||
_______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP,KC_RIGHT,KC_HOME, KC_END,_______,
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
|
||||
_______,_______,_______, _______, _______,_______,_______),
|
||||
|
|
|
@ -18,20 +18,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
|
||||
|
||||
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
|
||||
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(RGBLIGHT_ENABLE)
|
||||
# define RGB_MATRIX_DISABLE_KEYCODES
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[1] = LAYOUT_60_ansi_split_bs_rshift(
|
||||
_______, 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_PSCR,
|
||||
QK_BOOT,RGB_TOG,RGB_MOD,_______, KC_F16, KC_F17,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,
|
||||
QK_BOOT,UG_TOGG,UG_NEXT,_______, RM_TOGG, RM_NEXT,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,
|
||||
_______, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP,KC_RIGHT,KC_HOME, KC_END,_______,
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
|
||||
_______,_______,_______, _______, _______,_______,TG(0),_______),
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "universal.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = {
|
||||
|
@ -167,43 +167,3 @@ bool rgb_matrix_indicators_kb(void) {
|
|||
}
|
||||
|
||||
#endif //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) {
|
||||
#if defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
case RGB_MATRIX_TOGGLE: // toggle rgb matrix
|
||||
rgb_matrix_toggle();
|
||||
return false;
|
||||
case RGB_MATRIX_STEP:
|
||||
rgb_matrix_step();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_HUE:
|
||||
rgb_matrix_increase_hue();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_HUE:
|
||||
rgb_matrix_decrease_hue();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_SAT:
|
||||
rgb_matrix_increase_sat();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_SAT:
|
||||
rgb_matrix_decrease_sat();
|
||||
return false;
|
||||
case RGB_MATRIX_INC_VAL:
|
||||
rgb_matrix_increase_val();
|
||||
return false;
|
||||
case RGB_MATRIX_DEC_VAL:
|
||||
rgb_matrix_decrease_val();
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/**
|
||||
* @file universal.h
|
||||
*
|
||||
Copyright 2020 astro <yuleiz@gmail.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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#if defined(RGB_MATRIX_DISABLE_KEYCODES)
|
||||
# ifndef RGB_MATRIX_TOGGLE
|
||||
# define RGB_MATRIX_TOGGLE KC_F16
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_STEP
|
||||
# define RGB_MATRIX_STEP KC_F17
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_HUE
|
||||
# define RGB_MATRIX_INC_HUE KC_F18
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_HUE
|
||||
# define RGB_MATRIX_DEC_HUE KC_F19
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_SAT
|
||||
# define RGB_MATRIX_INC_SAT KC_F20
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_SAT
|
||||
# define RGB_MATRIX_DEC_SAT KC_F21
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_INC_VAL
|
||||
# define RGB_MATRIX_INC_VAL KC_F22
|
||||
# endif
|
||||
# ifndef RGB_MATRIX_DEC_VAL
|
||||
# define RGB_MATRIX_DEC_VAL KC_F23
|
||||
# endif
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue