Moved RGBLIGHT keycodes to betalupi_ergodox.c

master
Mark 2022-06-17 12:06:53 -07:00
parent 3024a46dd9
commit 2133148e1e
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
5 changed files with 159 additions and 142 deletions

View File

@ -338,7 +338,133 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
#endif #endif
// Custom RGBLIGHT macros
#ifdef RGBLIGHT_ENABLE
#ifdef RGBLIGHT_NO_EEPROM
case LIGHT_TOG:
if (record->event.pressed) {
rgblight_toggle_noeeprom();
} }
break;
case LIGHT_MOD:
if (record->event.pressed) {
rgblight_step_noeeprom();
}
break;
case LIGHT_HUI:
if (record->event.pressed) {
rgblight_increase_hue_noeeprom();
}
break;
case LIGHT_HUD:
if (record->event.pressed) {
rgblight_decrease_hue_noeeprom();
}
break;
case LIGHT_SAI:
if (record->event.pressed) {
rgblight_increase_sat_noeeprom();
}
break;
case LIGHT_SAD:
if (record->event.pressed) {
rgblight_decrease_sat_noeeprom();
}
break;
case LIGHT_VAI:
if (record->event.pressed) {
rgblight_increase_val_noeeprom();
}
break;
case LIGHT_VAD:
if (record->event.pressed) {
rgblight_decrease_val_noeeprom();
}
break;
case LIGHT_SPI:
if (record->event.pressed) {
rgblight_increase_speed_noeeprom();
}
break;
case LIGHT_SPD:
if (record->event.pressed) {
rgblight_decrease_speed_noeeprom();
}
break;
#else
case LIGHT_TOG:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case LIGHT_MOD:
if (record->event.pressed) {
rgblight_step();
}
break;
case LIGHT_HUI:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case LIGHT_HUD:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case LIGHT_SAI:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case LIGHT_SAD:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case LIGHT_VAI:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case LIGHT_VAD:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case LIGHT_SPI:
if (record->event.pressed) {
rgblight_increase_speed();
}
break;
case LIGHT_SPD:
if (record->event.pressed) {
rgblight_decrease_speed();
}
break;
#endif
#endif
}
return process_record_user(keycode, record); return process_record_user(keycode, record);
} }

View File

