diff options
-rw-r--r-- | docs/feature_rgblight.md | 6 | ||||
-rw-r--r-- | quantum/quantum.c | 17 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 8 |
3 files changed, 21 insertions, 10 deletions
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 0a5e2a8b1..9d8f537df 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md | |||
@@ -87,8 +87,8 @@ These control the RGB Lighting functionality. | |||
87 | | Long Name | Short Name | Description | | 87 | | Long Name | Short Name | Description | |
88 | |-----------|------------|-------------| | 88 | |-----------|------------|-------------| |
89 | ||`RGB_TOG`|toggle on/off| | 89 | ||`RGB_TOG`|toggle on/off| |
90 | ||`RGB_MOD`|cycle through modes| | 90 | |`RGB_MODE_FORWARD`|`RGB_MOD`|cycle through modes, use reverse direction when shift is held| |
91 | ||`RGB_SMOD`|cycle through modes, use reverse direction when shift is hold| | 91 | |`RGB_MODE_REVERSE`|`RGB_RMOD`|cycle through modes in reverse (also suppost shift to go forward)| |
92 | ||`RGB_HUI`|hue increase| | 92 | ||`RGB_HUI`|hue increase| |
93 | ||`RGB_HUD`|hue decrease| | 93 | ||`RGB_HUD`|hue decrease| |
94 | ||`RGB_SAI`|saturation increase| | 94 | ||`RGB_SAI`|saturation increase| |
@@ -104,6 +104,8 @@ These control the RGB Lighting functionality. | |||
104 | |`RGB_MODE_XMAS`|`RGB_M_X`| Switch to the Christmas animation | | 104 | |`RGB_MODE_XMAS`|`RGB_M_X`| Switch to the Christmas animation | |
105 | |`RGB_MODE_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode | | 105 | |`RGB_MODE_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode | |
106 | 106 | ||
107 | note: for backwards compatibility, `RGB_SMOD` is an alias for `RGB_MOD`. | ||
108 | |||
107 | ## Hardware Modification | 109 | ## Hardware Modification |
108 | 110 | ||
109 |  | 111 |  |
diff --git a/quantum/quantum.c b/quantum/quantum.c index d08f15870..9c498bf7e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -286,20 +286,25 @@ bool process_record_quantum(keyrecord_t *record) { | |||
286 | rgblight_toggle(); | 286 | rgblight_toggle(); |
287 | } | 287 | } |
288 | return false; | 288 | return false; |
289 | case RGB_MOD: | 289 | case RGB_MODE_FORWARD: |
290 | if (record->event.pressed) { | 290 | if (record->event.pressed) { |
291 | rgblight_step(); | 291 | uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); |
292 | if(shifted) { | ||
293 | rgblight_step_reverse(); | ||
294 | } | ||
295 | else { | ||
296 | rgblight_step(); | ||
297 | } | ||
292 | } | 298 | } |
293 | return false; | 299 | return false; |
294 | case RGB_SMOD: | 300 | case RGB_MODE_REVERSE: |
295 | // same as RBG_MOD, but if shift is pressed, it will use the reverese direction instead. | ||
296 | if (record->event.pressed) { | 301 | if (record->event.pressed) { |
297 | uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); | 302 | uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); |
298 | if(shifted) { | 303 | if(shifted) { |
299 | rgblight_step_reverse(); | 304 | rgblight_step(); |
300 | } | 305 | } |
301 | else { | 306 | else { |
302 | rgblight_step(); | 307 | rgblight_step_reverse(); |
303 | } | 308 | } |
304 | } | 309 | } |
305 | return false; | 310 | return false; |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index c3c5f1656..048da3267 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
@@ -399,8 +399,8 @@ enum quantum_keycodes { | |||
399 | 399 | ||
400 | // RGB functionality | 400 | // RGB functionality |
401 | RGB_TOG, | 401 | RGB_TOG, |
402 | RGB_MOD, | 402 | RGB_MODE_FORWARD, |
403 | RGB_SMOD, | 403 | RGB_MODE_REVERSE, |
404 | RGB_HUI, | 404 | RGB_HUI, |
405 | RGB_HUD, | 405 | RGB_HUD, |
406 | RGB_SAI, | 406 | RGB_SAI, |
@@ -553,6 +553,10 @@ enum quantum_keycodes { | |||
553 | 553 | ||
554 | #define KC_GESC GRAVE_ESC | 554 | #define KC_GESC GRAVE_ESC |
555 | 555 | ||
556 | #define RGB_MOD RGB_MODE_FORWARD | ||
557 | #define RGB_SMOD RGB_MODE_FORWARD | ||
558 | #define RGB_RMOD RGB_MODE_REVERSE | ||
559 | |||
556 | #define RGB_M_P RGB_MODE_PLAIN | 560 | #define RGB_M_P RGB_MODE_PLAIN |
557 | #define RGB_M_B RGB_MODE_BREATHE | 561 | #define RGB_M_B RGB_MODE_BREATHE |
558 | #define RGB_M_R RGB_MODE_RAINBOW | 562 | #define RGB_M_R RGB_MODE_RAINBOW |