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.

116 lines
2.8 KiB

[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
[Keymap] Update to userspace kuchosauroand0 (#6596) * added combos * minor adjustments, added combos * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Add second encoder, add modifiers to encoders Added a skeleton for the possibily having a second encoder. Added 9 modifiers for the first rotary encoder: - None General navigation. Page up/down - SHIFT Fast navigation. Home/end - CTRL Vertical navigation. Up/down - CTRL+SHIFT Horizontal navigation. Left/right - ALT Audio volume control. - GUI Browser navigation(windows). Forward/backward - ALT+SHIFT Form navigation. Tab up/down - ALT+CTRL Media control. (Play|pause)/mute - HYPER Media navigation. Next/prev track Key codes are stored in `uint16_t encoder_actions[2][9]` * Clean up; added combos Combos: - CV: Copy - XC: Cut - ZV: Paste - QP: KC_SLEEP * Fix LEADER_DICTIONARY to be more useful * Add documentation * Minor fixes * Raise TAPPING_TERM * testing * Rearrange modifiers * Fix kc being stored in uint8 instead of uint16 * Update documentation * Clean up * Remove excess comments * Put encoder_actions in progmem
4 years ago
  1. #include "leader.h"
  2. #ifdef RGBLIGHT_ENABLE
  3. extern rgblight_config_t rgblight_config;
  4. #endif
  5. bool leader_succeed;
  6. LEADER_EXTERNS();
  7. void matrix_scan_user(void) {
  8. static bool has_ran_yet;
  9. if (!has_ran_yet) {
  10. has_ran_yet = true;
  11. startup_user();
  12. }
  13. #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
  14. // run_diablo_macro_check();
  15. #endif
  16. #ifdef RGBLIGHT_ENABLE
  17. matrix_scan_rgb();
  18. #endif
  19. LEADER_DICTIONARY() {
  20. leader_succeed = leading = false;
  21. SEQ_ONE_KEY(KC_W) {
  22. // vim/tmux: Use in command mode in vim: write to file, switch tmux pane in the current session window and repeat the last command
  23. SEND_STRING(":w" SS_TAP(X_ENTER));
  24. tmux_pane_switch_repeat();
  25. leader_succeed = true;
  26. } else
  27. SEQ_ONE_KEY(KC_T) {
  28. // Send the Tmux Prefix
  29. tmux_prefix();
  30. leader_succeed = true;
  31. } else
  32. SEQ_ONE_KEY(KC_A) {
  33. // tmux: Send the prefix and press 'right' arrow
  34. tmux_prefix();
  35. tap_code(KC_RIGHT);
  36. leader_succeed = true;
  37. } else
  38. SEQ_TWO_KEYS(KC_T, KC_T) {
  39. // tmux: Send the prefix to a nested session
  40. tmux_prefix();
  41. tmux_prefix();
  42. leader_succeed = true;
  43. } else
  44. SEQ_TWO_KEYS(KC_T, KC_R) {
  45. // tmux: Switch pane and repeat last action
  46. tmux_pane_switch_repeat();
  47. leader_succeed = true;
  48. } else
  49. SEQ_TWO_KEYS(KC_V, KC_Z){
  50. // vim: Zoom pane
  51. tap_code16(LCTL(KC_W));
  52. tap_code16(LSFT(KC_BSLS));
  53. leader_succeed = true;
  54. } else
  55. SEQ_TWO_KEYS(KC_V, KC_R) {
  56. // vim: Substitute and place cursor
  57. SEND_STRING(":%s///g" SS_TAP(X_LEFT));
  58. tap_code(KC_LEFT);
  59. tap_code(KC_LEFT);
  60. leader_succeed = true;
  61. } else
  62. SEQ_TWO_KEYS(KC_V, KC_T) {
  63. // vim: move current pane to new tab
  64. tap_code16(LCTL(KC_W));
  65. tap_code16(LSFT(KC_T));
  66. leader_succeed = true;
  67. } else
  68. SEQ_ONE_KEY(KC_R){
  69. // Toggle RGB Layer indicator
  70. tap_code16(KC_RGB_T);
  71. leader_succeed = true;
  72. } else
  73. SEQ_ONE_KEY(KC_SPC){
  74. // One Shot Unicode layer
  75. //TODO tap_code16(OS_UNI);
  76. leader_succeed = true;
  77. } else
  78. SEQ_TWO_KEYS(KC_SPC, KC_SPC){
  79. // Toggle _MODS
  80. tap_code16(TG_MODS);
  81. leader_succeed = true;
  82. } else
  83. SEQ_THREE_KEYS(KC_BSPC, KC_BSPC, KC_BSPC){
  84. // Reset the keyboard
  85. reset_keyboard();
  86. leader_succeed = true;
  87. }
  88. leader_end();
  89. }
  90. // matrix_scan_keymap();
  91. }
  92. void leader_start(void) {
  93. #ifdef RGBLIGHT_ENABLE
  94. rgblight_savebase();
  95. rgblight_mode_noeeprom(1);
  96. rgblight_sethsv_noeeprom_goldenrod();
  97. #endif
  98. }
  99. void leader_end(void) {
  100. // pick color depending of success /fail
  101. // fade leader_start from 100 to 0
  102. // fade new color from 0 to 100 to 0
  103. // fade old color from 0 to 100
  104. #ifdef RGBLIGHT_ENABLE
  105. if (leader_succeed) {
  106. fadeflash_leds(HSV_GREEN);
  107. } else {
  108. fadeflash_leds(HSV_RED);
  109. }
  110. #endif
  111. }