diff options
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/keymap.h | 10 | ||||
-rw-r--r-- | quantum/quantum.c | 54 |
2 files changed, 62 insertions, 2 deletions
diff --git a/quantum/keymap.h b/quantum/keymap.h index 73f99f8211..a158651839 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -156,6 +156,16 @@ enum quantum_keycodes { BL_INC, BL_TOGG, BL_STEP, + + // RGB functionality + RGB_TOG, + RGB_MOD, + RGB_HUI, + RGB_HUD, + RGB_SAI, + RGB_SAD, + RGB_VAI, + RGB_VAD, // Left shift, open paren KC_LSPO, diff --git a/quantum/quantum.c b/quantum/quantum.c index d8e43a4655..09daa47127 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -93,16 +93,66 @@ bool process_record_quantum(keyrecord_t *record) { *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific #endif bootloader_jump(); - return false; } + return false; break; case DEBUG: if (record->event.pressed) { print("\nDEBUG: enabled.\n"); debug_enable = true; - return false; } + return false; + break; + #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(); + } + return false; + break; + case RGB_HUD: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + return false; + break; + case RGB_SAI: + if (record->event.pressed) { + rgblight_increase_sat(); + } + return false; + break; + case RGB_SAD: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + return false; + break; + case RGB_VAI: + if (record->event.pressed) { + rgblight_increase_val(); + } + return false; + break; + case RGB_VAD: + if (record->event.pressed) { + rgblight_decrease_val(); + } + return false; break; + #endif case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_UNSWAP_ALT_GUI: if (record->event.pressed) { // MAGIC actions (BOOTMAGIC without the boot) |