Update keymap.c

pull/19853/head
jonylee@hfd 2023-12-21 09:51:09 +08:00 committed by GitHub
parent 40357a0836
commit 1432d53809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 0 deletions

View File

@ -81,3 +81,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI, _______, _______)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case DF(WIN_B):
if (record->event.pressed) {
set_single_persistent_default_layer(WIN_B);
}
return false;
case DF(MAC_B):
if (record->event.pressed) {
set_single_persistent_default_layer(MAC_B);
keymap_config.no_gui = 0;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
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;
}
}