defines.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. #pragma once
  2. #include "csc027.h"
  3. #define MC_RSFE RSFT_T(KC_ENT) // Right Shift on hold, Enter on tap
  4. #define MC_LSEC LSFT_T(KC_ESC) // Left Shift on hold, Escape on tap
  5. #define ________________ KC_TRNS
  6. /* QWERTY Layer
  7. *
  8. * The basic layer of this keymap is a QWERTY layer.
  9. *
  10. * - Modifier keys more closely resemble a standard keyboard's layout.
  11. * - There is a "Nxt L" function that cycles through the QWERTY and
  12. * game layers. This has been implemented by hard coding the jump to the
  13. * next layer in each of the layers using the TO() macro. Currently, the
  14. * "Nxt L" function skips over the momentary layers (i.e., Mouse, Git,
  15. * Lower, Raise, and Convenience layers).
  16. * - There is a "Rst L" function that resets the current layer to the
  17. * QWERTY layer.
  18. * - The "Git" one shot function goes to the macro layer which has Git
  19. * commands implemented.
  20. * - The Right Shift key also doubles as an Enter key if it is tapped rather
  21. * than held.
  22. *
  23. * ,-----------------------------------. ,-----------------------------------.
  24. * | Tab | Q | W | E | R | T | | Y | U | I | O | P |BkSpc|
  25. * |-----------------------------------| |-----------------------------------|
  26. * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' |
  27. * |-----------------------------------| |-----------------------------------|
  28. * |Shift| Z | X | C | V | B | | N | M | , | . | / |Sf/En|
  29. * |-----------------------------------| |-----------------------------------|
  30. * |Cntrl|Super| Alt |Convc|Lower|Space| |Space|Raise| \ | Git |Nxt L|Rst L|
  31. * `-----------------------------------' `-----------------------------------'
  32. */
  33. #define _____________________QWERTY_L1_____________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
  34. #define _____________________QWERTY_L2_____________________ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G
  35. #define _____________________QWERTY_L3_____________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
  36. #define _____________________QWERTY_L4_____________________ KC_LCTL, KC_LGUI, KC_LALT, MO(_CN), LOWER, KC_SPC
  37. #define _____________________QWERTY_R1_____________________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC
  38. #define _____________________QWERTY_R2_____________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT
  39. #define _____________________QWERTY_R3_____________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MC_RSFE
  40. #define _____________________QWERTY_R4_____________________ KC_SPC, RAISE, KC_BSLS, OSL(_GT), TO(_GG), XXXXXXX
  41. /* Raise Layer
  42. *
  43. * The Raise layer accommodates the Home, End, Page Up, and Page Down keys
  44. * in what would be the Vim arrow keys positions. This is done as opposed
  45. * to using C-D, C-U, 0, $, and ^, because it would require a separate layer.
  46. *
  47. * - The top row has the shifted versions of the number row, rather than the
  48. * numbers themselves. This is a change to have a mnemonic where shifted
  49. * elements are on the Raise layer. This also makes it easy to use some of
  50. * Vim style movement controls (e.g. $, %), but makes it harder for others
  51. * (e.g. ^, (, )). Consider swapping the number row with the shifted number
  52. * row if you do not care about the mnemonic.
  53. * - The Left Brace, Right Brace, Underscore, and Plus keys have been moved
  54. * from the right side to the left side. This will take some getting used
  55. * to, as these keys are normally on the right side of the keyboard. An
  56. * alternative would be to keep the keys on the right hand side just under
  57. * the Parentheses. This would prevent the use of Vim arrow keys however.
  58. * - The F keys have been laid across the bottom in the Raise layer, rather
  59. * than the Lower layer to allow easy access to the Alt-F4 chord for
  60. * Windows. When the F keys were put in the Lower layer, it made it hard
  61. * to use this chord, as the Lower key, the Alt key, and the F4 key were
  62. * all right next to each other.
  63. * - A Delete key has been added in this layer to allow easy access to the
  64. * Control-Alt-Delete login chord for Windows.
  65. *
  66. * ,-----------------------------------. ,-----------------------------------.
  67. * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del |
  68. * |-----------------------------------| |-----------------------------------|
  69. * | | _ | + | { | } | Caps| | Home| PgDn| PgUp| End | | |
  70. * |-----------------------------------| |-----------------------------------|
  71. * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | |
  72. * |-----------------------------------| |-----------------------------------|
  73. * | | | | | | | | | | | | | |
  74. * `-----------------------------------' `-----------------------------------'
  75. */
  76. #define ______________________RAISE_L1_____________________ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
  77. #define ______________________RAISE_L2_____________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_CAPS
  78. #define ______________________RAISE_L3_____________________ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
  79. #define ______________________RAISE_L4_____________________ _______, _______, _______, _______, _______, _______
  80. #define ______________________RAISE_R1_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT
  81. #define ______________________RAISE_R2_____________________ KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX
  82. #define ______________________RAISE_R3_____________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______
  83. #define ______________________RAISE_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX
  84. /* Lower Layer
  85. *
  86. * The lower layout scheme accommodates the Vim style arrow keys.
  87. *
  88. * - The arrow keys are in the normal Vim positions.
  89. * - The Left Square Bracket, Right Square Bracket, Minus, and Equal keys
  90. * have been moved from the right side to the left side. This will take
  91. * some getting used to, as it is on the left rather than the right.
  92. * - A Delete key has been added in this layer to allow easy access to the
  93. * Control-Alt-Delete login chord for Windows.
  94. * - The remaining F keys are in this layer.
  95. *
  96. * ,-----------------------------------. ,-----------------------------------.
  97. * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
  98. * |-----------------------------------| |-----------------------------------|
  99. * | | - | = | [ | ] | | | Left| Down| Up |Right| | |
  100. * |-----------------------------------| |-----------------------------------|
  101. * | | F11 | F12 | | | | | | | | | | |
  102. * |-----------------------------------| |-----------------------------------|
  103. * | | | | | | | | | | | | | |
  104. * `-----------------------------------' `-----------------------------------'
  105. */
  106. #define ______________________LOWER_L1_____________________ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5
  107. #define ______________________LOWER_L2_____________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX
  108. #define ______________________LOWER_L3_____________________ _______, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX
  109. #define ______________________LOWER_L4_____________________ _______, _______, _______, _______, _______, _______
  110. #define ______________________LOWER_R1_____________________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT
  111. #define ______________________LOWER_R2_____________________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX
  112. #define ______________________LOWER_R3_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
  113. #define ______________________LOWER_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX
  114. /* MIT Layout (Mouse)
  115. *
  116. * The mouse layer adds keys to use the keyboard like a mouse.
  117. *
  118. * ,-----------------------------------. ,-----------------------------------.
  119. * | | | | | | | | | | | | | |
  120. * |-----------------------------------| |-----------------------------------|
  121. * | | | |Ms-Lc|Ms-Rc| | | Ms-L| Ms-D| Ms-U| Ms-R| | |
  122. * |-----------------------------------| |-----------------------------------|
  123. * | | | | | | | | | | | | | |
  124. * |-----------------------------------| |-----------------------------------|
  125. * | | | | | | | | | | | | | |
  126. * `-----------------------------------' `-----------------------------------'
  127. */
  128. #define ______________________MOUSE_L1_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  129. #define ______________________MOUSE_L2_____________________ _______, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX
  130. #define ______________________MOUSE_L3_____________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  131. #define ______________________MOUSE_L4_____________________ _______, _______, _______, _______, _______, _______
  132. #define ______________________MOUSE_R1_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  133. #define ______________________MOUSE_R2_____________________ KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, XXXXXXX
  134. #define ______________________MOUSE_R3_____________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
  135. #define ______________________MOUSE_R4_____________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX
  136. /* MIT Layout (Git)
  137. *
  138. * The macro layer that has common git commands.
  139. *
  140. * ,-----------------------------------. ,-----------------------------------.
  141. * | |Chery| Show|Rebas|Reset| Tag | | | Pull| Init|Rmote| Push| |
  142. * |-----------------------------------| |-----------------------------------|
  143. * | | Add |Sttus| Diff|Fetch| Grep| |Stash| |ChkOt| Log | | |
  144. * |-----------------------------------| |-----------------------------------|
  145. * | | | |Comit| Move|Brnch| | |Merge| | | | |
  146. * |-----------------------------------| |-----------------------------------|
  147. * | | | | | | | | | | | | | |
  148. * `-----------------------------------' `-----------------------------------'
  149. */
  150. #define _______________________GIT_L1______________________ XXXXXXX, MC_cherrypick, MC_show, MC_rebase, MC_reset, MC_tag
  151. #define _______________________GIT_L2______________________ _______, MC_add, MC_status, MC_diff, MC_fetch, MC_grep
  152. #define _______________________GIT_L3______________________ _______, XXXXXXX, XXXXXXX, MC_commit, MC_mv, MC_branch
  153. #define _______________________GIT_L4______________________ _______, _______, _______, _______, _______, _______
  154. #define _______________________GIT_R1______________________ XXXXXXX, MC_pull, MC_init, MC_remote, MC_push, XXXXXXX
  155. #define _______________________GIT_R2______________________ MC_stash, XXXXXXX, MC_checkout, MC_log, XXXXXXX, XXXXXXX
  156. #define _______________________GIT_R3______________________ XXXXXXX, MC_merge, XXXXXXX, XXXXXXX, XXXXXXX, _______
  157. #define _______________________GIT_R4______________________ _______, _______, _______, _______, XXXXXXX, XXXXXXX
  158. /* MIT Layout (Convenience)
  159. *
  160. * The Convenience layer adds miscellaneous chords to the keyboard.
  161. *
  162. * - The Number Lock key is physically in the same spot as the Caps Lock key
  163. * in the raise layer.
  164. * - There is also a Backspace Key for convenience.
  165. * - There is a convenience macro to type the Control-Alt-Delete login chord for Windows.
  166. * - There is a convenience macro to switch context from the Remote Desktop to the local
  167. * machine in Windows.
  168. * - There are convenience macros to switch between virtual desktops in Windows.
  169. * - There are convenience macros to create and delete virtual desktops in Windows.
  170. *
  171. * ,-----------------------------------. ,-----------------------------------.
  172. * | | |Insrt|ScrLk|PrtSc| | | | | | | |BkSpc|
  173. * |-----------------------------------| |-----------------------------------|
  174. * | | | App | LCAD|MRDCC|NmLck| |MVTDL|MVTDC|MVTDN|MVTDR| | |
  175. * |-----------------------------------| |-----------------------------------|
  176. * | | | | | | | | | | | | | |
  177. * |-----------------------------------| |-----------------------------------|
  178. * | | | | | | | | | | | | | |
  179. * `-----------------------------------' `-----------------------------------'
  180. */
  181. #define ___________________CONVENIENCE_L1__________________ XXXXXXX, XXXXXXX, KC_INS, KC_SLCK, KC_PSCR, XXXXXXX
  182. #define ___________________CONVENIENCE_L2__________________ _______, XXXXXXX, KC_APP, MC_lcad, MC_rdcc, KC_NLCK
  183. #define ___________________CONVENIENCE_L3__________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  184. #define ___________________CONVENIENCE_L4__________________ _______, _______, _______, _______, _______, _______
  185. #define ___________________CONVENIENCE_R1__________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC
  186. #define ___________________CONVENIENCE_R2__________________ MC_vtdl, MC_vtdc, MC_vtdn, MC_vtdr, XXXXXXX, XXXXXXX
  187. #define ___________________CONVENIENCE_R3__________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
  188. #define ___________________CONVENIENCE_R4__________________ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  189. /* General Game Layer
  190. *
  191. * ,-----------------------------------. ,-----------------------------------.
  192. * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |BkSpc|
  193. * |-----------------------------------| |-----------------------------------|
  194. * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ |
  195. * |-----------------------------------| |-----------------------------------|
  196. * |Sf/Ec| A | S | D | F | G | | H | J | K | L | ; |Enter|
  197. * |-----------------------------------| |-----------------------------------|
  198. * | Ctl | Z | Alt | X | C |Space| |Space| M | B | . |Nxt L|Rst L|
  199. * `-----------------------------------' `-----------------------------------'
  200. */
  201. #define ________________General_Game_4x12_L1_______________ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5
  202. #define ________________General_Game_4x12_L2_______________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
  203. #define ________________General_Game_4x12_L3_______________ MC_LSEC, KC_A, KC_S, KC_D, KC_F, KC_G
  204. #define ________________General_Game_4x12_L4_______________ KC_LCTL, KC_Z, KC_LALT, KC_X, KC_C, KC_SPC
  205. #define ________________General_Game_4x12_R1_______________ KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC
  206. #define ________________General_Game_4x12_R2_______________ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS
  207. #define ________________General_Game_4x12_R3_______________ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT
  208. #define ________________General_Game_4x12_R4_______________ KC_SPC, KC_M, KC_B, KC_DOT, TO(_CS), TO(_QW)
  209. /* CS:GO Layer
  210. *
  211. * ,-----------------------------------. ,-----------------------------------.
  212. * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |BkSpc|
  213. * |-----------------------------------| |-----------------------------------|
  214. * | Tab | Q | W | E | R | T | | Y | 4 | 5 | 6 | |NmLck|
  215. * |-----------------------------------| |-----------------------------------|
  216. * |Shift| A | S | D | F | G | | H | 1 | 2 | 3 |Enter| Esc |
  217. * |-----------------------------------| |-----------------------------------|
  218. * | Ctl | Z | Alt | X | B |Space| |Space| 0 | 0 | . |Nxt L|Rst L|
  219. * `-----------------------------------' `-----------------------------------'
  220. */
  221. #define ___________________CSGO_4x12_L1____________________ XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5
  222. #define ___________________CSGO_4x12_L2____________________ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
  223. #define ___________________CSGO_4x12_L3____________________ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G
  224. #define ___________________CSGO_4x12_L4____________________ KC_LCTL, KC_Z, KC_LALT, KC_X, KC_B, KC_SPC
  225. #define ___________________CSGO_4x12_R1____________________ KC_6, KC_P7, KC_P8, KC_P9, KC_0, KC_BSPC
  226. #define ___________________CSGO_4x12_R2____________________ KC_Y, KC_P4, KC_P5, KC_P6, XXXXXXX, KC_NLCK
  227. #define ___________________CSGO_4x12_R3____________________ KC_H, KC_P1, KC_P2, KC_P3, KC_PENT, KC_ESC
  228. #define ___________________CSGO_4x12_R4____________________ KC_SPC, KC_P0, KC_P0, KC_PDOT, TO(_QW), TO(_QW)
  229. /* Convenience macros
  230. *
  231. * These are accelerator macros for simplifying declaration of PROGMEM strings
  232. */
  233. // Declare variable name
  234. #define CUSTOM_VAR(VAR) mc_##VAR
  235. // Declare PROGMEM string using the variable name
  236. #define CUSTOM_DEF(VAR) const char CUSTOM_VAR(VAR)[] PROGMEM =
  237. // Declare enum name
  238. #define CUSTOM_ENUM(VAR) MC_##VAR
  239. #define CUSTOM_MACRO_STRING(X) X
  240. #define COMMA_DELIM(...) ,
  241. #define SEMI_DELIM(...) ;
  242. #define DROP(...)
  243. /* Keycode synchronization macros
  244. *
  245. * These macros help synchronize the keycodes between the string declaration, string pointer declaration, and enum order.
  246. */
  247. #define CUSTOM_MACROS(CUSTOM_NAME, CUSTOM_STRING, CUSTOM_DELIM) \
  248. CUSTOM_NAME(add) CUSTOM_STRING("git add ") CUSTOM_DELIM() \
  249. CUSTOM_NAME(branch) CUSTOM_STRING("git branch ") CUSTOM_DELIM() \
  250. CUSTOM_NAME(checkout) CUSTOM_STRING("git checkout ") CUSTOM_DELIM() \
  251. CUSTOM_NAME(cherrypick) CUSTOM_STRING("git cherry-pick ") CUSTOM_DELIM() \
  252. CUSTOM_NAME(commit) CUSTOM_STRING("git commit -m \"\""SS_TAP(X_LEFT)) CUSTOM_DELIM() \
  253. CUSTOM_NAME(diff) CUSTOM_STRING("git diff ") CUSTOM_DELIM() \
  254. CUSTOM_NAME(fetch) CUSTOM_STRING("git fetch ") CUSTOM_DELIM() \
  255. CUSTOM_NAME(grep) CUSTOM_STRING("git grep ") CUSTOM_DELIM() \
  256. CUSTOM_NAME(log) CUSTOM_STRING("git log --decorate --oneline --graph ") CUSTOM_DELIM() \
  257. CUSTOM_NAME(init) CUSTOM_STRING("git init ") CUSTOM_DELIM() \
  258. CUSTOM_NAME(mv) CUSTOM_STRING("git mv ") CUSTOM_DELIM() \
  259. CUSTOM_NAME(merge) CUSTOM_STRING("git merge ") CUSTOM_DELIM() \
  260. CUSTOM_NAME(push) CUSTOM_STRING("git push ") CUSTOM_DELIM() \
  261. CUSTOM_NAME(pull) CUSTOM_STRING("git pull ") CUSTOM_DELIM() \
  262. CUSTOM_NAME(rebase) CUSTOM_STRING("git rebase ") CUSTOM_DELIM() \
  263. CUSTOM_NAME(remote) CUSTOM_STRING("git remote ") CUSTOM_DELIM() \
  264. CUSTOM_NAME(reset) CUSTOM_STRING("git reset ") CUSTOM_DELIM() \
  265. CUSTOM_NAME(show) CUSTOM_STRING("git show ") CUSTOM_DELIM() \
  266. CUSTOM_NAME(stash) CUSTOM_STRING("git stash ") CUSTOM_DELIM() \
  267. CUSTOM_NAME(status) CUSTOM_STRING("git status ") CUSTOM_DELIM() \
  268. CUSTOM_NAME(tag) CUSTOM_STRING("git tag ") CUSTOM_DELIM() \
  269. CUSTOM_NAME(rdcc) CUSTOM_STRING(SS_LCTL(SS_LALT(SS_TAP(X_HOME)))) CUSTOM_DELIM() \
  270. CUSTOM_NAME(lcad) CUSTOM_STRING(SS_LCTL(SS_LALT(SS_TAP(X_DELETE)))) CUSTOM_DELIM() \
  271. CUSTOM_NAME(vtdl) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_LEFT)))) CUSTOM_DELIM() \
  272. CUSTOM_NAME(vtdc) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_F4)))) CUSTOM_DELIM() \
  273. CUSTOM_NAME(vtdn) CUSTOM_STRING(SS_LCTL(SS_LGUI("d"))) CUSTOM_DELIM() \
  274. CUSTOM_NAME(vtdr) CUSTOM_STRING(SS_LCTL(SS_LGUI(SS_TAP(X_RIGHT))))