Update m7.c

This commit is contained in:
jonylee@hfd 2024-03-18 17:55:57 +08:00 committed by GitHub
parent 21decafb68
commit e6d4a20929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,3 +107,38 @@ const snled27351_led_t PROGMEM g_snled27351_leds[SNLED27351_LED_COUNT] = {
{1, J_10, K_10, L_10},
};
#endif
bool process_record_kb(uint16_t keycode, keyrecord_t *record)
{
if (!process_record_user(keycode, record)) {
return false;
}
switch (keycode)
{
case RGB_TOG:
if (record->event.pressed)
{
switch (rgb_matrix_get_flags())
{
case LED_FLAG_ALL:
{
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_set_color_all(0, 0, 0);
}
break;
default:
{
rgb_matrix_set_flags(LED_FLAG_ALL);
}
break;
}
}
if (!rgb_matrix_is_enabled())
{
rgb_matrix_set_flags(LED_FLAG_ALL);
rgb_matrix_enable();
}
return false;
default:
return true;
}
}