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.

247 lines
6.4 KiB

  1. #ifndef GORDON
  2. #define GORDON
  3. #include "quantum.h"
  4. #include "process_keycode/process_tap_dance.h"
  5. // Fillers to make layering more clear
  6. #define ________ KC_TRNS
  7. #define _________ KC_TRNS
  8. #define _XXXXXX_ KC_TRNS
  9. // KC codes that are too long
  10. #define DOLLAR KC_DOLLAR
  11. #define LSQUIGLY KC_LBRACKET
  12. #define RSQUIGLY KC_RBRACKET
  13. #define NUMLOCK KC_NUMLOCK
  14. #define CAPLOCK KC_CAPSLOCK
  15. #define BK_SLASH KC_BSLASH
  16. #define ASTERSK KC_KP_ASTERISK
  17. // Navigation
  18. #define SNAPLEFT LGUI(KC_LEFT)
  19. #define SNAPRGHT LGUI(KC_RIGHT)
  20. #define SNAPUP LGUI(KC_UP)
  21. #define SNAPDOWN LGUI(KC_DOWN)
  22. #define PREVTAB LCTL(LSFT(KC_TAB))
  23. #define NEXTTAB LCTL(KC_TAB)
  24. #define WORKRIGHT LCTL(LGUI(KC_RIGHT))
  25. #define WORKLEFT LCTL(LGUI(KC_LEFT))
  26. #define APP_1 LCTL(LGUI(KC_1))
  27. #define APP_2 LCTL(LGUI(KC_2))
  28. #define APP_3 LCTL(LGUI(KC_3))
  29. #define APP_4 LCTL(LGUI(KC_4))
  30. #define APP_5 LCTL(LGUI(KC_5))
  31. #define APP_6 LCTL(LGUI(KC_6))
  32. #define APP_7 LCTL(LGUI(KC_7))
  33. #define APP_8 LCTL(LGUI(KC_8))
  34. // KC/modifier hold
  35. #define CTRL_F CTL_T(KC_F)
  36. #define CTRL_J CTL_T(KC_J)
  37. #define CTRL_Z CTL_T(KC_Z)
  38. #define ALT_V ALT_T(KC_V)
  39. #define ALT_M ALT_T(KC_M)
  40. #define WIN_G GUI_T(KC_G)
  41. #define WIN_H GUI_T(KC_H)
  42. #define HYPER_X ALL_T(KC_X)
  43. #define HYPE_DOT ALL_T(KC_DOT)
  44. #define MEH_S MEH_T(KC_S)
  45. #define MEH_L MEH_T(KC_L)
  46. #define ALT_HOME ALT_T(KC_HOME)
  47. // KC/Layer Hold
  48. #define NAV_E LT(_NAV,KC_E)
  49. #define NUMPAD_D LT(_NUMPAD,KC_D)
  50. #define MOUSE_C LT(_MOUSE,KC_C)
  51. #define SYMB_BSP LT(_SYMBOLS,KC_BSPACE)
  52. #define COL_MOUS LT(_MOUSE,KC_SCOLON)
  53. #define SPAC_SYM LT(_SYMBOLS,KC_SPACE)
  54. #define SPAC_TXT LT(_TEXTNAV,KC_SPACE)
  55. #define APP_SW_I LT(_APPSWITCH,KC_I)
  56. #define APP_SW_K LT(_APPSWITCH,KC_K)
  57. // #define TLSLSH TIL_SLASH
  58. // #define TILDA_3x TILD3
  59. // #define _RESET_ UP_ENTER_RESET
  60. // Double Modifier ONLY hold
  61. #define ALT_SHFT LSFT(KC_LALT)
  62. #define CTR_SHFT LSFT(KC_LCTL)
  63. // KC/Double modifier Hold
  64. #define CTR_SH_W MT(MOD_LCTL|MOD_LSFT,KC_W)
  65. #define CTR_AL_R MT(MOD_LCTL|MOD_LALT,KC_R)
  66. #define ALT_SH_R MT(MOD_LSFT|MOD_LALT,KC_R)
  67. //MISC
  68. #define PRINTSCR KC_PSCREEN
  69. #define CALTDEL LCTL(LALT(KC_DEL))
  70. #define TSKMGR LCTL(LSFT(KC_ESC))
  71. typedef struct {
  72. bool is_press_action;
  73. int state;
  74. } xtap;
  75. enum {
  76. SINGLE_TAP = 1,
  77. SINGLE_HOLD = 2,
  78. DOUBLE_TAP = 3,
  79. DOUBLE_HOLD = 4,
  80. DOUBLE_SINGLE_TAP = 5, //send two single taps
  81. TRIPLE_TAP = 6,
  82. TRIPLE_HOLD = 7
  83. };
  84. //Tap dance enums
  85. enum
  86. {
  87. F12TAP = 0,
  88. F12ETAPS,
  89. CALCCOMP,
  90. REFRESH, //send R, or Control+R if double tapped.
  91. ENDESC,
  92. XESC, //'quad function'. x, control, escape, alt
  93. ALY2, //'quad function': a, Hyper, ctrl+a, layer 2
  94. PRLOCK,
  95. F6F7, // Shift F6 or Alt F7
  96. TABCOMBO,
  97. FCTRL,
  98. F3D,
  99. ALTF4,
  100. COMMA,
  101. AT,
  102. HTAB,
  103. F1F13,
  104. F2F14,
  105. F5F15,
  106. ENDHOME,
  107. Q_ESCAPE
  108. };
  109. #ifdef TAP_DANCE_ENABLE
  110. #define F1_F13 TD(F1F13)
  111. #define F2_F14 TD(F2F14)
  112. #define F5_F15 TD(F5F15)
  113. #define F4_ALTF4 TD(ALTF4)
  114. #define END_ESC TD(ENDESC)
  115. #define Q_ESC TD(Q_ESCAPE)
  116. #define END_HOME TD(ENDHOME)
  117. #define SHF6_AF7 TD(F6F7)
  118. #define F12_RUN TD(F12ETAPS)
  119. #define COMMA_TD TD(COMMA)
  120. #define CALC_COM TD(CALCCOMP)
  121. #else //just to make things compile
  122. #define F1_F13 KC_1
  123. #define F2_F14 KC_1
  124. #define F5_F15 KC_1
  125. #define F4_ALTF4 KC_1
  126. #define END_ESC KC_1
  127. #define END_HOME KC_1
  128. #define SHF6_AF7 KC_1
  129. #define F12_RUN KC_1
  130. #define COMMA_TD KC_1
  131. #define CALC_COM KC_1
  132. #endif
  133. enum gordon_layers
  134. {
  135. _QWERTY = 0,
  136. _SYMBOLS, // Programming and all other commonlye used symbols
  137. _MOUSE, // Mouse movement and also a few macros
  138. _NUMPAD, // For getting a numpad under the right hand, and a few helpful things under the left
  139. _NAV, // Windows navigation. Windows snapping, changing workspaces, and ARROWS
  140. _MACROS, // Non-text related Macros.
  141. _FUNCTION, // Not sure what I had in mind for this one
  142. _APPSWITCH, // For switching between apps using the `ctrl + Win + [num]` shortcut.
  143. // This allows for toggling windows of the same app with one button.
  144. // Example: Press and hold `I`, then tap `j` multiple times to cycle through all
  145. // Intellij windows (and only Intellij). This requires the app to be pinned to the Windows bar
  146. _ONESHOT, // A layer I use for shortcuts that require multiple modifiers and a button not on my home layer
  147. // Example: If I need to hit `alt + shift + 5`
  148. _TEXTNAV, // Navigate through text
  149. _QWERTY_KIDS, // So my kids can do nothing but type. Could also be a `speed typing` layer with no LT or MTs
  150. _STREET_FIGHTER, // For Street Fighter 5. Die 1000x Deaths!!!!
  151. _DIRNAV, // For navigating to different directories.
  152. _TEXT_MACROS // For text-manipulation macros. Passwords, saved strings, pre-formatting
  153. };
  154. void register_hyper (void);
  155. void unregister_hyper (void);
  156. void register_ctrl_a (void);
  157. void unregister_ctrl_a (void);
  158. void register_alt_f7 (void);
  159. void unregister_alt_f7 (void);
  160. void register_shift_f6 (void);
  161. void unregister_shift_f6 (void);
  162. void register_ctrl_shift (void);
  163. void unregister_ctrl_shift (void);
  164. void register_alt_shift (void);
  165. void unregister_alt_shift (void);
  166. int cur_dance (qk_tap_dance_state_t *state);
  167. int hold_cur_dance (qk_tap_dance_state_t *state);
  168. void x_finished (qk_tap_dance_state_t *state, void *user_data);
  169. void x_reset (qk_tap_dance_state_t *state, void *user_data);
  170. void h_finished (qk_tap_dance_state_t *state, void *user_data);
  171. void h_reset (qk_tap_dance_state_t *state, void *user_data);
  172. void tab_finished (qk_tap_dance_state_t *state, void *user_data);
  173. void tab_reset (qk_tap_dance_state_t *state, void *user_data);
  174. void comma_finished (qk_tap_dance_state_t *state, void *user_data);
  175. void comma_reset (qk_tap_dance_state_t *state, void *user_data);
  176. void bt_finished (qk_tap_dance_state_t *state, void *user_data);
  177. void bt_reset (qk_tap_dance_state_t *state, void *user_data);
  178. enum secret_strings {
  179. KC_SECRET_1 = SAFE_RANGE,
  180. KC_SECRET_2,
  181. KC_SECRET_3,
  182. KC_SECRET_4,
  183. KC_SECRET_5,
  184. END_SECRET_SAFE_RANGE
  185. };
  186. // Macro Declarations
  187. enum {
  188. INFOQM = END_SECRET_SAFE_RANGE,
  189. MODRESET,
  190. TIL_SLASH,
  191. DEREF,
  192. EQRIGHT,
  193. TILD3,
  194. TICK3,
  195. SPRK_TCK,
  196. ALTTAB_START,
  197. ALTTAB_END,
  198. UP_ENTER_RESET,
  199. DBMS_OUT,
  200. DIE_1000X_RIGHT,
  201. DIE_1000X_LEFT,
  202. ID_MAN_IP
  203. };
  204. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
  205. #endif