summaryrefslogtreecommitdiffstats
path: root/keyboards/massdrop/ctrl/keymaps/mac/keymap.c
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-04-30 00:18:50 +0200
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-04-30 00:18:50 +0200
commita7113c8ed090d0ac647f30ee9b8ef41252e568ed (patch)
tree24d33db679b4d1357efef2784e69fea48e98d0ed /keyboards/massdrop/ctrl/keymaps/mac/keymap.c
parent1d784f0f9575b70e35c9c8338b0ff80dc7316d7e (diff)
downloadqmk_firmware-a7113c8ed090d0ac647f30ee9b8ef41252e568ed.tar.gz
qmk_firmware-a7113c8ed090d0ac647f30ee9b8ef41252e568ed.tar.xz
Updated rgb_led struct field modifier to flags (#5619)
Updated effects to test led flags Updated massdrop to use new flags field for led toggle
Diffstat (limited to 'keyboards/massdrop/ctrl/keymaps/mac/keymap.c')
-rw-r--r--keyboards/massdrop/ctrl/keymaps/mac/keymap.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c
index 41cf82757..79fe7388a 100644
--- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c
+++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c
@@ -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
}