]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/massdrop/ctrl/keymaps/mac/keymap.c
Updated rgb_led struct field modifier to flags (#5619)
[qmk_firmware.git] / keyboards / massdrop / ctrl / keymaps / mac / keymap.c
index 41cf82757240a5ea5978cfe1b23fa8378fccee45..79fe7388af6eda597a74aec3d3caf68c1e6166f2 100644 (file)
@@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }