You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
963 B

  1. //instanalize an instance of 'tap' for the U - Arrows - Gui tap dance.
  2. static tap u_arrows_gui_state = {
  3. .is_press_action = true,
  4. .state = 0
  5. };
  6. void u_arrows_gui_finished(tap_dance_state_t *state, void *user_data) {
  7. u_arrows_gui_state.state = current_dance(state);
  8. switch (u_arrows_gui_state.state) {
  9. case SINGLE_TAP:
  10. register_code(KC_U);
  11. break;
  12. case SINGLE_HOLD:
  13. layer_on(ARROWS);
  14. break;
  15. case DOUBLE_HOLD:
  16. register_code(KC_LGUI);
  17. break;
  18. }
  19. }
  20. void u_arrows_gui_reset(tap_dance_state_t *state, void *user_data) {
  21. switch (u_arrows_gui_state.state) {
  22. case SINGLE_TAP:
  23. unregister_code(KC_U);
  24. break;
  25. case SINGLE_HOLD:
  26. layer_off(ARROWS);
  27. break;
  28. case DOUBLE_HOLD:
  29. unregister_code(KC_LGUI);
  30. break;
  31. }
  32. u_arrows_gui_state.state = 0;
  33. }