aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/feature_rgblight.md1
-rw-r--r--quantum/quantum.c12
-rw-r--r--quantum/quantum_keycodes.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
index 18f2c74e5..0a5e2a8b1 100644
--- a/docs/feature_rgblight.md
+++ b/docs/feature_rgblight.md
@@ -88,6 +88,7 @@ These control the RGB Lighting functionality.
|-----------|------------|-------------|
||`RGB_TOG`|toggle on/off|
||`RGB_MOD`|cycle through modes|
+||`RGB_SMOD`|cycle through modes, use reverse direction when shift is hold|
||`RGB_HUI`|hue increase|
||`RGB_HUD`|hue decrease|
||`RGB_SAI`|saturation increase|
diff --git a/quantum/quantum.c b/quantum/quantum.c
index a1a1a9d1c..23873852f 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -290,6 +290,18 @@ bool process_record_quantum(keyrecord_t *record) {
rgblight_step();
}
return false;
+ case RGB_SMOD:
+ // same as RBG_MOD, but if shift is pressed, it will use the reverese direction instead.
+ if (record->event.pressed) {
+ uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT));
+ if(shifted) {
+ rgblight_step_reverse();
+ }
+ else {
+ rgblight_step();
+ }
+ }
+ return false;
case RGB_HUI:
if (record->event.pressed) {
rgblight_increase_hue();
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 212fdc67d..c3c5f1656 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -400,6 +400,7 @@ enum quantum_keycodes {
// RGB functionality
RGB_TOG,
RGB_MOD,
+ RGB_SMOD,
RGB_HUI,
RGB_HUD,
RGB_SAI,