defines.h 17 KB

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