nstickney.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "nstickney.h"
  2. // Tap Dancing
  3. void dance_layer (qk_tap_dance_state_t *state, void *user_data) {
  4. switch (state -> count) {
  5. case 1: tap_code(KC_APP); break;
  6. case 2: layer_invert(NUMP); break;
  7. case 3: layer_invert(SYMB); break;
  8. case 4: layer_invert(SYSH); break;
  9. default: break;
  10. }
  11. };
  12. void dance_lock_finished (qk_tap_dance_state_t *state, void *user_data) {
  13. switch (state->count) {
  14. case 1: register_code(KC_LGUI); break;
  15. case 2: register_code(KC_NLCK); break;
  16. case 3: register_code(KC_CAPS); break;
  17. case 4: register_code(KC_SLCK); break;
  18. default: break;
  19. }
  20. };
  21. void dance_lock_reset (qk_tap_dance_state_t *state, void *user_data) {
  22. switch (state->count) {
  23. case 1: unregister_code(KC_LGUI); break;
  24. case 2: unregister_code(KC_NLCK); break;
  25. case 3: register_code(KC_CAPS); break;
  26. case 4: register_code(KC_SLCK); break;
  27. default: break;
  28. }
  29. };
  30. qk_tap_dance_action_t tap_dance_actions[] = {
  31. [LOCKS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_lock_finished, dance_lock_reset),
  32. [LAYERS] = ACTION_TAP_DANCE_FN(dance_layer)
  33. };
  34. void eeconfig_init_user (void) {
  35. set_unicode_input_mode(UC_LNX); // Linux
  36. //set_unicode_input_mode(UC_OSX); // Mac OSX
  37. //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
  38. //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
  39. };