1
0
Fork 0

[Keymap] Add indicator light bootup fanfare (#10158)

* Add indicator light bootup fanfare

* move fanfare code to new file

* fanfare code in new file and remove unused boards

* new startup fanfare code

* add lock/unlock indicator animation

* input key presses before changing lights

* remove old code
This commit is contained in:
stanrc85 2020-09-06 18:04:29 -04:00 committed by GitHub
parent f7ccbfcea8
commit 6c3e404839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 55 deletions

View file

@ -44,8 +44,42 @@ void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) {
}
}
#if defined(HAS_INDICATORS)
static uint8_t led_user = 0;
#endif
void lock_unlock (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance(state);
switch (td_state) {
case SINGLE_TAP: // Ctl + Alt + Del to unlock workstation
tap_code16(KC_CAD);
#if defined(HAS_INDICATORS)
led_user = 0;
writePin(INDICATOR_PIN_0, !led_user);
wait_ms(200);
writePin(INDICATOR_PIN_1, !led_user);
wait_ms(200);
writePin(INDICATOR_PIN_2, !led_user);
#endif
break;
case SINGLE_HOLD:
break;
case DOUBLE_TAP: //Lock workstation
tap_code16(KC_LOCK);
#if defined(HAS_INDICATORS)
led_user = 1;
writePin(INDICATOR_PIN_2, !led_user);
wait_ms(200);
writePin(INDICATOR_PIN_1, !led_user);
wait_ms(200);
writePin(INDICATOR_PIN_0, !led_user);
#endif
break;
}
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK),
[TD_WIN] = ACTION_TAP_DANCE_FN(lock_unlock),
[TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV),
[TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset)
};