@ -98,7 +98,18 @@ inline void ergodox_led_all_set(uint8_t n) {
enum ergodox_ez_keycodes { enum ergodox_ez_keycodes {
LED_LEVEL = SAFE_RANGE, LED_LEVEL = SAFE_RANGE,
TOGGLE_LAYER_COLOR, TOGGLE_LAYER_COLOR,
EZ_SAFE_RANGE, // Custom RGBLIGHT macros
LIGHT_TOG, // Toggle backlight
LIGHT_HUI, // Increase backlight hue
LIGHT_HUD, // Decrease backlight hue
LIGHT_SAI, // Increase backlight sat
LIGHT_SAD, // Decrease backlight sat
LIGHT_VAI, // Increase backlight val
LIGHT_VAD, // Decrease backlight val
LIGHT_SPI, // Increase backlight speed
LIGHT_SPD, // Decrease backlight speed
LIGHT_MOD, // Change backlight animation mode
BETA_SAFE_RANGE
}; };
typedef union { typedef union {

View File

@ -85,7 +85,8 @@
//#define RGBLIGHT_NO_EEPROM //#define RGBLIGHT_NO_EEPROM
// Prevents RGB keycodes from affecting underglow. // Prevents RGB keycodes from affecting underglow.
// This allows us to control RGBMatrix and RGBLight seperately. // This allows us to control RGBMatrix and RGBLight seperately
// with custom macros defined in betalupi_ergodox.c
#define RGBLIGHT_DISABLE_KEYCODES #define RGBLIGHT_DISABLE_KEYCODES
// The underglow LEDs I used for the backlight mod aren't RGBW, // The underglow LEDs I used for the backlight mod aren't RGBW,

View File

@ -6,23 +6,12 @@
// Define custom keys // Define custom keys
// (Must be done BEFORE keymaps) // (Must be done BEFORE keymaps)
enum custom_keycodes { enum custom_keycodes {
M_SHUTDOWN = EZ_SAFE_RANGE, M_SHUTDOWN = BETA_SAFE_RANGE,
M_RESETWM, M_RESETWM,
RU_LAYER, RU_LAYER,
EN_LAYER, EN_LAYER,
M_RU_CTRL, M_RU_CTRL,
M_RU_ALT, M_RU_ALT
// Custom RGBLIGHT macros
LIGHT_TOG, // Toggle backlight
LIGHT_HUI, // Increase backlight hue
LIGHT_HUD, // Decrease backlight hue
LIGHT_SAI, // Increase backlight sat
LIGHT_SAD, // Decrease backlight sat
LIGHT_VAI, // Increase backlight val
LIGHT_VAD, // Decrease backlight val
LIGHT_SPI, // Increase backlight speed
LIGHT_SPD, // Decrease backlight speed
LIGHT_MOD, // Change backlight animation mode
}; };
enum tap_dance_codes { enum tap_dance_codes {
@ -129,11 +118,9 @@ void rgb_matrix_indicators_user(void) {
break; break;
case LAYER_SYMBOLS_IDX: case LAYER_SYMBOLS_IDX:
set_layer_color(LAYER_SYMBOLS_LEDS_IDX); set_layer_color(LAYER_SYMBOLS_LEDS_IDX);
//rgblight_setrgb(255, 255, 0);
break; break;
case LAYER_ARROWS_IDX: case LAYER_ARROWS_IDX:
set_layer_color(LAYER_ARROWS_LEDS_IDX); set_layer_color(LAYER_ARROWS_LEDS_IDX);
//rgblight_setrgb(255, 0, 0);
break; break;
case LAYER_FKEYS_IDX: case LAYER_FKEYS_IDX:
set_layer_color(LAYER_FKEYS_LEDS_IDX); set_layer_color(LAYER_FKEYS_LEDS_IDX);
@ -147,7 +134,6 @@ void rgb_matrix_indicators_user(void) {
default: default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE) { if (rgb_matrix_get_flags() == LED_FLAG_NONE) {
rgb_matrix_set_color_all(0, 0, 0); rgb_matrix_set_color_all(0, 0, 0);
//rgblight_setrgb(0, 0, 0);
} }
break; break;
} }
@ -219,130 +205,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
} }
break; break;
// Custom RGBLIGHT macros
#ifdef RGBLIGHT_NO_EEPROM
case LIGHT_TOG:
if (record->event.pressed) {
rgblight_toggle_noeeprom();
}
break;
case LIGHT_MOD:
if (record->event.pressed) {
rgblight_step_noeeprom();
}
break;
case LIGHT_HUI:
if (record->event.pressed) {
rgblight_increase_hue_noeeprom();
}
break;
case LIGHT_HUD:
if (record->event.pressed) {
rgblight_decrease_hue_noeeprom();
}
break;
case LIGHT_SAI:
if (record->event.pressed) {
rgblight_increase_sat_noeeprom();
}
break;
case LIGHT_SAD:
if (record->event.pressed) {
rgblight_decrease_sat_noeeprom();
}
break;
case LIGHT_VAI:
if (record->event.pressed) {
rgblight_increase_val_noeeprom();
}
break;
case LIGHT_VAD:
if (record->event.pressed) {
rgblight_decrease_val_noeeprom();
}
break;
case LIGHT_SPI:
if (record->event.pressed) {
rgblight_increase_speed_noeeprom();
}
break;
case LIGHT_SPD:
if (record->event.pressed) {
rgblight_decrease_speed_noeeprom();
}
break;
#else
case LIGHT_TOG:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case LIGHT_MOD:
if (record->event.pressed) {
rgblight_step();
}
break;
case LIGHT_HUI:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case LIGHT_HUD:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case LIGHT_SAI:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case LIGHT_SAD:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case LIGHT_VAI:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case LIGHT_VAD:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case LIGHT_SPI:
if (record->event.pressed) {
rgblight_increase_speed();
}
break;
case LIGHT_SPD:
if (record->event.pressed) {
rgblight_decrease_speed();
}
break;
#endif
} }
return true; return true;
} }

View File

@ -19,7 +19,24 @@ If you get array-bounds errors on build, you may have a bad avr-gcc version. Rea
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. 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.
--------------------------------------------------------------------------------
# Notes
Custom keycodes (betalupi_keyboard.c)
```
// Custom RGBLIGHT macros
LIGHT_TOG, // Toggle backlight
LIGHT_HUI, // Increase backlight hue
LIGHT_HUD, // Decrease backlight hue
LIGHT_SAI, // Increase backlight sat
LIGHT_SAD, // Decrease backlight sat
LIGHT_VAI, // Increase backlight val
LIGHT_VAD, // Decrease backlight val
LIGHT_SPI, // Increase backlight speed
LIGHT_SPD, // Decrease backlight speed
LIGHT_MOD, // Change backlight animation mode
```
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
# Notes from ZSA # Notes from ZSA