kuatsure.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #include "kuatsure.h"
  2. void tmux_prefix(void) {
  3. register_code(KC_LCTL);
  4. register_code(KC_SPC);
  5. unregister_code(KC_LCTL);
  6. unregister_code(KC_SPC);
  7. }
  8. void tmux_pane_zoom(void) {
  9. tmux_prefix();
  10. register_code(KC_Z);
  11. unregister_code(KC_Z);
  12. }
  13. void tmux_pane_switch(uint16_t keycode) {
  14. tmux_prefix();
  15. register_code(KC_Q);
  16. unregister_code(KC_Q);
  17. register_code(keycode);
  18. unregister_code(keycode);
  19. }
  20. void tmux_window_switch(uint16_t keycode) {
  21. tmux_prefix();
  22. register_code(keycode);
  23. unregister_code(keycode);
  24. }
  25. LEADER_EXTERNS();
  26. void matrix_scan_user(void) {
  27. LEADER_DICTIONARY() {
  28. leading = false;
  29. leader_end();
  30. // Available seqs
  31. // SEQ_ONE_KEY, SEQ_TWO_KEYS, SEQ_THREE_KEYS
  32. // anything you can do in a macro https://docs.qmk.fm/macros.html
  33. // https://docs.qmk.fm/feature_leader_key.html
  34. // Whole Screen Shot
  35. SEQ_ONE_KEY(KC_A) {
  36. register_code(KC_LGUI);
  37. register_code(KC_LSFT);
  38. register_code(KC_3);
  39. unregister_code(KC_3);
  40. unregister_code(KC_LSFT);
  41. unregister_code(KC_LGUI);
  42. }
  43. // Selective Screen Shot
  44. SEQ_ONE_KEY(KC_S) {
  45. register_code(KC_LGUI);
  46. register_code(KC_LSFT);
  47. register_code(KC_4);
  48. unregister_code(KC_4);
  49. unregister_code(KC_LSFT);
  50. unregister_code(KC_LGUI);
  51. }
  52. // TMUX - shift to pane 1 and zoom
  53. SEQ_ONE_KEY(KC_J) {
  54. tmux_pane_switch(KC_1);
  55. tmux_pane_zoom();
  56. }
  57. // TMUX - shift to pane 2 and zoom
  58. SEQ_ONE_KEY(KC_K) {
  59. tmux_pane_switch(KC_2);
  60. tmux_pane_zoom();
  61. }
  62. // TMUX - shift to pane 3 and zoom
  63. SEQ_ONE_KEY(KC_L) {
  64. tmux_pane_switch(KC_3);
  65. tmux_pane_zoom();
  66. }
  67. // TMUX - shift to last pane and zoom
  68. SEQ_ONE_KEY(KC_SCOLON) {
  69. tmux_prefix();
  70. register_code(KC_SCOLON);
  71. unregister_code(KC_SCOLON);
  72. tmux_pane_zoom();
  73. }
  74. // TMUX - shift to first window
  75. SEQ_ONE_KEY(KC_U) {
  76. tmux_window_switch(KC_1);
  77. }
  78. // TMUX - shift to second window
  79. SEQ_ONE_KEY(KC_I) {
  80. tmux_window_switch(KC_2);
  81. }
  82. // TMUX - shift to third window
  83. SEQ_ONE_KEY(KC_O) {
  84. tmux_window_switch(KC_3);
  85. }
  86. }
  87. }