summaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c158
1 files changed, 102 insertions, 56 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 87975ef99b..285e1e81ee 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -249,105 +249,153 @@ bool process_record_quantum(keyrecord_t *record) {
if (record->event.pressed) {
reset_keyboard();
}
- return false;
- break;
+ return false;
case DEBUG:
if (record->event.pressed) {
debug_enable = true;
print("DEBUG: enabled.\n");
}
- return false;
- break;
+ return false;
#ifdef FAUXCLICKY_ENABLE
case FC_TOG:
if (record->event.pressed) {
FAUXCLICKY_TOGGLE;
}
return false;
- break;
case FC_ON:
if (record->event.pressed) {
FAUXCLICKY_ON;
}
return false;
- break;
case FC_OFF:
if (record->event.pressed) {
FAUXCLICKY_OFF;
}
return false;
- break;
#endif
- #ifdef RGBLIGHT_ENABLE
- case RGB_TOG:
- if (record->event.pressed) {
- rgblight_toggle();
- }
- return false;
- break;
- case RGB_MOD:
- if (record->event.pressed) {
- rgblight_step();
- }
- return false;
- break;
- case RGB_HUI:
- if (record->event.pressed) {
- rgblight_increase_hue();
+ #ifdef RGBLIGHT_ENABLE
+ case RGB_TOG:
+ if (record->event.pressed) {
+ rgblight_toggle();
+ }
+ return false;
+ case RGB_MOD:
+ if (record->event.pressed) {
+ rgblight_step();
+ }
+ return false;
+ case RGB_HUI:
+ if (record->event.pressed) {
+ rgblight_increase_hue();
+ }
+ return false;
+ case RGB_HUD:
+ if (record->event.pressed) {
+ rgblight_decrease_hue();
+ }
+ return false;
+ case RGB_SAI:
+ if (record->event.pressed) {
+ rgblight_increase_sat();
+ }
+ return false;
+ case RGB_SAD:
+ if (record->event.pressed) {
+ rgblight_decrease_sat();
+ }
+ return false;
+ case RGB_VAI:
+ if (record->event.pressed) {
+ rgblight_increase_val();
+ }
+ return false;
+ case RGB_VAD:
+ if (record->event.pressed) {
+ rgblight_decrease_val();
+ }
+ return false;
+ case RGB_MODE_PLAIN:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ }
+ return false;
+ case RGB_MODE_BREATHE:
+ if (record->event.pressed) {
+ if ((2 <= rgblight_get_mode()) && (rgblight_get_mode() < 5)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(2);
}
- return false;
- break;
- case RGB_HUD:
- if (record->event.pressed) {
- rgblight_decrease_hue();
+ }
+ return false;
+ case RGB_MODE_RAINBOW:
+ if (record->event.pressed) {
+ if ((6 <= rgblight_get_mode()) && (rgblight_get_mode() < 8)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(6);
}
- return false;
- break;
- case RGB_SAI:
- if (record->event.pressed) {
- rgblight_increase_sat();
+ }
+ return false;
+ case RGB_MODE_SWIRL:
+ if (record->event.pressed) {
+ if ((9 <= rgblight_get_mode()) && (rgblight_get_mode() < 14)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(9);
}
- return false;
- break;
- case RGB_SAD:
- if (record->event.pressed) {
- rgblight_decrease_sat();
+ }
+ return false;
+ case RGB_MODE_SNAKE:
+ if (record->event.pressed) {
+ if ((15 <= rgblight_get_mode()) && (rgblight_get_mode() < 20)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(15);
}
- return false;
- break;
- case RGB_VAI:
- if (record->event.pressed) {
- rgblight_increase_val();
+ }
+ return false;
+ case RGB_MODE_KNIGHT:
+ if (record->event.pressed) {
+ if ((21 <= rgblight_get_mode()) && (rgblight_get_mode() < 23)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(21);
}
- return false;
- break;
- case RGB_VAD:
- if (record->event.pressed) {
- rgblight_decrease_val();
+ }
+ return false;
+ case RGB_MODE_XMAS:
+ if (record->event.pressed) {
+ rgblight_mode(24);
+ }
+ return false;
+ case RGB_MODE_GRADIENT:
+ if (record->event.pressed) {
+ if ((25 <= rgblight_get_mode()) && (rgblight_get_mode() < 34)) {
+ rgblight_step();
+ } else {
+ rgblight_mode(25);
}
- return false;
- break;
- #endif
+ }
+ return false;
+ #endif
#ifdef PROTOCOL_LUFA
case OUT_AUTO:
if (record->event.pressed) {
set_output(OUTPUT_AUTO);
}
return false;
- break;
case OUT_USB:
if (record->event.pressed) {
set_output(OUTPUT_USB);
}
return false;
- break;
#ifdef BLUETOOTH_ENABLE
case OUT_BT:
if (record->event.pressed) {
set_output(OUTPUT_BLUETOOTH);
}
return false;
- break;
#endif
#endif
case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
@@ -454,7 +502,6 @@ bool process_record_quantum(keyrecord_t *record) {
unregister_mods(MOD_BIT(KC_LSFT));
}
return false;
- // break;
}
case KC_RSPC: {
@@ -477,7 +524,6 @@ bool process_record_quantum(keyrecord_t *record) {
unregister_mods(MOD_BIT(KC_RSFT));
}
return false;
- // break;
}
case GRAVE_ESC: {
uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)