1
0
Fork 0

annepro2: Add more LED functionalities to default-layer-indicators (#16676)

This commit is contained in:
Florian 2022-03-18 18:24:43 +01:00 committed by GitHub
parent ed773ab73c
commit 773242503c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View file

@ -192,6 +192,15 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
ap2_led_reset_foreground_color(); ap2_led_reset_foreground_color();
break; break;
case KC_AP_LED_TOG:
if (ap2_led_status.matrix_enabled) {
ap2_led_disable();
} else {
ap2_led_enable();
ap2_led_reset_foreground_color();
}
break;
case KC_AP_LED_NEXT_PROFILE: case KC_AP_LED_NEXT_PROFILE:
ap2_led_next_profile(); ap2_led_next_profile();
ap2_led_reset_foreground_color(); ap2_led_reset_foreground_color();

View file

@ -53,6 +53,7 @@ enum AP2KeyCodes {
KC_AP2_USB, KC_AP2_USB,
KC_AP_LED_ON, KC_AP_LED_ON,
KC_AP_LED_OFF, KC_AP_LED_OFF,
KC_AP_LED_TOG,
KC_AP_LED_NEXT_PROFILE, KC_AP_LED_NEXT_PROFILE,
KC_AP_LED_PREV_PROFILE, KC_AP_LED_PREV_PROFILE,
KC_AP_LED_NEXT_INTENSITY, KC_AP_LED_NEXT_INTENSITY,

View file

@ -83,7 +83,7 @@ enum anne_pro_layers {
/* /*
* Layer FN2 * Layer FN2
* ,-----------------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------------.
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 |LEDOF|LEDON| F10 | F11 | F12 | Bksp | * | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 | F8 |LEDTG|LEDI+|LEDPV|LEDNX| Bksp |
* |-----------------------------------------------------------------------------------------+ * |-----------------------------------------------------------------------------------------+
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ | * | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
* |-----------------------------------------------------------------------------------------+ * |-----------------------------------------------------------------------------------------+
@ -96,7 +96,7 @@ enum anne_pro_layers {
* *
*/ */
[FN2] = LAYOUT_60_ansi( /* FN2 */ [FN2] = LAYOUT_60_ansi( /* FN2 */
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, KC_AP_LED_OFF, KC_AP_LED_ON, _______, _______, _______, _______, _______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, _______, KC_AP_LED_TOG, KC_AP_LED_NEXT_INTENSITY, KC_AP_LED_PREV_PROFILE, KC_AP_LED_NEXT_PROFILE, _______,
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______, MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
@ -105,6 +105,11 @@ enum anne_pro_layers {
}; };
// clang-format on // clang-format on
void keyboard_post_init_user(void) {
ap2_led_enable();
ap2_led_set_profile(7);
}
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case FN1: case FN1: