diff options
author | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 10:59:35 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-06-12 10:59:35 -0400 |
commit | 998ddbb122c9d3e2a77bd4e88c881b225ca0d569 (patch) | |
tree | ca91ff7ad3c4866555d1e623fe9ea05276397e1c /users/kuatsure/kuatsure.c | |
parent | c0095710a7c7e9bd94aa9f4dd814dc28d718c731 (diff) | |
parent | 06487daaddf923d635e8a528d1eb644b875a73f6 (diff) |
Merge branch 'master' of github.com:qmk/qmk_firmware into hf/shinydox
Diffstat (limited to 'users/kuatsure/kuatsure.c')
-rw-r--r-- | users/kuatsure/kuatsure.c | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/users/kuatsure/kuatsure.c b/users/kuatsure/kuatsure.c new file mode 100644 index 0000000000..a18713626e --- /dev/null +++ b/users/kuatsure/kuatsure.c @@ -0,0 +1,111 @@ +#include "kuatsure.h" + +void tmux_prefix(void) { + register_code(KC_LCTL); + register_code(KC_SPC); + + unregister_code(KC_LCTL); + unregister_code(KC_SPC); +} + +void tmux_pane_zoom(void) { + tmux_prefix(); + + register_code(KC_Z); + unregister_code(KC_Z); +} + +void tmux_pane_switch(uint16_t keycode) { + tmux_prefix(); + + register_code(KC_Q); + unregister_code(KC_Q); + + register_code(keycode); + unregister_code(keycode); +} + +void tmux_window_switch(uint16_t keycode) { + tmux_prefix(); + + register_code(keycode); + unregister_code(keycode); +} + +LEADER_EXTERNS(); +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + // Available seqs + // SEQ_ONE_KEY, SEQ_TWO_KEYS, SEQ_THREE_KEYS + // anything you can do in a macro https://docs.qmk.fm/macros.html + // https://docs.qmk.fm/feature_leader_key.html + + // Whole Screen Shot + SEQ_ONE_KEY(KC_A) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_3); + + unregister_code(KC_3); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + + // Selective Screen Shot + SEQ_ONE_KEY(KC_S) { + register_code(KC_LGUI); + register_code(KC_LSFT); + register_code(KC_4); + + unregister_code(KC_4); + unregister_code(KC_LSFT); + unregister_code(KC_LGUI); + } + + // TMUX - shift to pane 1 and zoom + SEQ_ONE_KEY(KC_J) { + tmux_pane_switch(KC_1); + tmux_pane_zoom(); + } + + // TMUX - shift to pane 2 and zoom + SEQ_ONE_KEY(KC_K) { + tmux_pane_switch(KC_2); + tmux_pane_zoom(); + } + + // TMUX - shift to pane 3 and zoom + SEQ_ONE_KEY(KC_L) { + tmux_pane_switch(KC_3); + tmux_pane_zoom(); + } + + // TMUX - shift to last pane and zoom + SEQ_ONE_KEY(KC_SCOLON) { + tmux_prefix(); + + register_code(KC_SCOLON); + unregister_code(KC_SCOLON); + + tmux_pane_zoom(); + } + + // TMUX - shift to first window + SEQ_ONE_KEY(KC_U) { + tmux_window_switch(KC_1); + } + + // TMUX - shift to second window + SEQ_ONE_KEY(KC_I) { + tmux_window_switch(KC_2); + } + + // TMUX - shift to third window + SEQ_ONE_KEY(KC_O) { + tmux_window_switch(KC_3); + } + } +} |