diff options
| author | Manna Harbour <51143715+manna-harbour@users.noreply.github.com> | 2019-11-29 09:00:29 +1100 |
|---|---|---|
| committer | Joel Challis <git@zvecr.com> | 2019-11-28 22:00:29 +0000 |
| commit | f9521ffa21c71ed1d5c5e3c72a0d193594d0430f (patch) | |
| tree | 2a43c9205549d0e410d1995ad76b2a79d555ac42 /quantum/quantum.c | |
| parent | 2048df883200589c20dfc581e39e03703edf0b23 (diff) | |
| download | qmk_firmware-f9521ffa21c71ed1d5c5e3c72a0d193594d0430f.tar.gz qmk_firmware-f9521ffa21c71ed1d5c5e3c72a0d193594d0430f.zip | |
Add shift-to-invert to remaining directional RGB_* keycode pairs (#7484)
* Add shift-to-invert to remaining directional RGB_* keycode pairs
RGB_MODE_FORWARD / RGB_MODE_REVERSE invert their functions when shift is held.
This change adds the same capabilities to the remaining directional RGB_*
keycode pairs. This improves consistency and provides full RGB control in a
keymap containing only one keycode from each pair.
* remove redundant variable
* fix typo
* Fix more typos
Flyspell is on now I swear!
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index f768f86bc..dd57d7a5e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -346,28 +346,60 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 346 | } | 346 | } |
| 347 | return false; | 347 | return false; |
| 348 | case RGB_HUI: | 348 | case RGB_HUI: |
| 349 | rgblight_increase_hue(); | 349 | if (shifted) { |
| 350 | rgblight_decrease_hue(); | ||
| 351 | } else { | ||
| 352 | rgblight_increase_hue(); | ||
| 353 | } | ||
| 350 | return false; | 354 | return false; |
| 351 | case RGB_HUD: | 355 | case RGB_HUD: |
| 352 | rgblight_decrease_hue(); | 356 | if (shifted) { |
| 357 | rgblight_increase_hue(); | ||
| 358 | } else { | ||
| 359 | rgblight_decrease_hue(); | ||
| 360 | } | ||
| 353 | return false; | 361 | return false; |
| 354 | case RGB_SAI: | 362 | case RGB_SAI: |
| 355 | rgblight_increase_sat(); | 363 | if (shifted) { |
| 364 | rgblight_decrease_sat(); | ||
| 365 | } else { | ||
| 366 | rgblight_increase_sat(); | ||
| 367 | } | ||
| 356 | return false; | 368 | return false; |
| 357 | case RGB_SAD: | 369 | case RGB_SAD: |
| 358 | rgblight_decrease_sat(); | 370 | if (shifted) { |
| 371 | rgblight_increase_sat(); | ||
| 372 | } else { | ||
| 373 | rgblight_decrease_sat(); | ||
| 374 | } | ||
| 359 | return false; | 375 | return false; |
| 360 | case RGB_VAI: | 376 | case RGB_VAI: |
| 361 | rgblight_increase_val(); | 377 | if (shifted) { |
| 378 | rgblight_decrease_val(); | ||
| 379 | } else { | ||
| 380 | rgblight_increase_val(); | ||
| 381 | } | ||
| 362 | return false; | 382 | return false; |
| 363 | case RGB_VAD: | 383 | case RGB_VAD: |
| 364 | rgblight_decrease_val(); | 384 | if (shifted) { |
| 385 | rgblight_increase_val(); | ||
| 386 | } else { | ||
| 387 | rgblight_decrease_val(); | ||
| 388 | } | ||
| 365 | return false; | 389 | return false; |
| 366 | case RGB_SPI: | 390 | case RGB_SPI: |
| 367 | rgblight_increase_speed(); | 391 | if (shifted) { |
| 392 | rgblight_decrease_speed(); | ||
| 393 | } else { | ||
| 394 | rgblight_increase_speed(); | ||
| 395 | } | ||
| 368 | return false; | 396 | return false; |
| 369 | case RGB_SPD: | 397 | case RGB_SPD: |
| 370 | rgblight_decrease_speed(); | 398 | if (shifted) { |
| 399 | rgblight_increase_speed(); | ||
| 400 | } else { | ||
| 401 | rgblight_decrease_speed(); | ||
| 402 | } | ||
| 371 | return false; | 403 | return false; |
| 372 | case RGB_MODE_PLAIN: | 404 | case RGB_MODE_PLAIN: |
| 373 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | 405 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); |
