summaryrefslogtreecommitdiffstats
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorColin T.A. Gray <colinta@gmail.com>2017-12-04 11:36:24 -0700
committerskullydazed <skullydazed@users.noreply.github.com>2017-12-04 11:12:52 -0800
commit53b043d4ef9da3c60236bc8ac012f59bea7bff20 (patch)
tree4c7401aa48120ba411d79ccb54f17370eb540dcf /quantum/quantum.c
parent7b51f050d74c158bc082e811d3feaa31bbf33740 (diff)
adds 'RGB_RMOD' to go through RGB modes in reverse
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index d08f15870c..9c498bf7e0 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -286,20 +286,25 @@ bool process_record_quantum(keyrecord_t *record) {
rgblight_toggle();
}
return false;
- case RGB_MOD:
+ case RGB_MODE_FORWARD:
if (record->event.pressed) {
- rgblight_step();
+ 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_SMOD:
- // same as RBG_MOD, but if shift is pressed, it will use the reverese direction instead.
+ case RGB_MODE_REVERSE:
if (record->event.pressed) {
uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT));
if(shifted) {
- rgblight_step_reverse();
+ rgblight_step();
}
else {
- rgblight_step();
+ rgblight_step_reverse();
}
}
return false;