summaryrefslogtreecommitdiffstats
path: root/users/stanrc85/stanrc85.c
diff options
context:
space:
mode:
authorstanrc85 <47038504+stanrc85@users.noreply.github.com>2020-09-06 18:04:29 -0400
committerGitHub <noreply@github.com>2020-09-06 15:04:29 -0700
commit6c3e404839bec5f04e8f0d9eef4f0ac98b16e987 (patch)
tree05d19ae0db38079c61807710c0b8b48bf8b71525 /users/stanrc85/stanrc85.c
parentf7ccbfcea88e127319a4665a6c8ca67883854030 (diff)
[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
Diffstat (limited to 'users/stanrc85/stanrc85.c')
-rw-r--r--users/stanrc85/stanrc85.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c
index c1aaad1a1a..2dbd41974b 100644
--- a/users/stanrc85/stanrc85.c
+++ b/users/stanrc85/stanrc85.c
@@ -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)
};