drashna.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*
  2. Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef USERSPACE
  15. #define USERSPACE
  16. #include "quantum.h"
  17. // Define layer names
  18. enum userspace_layers {
  19. _QWERTY = 0,
  20. _NUMLOCK = 0,
  21. _COLEMAK,
  22. _DVORAK,
  23. _WORKMAN,
  24. _MODS,
  25. _NAV,
  26. _COVECUBE,
  27. _SYMB,
  28. _GAMEPAD,
  29. _DIABLO,
  30. _MOUS,
  31. _MACROS,
  32. _MEDIA,
  33. _LOWER,
  34. _RAISE,
  35. _ADJUST,
  36. };
  37. //define modifiers
  38. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  39. #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
  40. #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
  41. #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
  42. // RGB color codes are no longer located here anymore. Instead, you will want to
  43. // head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h
  44. extern bool is_overwatch;
  45. extern bool rgb_layer_change;
  46. enum userspace_custom_keycodes {
  47. EPRM = SAFE_RANGE, // can always be here
  48. VRSN,
  49. KC_QWERTY,
  50. KC_COLEMAK,
  51. KC_DVORAK,
  52. KC_WORKMAN,
  53. LOWER,
  54. RAISE,
  55. ADJUST,
  56. KC_DIABLO_CLEAR,
  57. KC_OVERWATCH,
  58. KC_SALT,
  59. KC_MORESALT,
  60. KC_SALTHARD,
  61. KC_GOODGAME,
  62. KC_SYMM,
  63. KC_JUSTGAME,
  64. KC_GLHF,
  65. KC_TORB,
  66. KC_AIM,
  67. KC_C9,
  68. KC_GGEZ,
  69. KC_MAKE,
  70. KC_RESET,
  71. KC_RGB_T,
  72. KC_SECRET_1,
  73. KC_SECRET_2,
  74. KC_SECRET_3,
  75. KC_SECRET_4,
  76. KC_SECRET_5,
  77. KC_CCCV,
  78. #ifdef UNICODE_ENABLE
  79. UC_FLIP,
  80. #endif //UNICODE_ENABLE
  81. NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
  82. };
  83. #define KC_SEC1 KC_SECRET_1
  84. #define KC_SEC2 KC_SECRET_2
  85. #define KC_SEC3 KC_SECRET_3
  86. #define KC_SEC4 KC_SECRET_4
  87. #define KC_SEC5 KC_SECRET_5
  88. #define QWERTY KC_QWERTY
  89. #define DVORAK KC_DVORAK
  90. #define COLEMAK KC_COLEMAK
  91. #define WORKMAN KC_WORKMAN
  92. #define KC_RST KC_RESET
  93. #ifdef TAP_DANCE_ENABLE
  94. enum {
  95. TD_D3_1 = 0,
  96. TD_D3_2,
  97. TD_D3_3,
  98. TD_D3_4
  99. };
  100. #endif // TAP_DANCE_ENABLE
  101. #ifdef UNICODEMAP_ENABLE
  102. /* use X(n) to call the */
  103. enum unicode_name {
  104. THINK, // thinking face 🤔
  105. GRIN, // grinning face 😊
  106. SMRK, // smirk 😏
  107. WEARY, // good shit 😩
  108. UNAMU, // unamused 😒
  109. SNEK, // snke 🐍
  110. PENGUIN, // 🐧
  111. DRAGON, // 🐉
  112. MONKEY, // 🐒
  113. CHICK, // 🐥
  114. OKOK, // 👌
  115. EFFU, // 🖕
  116. INUP, // 👆
  117. THUP, // 👍
  118. THDN, // 👎
  119. BBB, // dat B 🅱
  120. POO, // poop 💩
  121. HUNDR, // 100 💯
  122. EGGPL, // EGGPLANT 🍆
  123. WATER, // wet 💦
  124. TUMBLER, // 🥃
  125. LIT, // fire 🔥
  126. IRONY, // ‽
  127. DEGREE, // °
  128. };
  129. const uint32_t PROGMEM unicode_map[] = {
  130. [THINK] = 0x1F914,
  131. [GRIN] = 0x1F600,
  132. [BBB] = 0x1F171,
  133. [POO] = 0x1F4A9,
  134. [HUNDR] = 0x1F4AF,
  135. [SMRK] = 0x1F60F,
  136. [WEARY] = 0x1F629,
  137. [EGGPL] = 0x1F346,
  138. [WATER] = 0x1F4A6,
  139. [LIT] = 0x1F525,
  140. [UNAMU] = 0x1F612,
  141. [SNEK] = 0x1F40D,
  142. [PENGUIN] = 0x1F427,
  143. [BOAR] = 0x1F417,
  144. [MONKEY] = 0x1F412,
  145. [CHICK] = 0x1F425,
  146. [DRAGON] = 0x1F409,
  147. [OKOK] = 0x1F44C,
  148. [EFFU] = 0x1F595,
  149. [INUP] = 0x1F446,
  150. [THDN] = 0x1F44E,
  151. [THUP] = 0x1F44D,
  152. [TUMBLER] = 0x1F943,
  153. [IRONY] = 0x0203D,
  154. [DEGREE] = 0x000B0,
  155. };
  156. #endif //UNICODEMAP_ENABLE
  157. // Custom Keycodes for Diablo 3 layer
  158. // But since TD() doesn't work when tap dance is disabled
  159. // We use custom codes here, so we can substitute the right stuff
  160. #ifdef TAP_DANCE_ENABLE
  161. #define KC_D3_1 TD(TD_D3_1)
  162. #define KC_D3_2 TD(TD_D3_2)
  163. #define KC_D3_3 TD(TD_D3_3)
  164. #define KC_D3_4 TD(TD_D3_4)
  165. #else // TAP_DANCE_ENABLE
  166. #define KC_D3_1 KC_1
  167. #define KC_D3_2 KC_2
  168. #define KC_D3_3 KC_3
  169. #define KC_D3_4 KC_4
  170. #endif // TAP_DANCE_ENABLE
  171. // OSM keycodes, to keep things clean and easy to change
  172. #define KC_MLSF OSM(MOD_LSFT)
  173. #define KC_MRSF OSM(MOD_RSFT)
  174. // If we're still using the official Faux Clicky feature, substitute codes
  175. // so that we don't have any unused/blank keys.
  176. #ifdef FAUXCLICKY_ENABLE
  177. #define AUD_ON FC_ON
  178. #define AUD_OFF FC_OFF
  179. #else // FAUXCLICKY_ENABLE
  180. #define AUD_ON AU_ON
  181. #define AUD_OFF AU_OFF
  182. #endif // FAUXCLICKY_ENABLE
  183. // Since our quirky block definitions are basically a list of comma separated
  184. // arguments, we need a wrapper in order for these definitions to be
  185. // expanded before being used as arguments to the LAYOUT_xxx macro.
  186. #if (!defined(LAYOUT) && defined(KEYMAP))
  187. #define LAYOUT KEYMAP
  188. #endif
  189. #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)
  190. #define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
  191. #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__)
  192. #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
  193. // Blocks for each of the four major keyboard layouts
  194. // Organized so we can quickly adapt and modify all of them
  195. // at once, rather than for each keyboard, one at a time.
  196. // And this allows for much cleaner blocks in the keymaps.
  197. // For instance Tap/Hold for Control on all of the layouts
  198. // NOTE: These are all the same length. If you do a search/replace
  199. // then you need to add/remove underscores to keep the
  200. // lengths consistent.
  201. #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
  202. #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
  203. #define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  204. #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
  205. #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
  206. #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  207. #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
  208. #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
  209. #define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  210. #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
  211. #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
  212. #define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  213. #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B
  214. #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G
  215. #define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z), KC_X, KC_C, KC_D, KC_V
  216. #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
  217. #define ______________COLEMAK_MOD_DH_R2____________ KC_K, KC_N, KC_E, KC_I, KC_O
  218. #define ______________COLEMAK_MOD_DH_R3____________ KC_M, KC_H, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  219. #define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
  220. #define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
  221. #define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
  222. #define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L
  223. #define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S
  224. #define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
  225. #define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B
  226. #define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G
  227. #define _________________WORKMAN_L3________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V
  228. #define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
  229. #define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I
  230. #define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  231. #define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K
  232. #define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G
  233. #define _________________NORMAN_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  234. #define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN
  235. #define _________________NORMAN_R2_________________ KC_J, KC_N, KC_I, KC_O, KC_U
  236. #define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  237. // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
  238. // this allows us to quickly modify the bottom row for all of the layouts
  239. // so we don't have to alter it 4 times and hope that we haven't missed
  240. // anything
  241. #define ___________ERGODOX_BOTTOM_LEFT_____________ OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC
  242. #define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  243. #define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), KC_LGUI, KC_RGUI, CTL_T(KC_ESCAPE), \
  244. KC_HOME, KC_PGUP, \
  245. KC_SPACE,KC_BSPC, KC_END, KC_PGDN, KC_DEL, KC_ENTER
  246. #endif