drashna.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. #define _QWERTY 0
  19. #define _NUMLOCK 0
  20. #define _COLEMAK 1
  21. #define _DVORAK 2
  22. #define _WORKMAN 3
  23. #define _MODS 4
  24. //#define _MISC 5
  25. #define _NAV 6
  26. #define _COVECUBE 7
  27. #define _SYMB 8
  28. #define _GAMEPAD 9
  29. #define _DIABLO 10
  30. #define _MOUS 11
  31. #define _MACROS 12
  32. #define _MEDIA 13
  33. #define _LOWER 14
  34. #define _RAISE 15
  35. #define _ADJUST 16
  36. //define modifiers
  37. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  38. #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
  39. #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
  40. #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
  41. // RGB color codes are no longer located here anymore. Instead, you will want to
  42. // head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h
  43. extern bool is_overwatch;
  44. extern bool rgb_layer_change;
  45. enum userspace_custom_keycodes {
  46. EPRM = SAFE_RANGE, // can always be here
  47. VRSN,
  48. KC_QWERTY,
  49. KC_COLEMAK,
  50. KC_DVORAK,
  51. KC_WORKMAN,
  52. LOWER,
  53. RAISE,
  54. ADJUST,
  55. KC_DIABLO_CLEAR,
  56. KC_OVERWATCH,
  57. KC_SALT,
  58. KC_MORESALT,
  59. KC_SALTHARD,
  60. KC_GOODGAME,
  61. KC_SYMM,
  62. KC_JUSTGAME,
  63. KC_GLHF,
  64. KC_TORB,
  65. KC_AIM,
  66. KC_C9,
  67. KC_GGEZ,
  68. KC_MAKE,
  69. KC_RESET,
  70. KC_RGB_T,
  71. KC_SECRET_1,
  72. KC_SECRET_2,
  73. KC_SECRET_3,
  74. KC_SECRET_4,
  75. KC_SECRET_5,
  76. KC_FXCL,
  77. NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
  78. };
  79. #define KC_SEC1 KC_SECRET_1
  80. #define KC_SEC2 KC_SECRET_2
  81. #define KC_SEC3 KC_SECRET_3
  82. #define KC_SEC4 KC_SECRET_4
  83. #define KC_SEC5 KC_SECRET_5
  84. #define QWERTY KC_QWERTY
  85. #define DVORAK KC_DVORAK
  86. #define COLEMAK KC_COLEMAK
  87. #define WORKMAN KC_WORKMAN
  88. #define KC_RST KC_RESET
  89. #ifdef TAP_DANCE_ENABLE
  90. enum {
  91. TD_D3_1 = 0,
  92. TD_D3_2,
  93. TD_D3_3,
  94. TD_D3_4
  95. };
  96. #endif // TAP_DANCE_ENABLE
  97. // Custom Keycodes for Diablo 3 layer
  98. // But since TD() doesn't work when tap dance is disabled
  99. // We use custom codes here, so we can substitute the right stuff
  100. #ifdef TAP_DANCE_ENABLE
  101. #define KC_D3_1 TD(TD_D3_1)
  102. #define KC_D3_2 TD(TD_D3_2)
  103. #define KC_D3_3 TD(TD_D3_3)
  104. #define KC_D3_4 TD(TD_D3_4)
  105. #else // TAP_DANCE_ENABLE
  106. #define KC_D3_1 KC_1
  107. #define KC_D3_2 KC_2
  108. #define KC_D3_3 KC_3
  109. #define KC_D3_4 KC_4
  110. #endif // TAP_DANCE_ENABLE
  111. // OSM keycodes, to keep things clean and easy to change
  112. #define KC_MLSF OSM(MOD_LSFT)
  113. #define KC_MRSF OSM(MOD_RSFT)
  114. // If we're still using the official Faux Clicky feature, substitute codes
  115. // so that we don't have any unused/blank keys.
  116. #ifdef FAUXCLICKY_ENABLE
  117. #define AUD_ON FC_ON
  118. #define AUD_OFF FC_OFF
  119. #else // FAUXCLICKY_ENABLE
  120. #define AUD_ON AU_ON
  121. #define AUD_OFF AU_OFF
  122. #endif // FAUXCLICKY_ENABLE
  123. // Since our quirky block definitions are basically a list of comma separated
  124. // arguments, we need a wrapper in order for these definitions to be
  125. // expanded before being used as arguments to the LAYOUT_xxx macro.
  126. #if (!defined(LAYOUT) && defined(KEYMAP))
  127. #define LAYOUT KEYMAP
  128. #endif
  129. #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)
  130. #define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
  131. #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__)
  132. #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
  133. // Blocks for each of the four major keyboard layouts
  134. // Organized so we can quickly adapt and modify all of them
  135. // at once, rather than for each keyboard, one at a time.
  136. // And this allows for much cleaner blocks in the keymaps.
  137. // For instance Tap/Hold for Control on all of the layouts
  138. // NOTE: These are all the same length. If you do a search/replace
  139. // then you need to add/remove underscores to keep the
  140. // lengths consistent.
  141. #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
  142. #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
  143. #define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  144. #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
  145. #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
  146. #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  147. #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
  148. #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
  149. #define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  150. #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
  151. #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
  152. #define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  153. #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B
  154. #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G
  155. #define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z), KC_X, KC_C, KC_D, KC_V
  156. #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
  157. #define ______________COLEMAK_MOD_DH_R2____________ KC_K, KC_N, KC_E, KC_I, KC_O
  158. #define ______________COLEMAK_MOD_DH_R3____________ KC_M, KC_H, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  159. #define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
  160. #define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
  161. #define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
  162. #define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L
  163. #define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S
  164. #define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
  165. #define _________________WORKMAN_L1________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
  166. #define _________________WORKMAN_L2________________ KC_A, KC_O, KC_E, KC_U, KC_I
  167. #define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
  168. #define _________________WORKMAN_R1________________ KC_F, KC_G, KC_C, KC_R, KC_L
  169. #define _________________WORKMAN_R2________________ KC_D, KC_H, KC_T, KC_N, KC_S
  170. #define _________________WORKMAN_R3________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
  171. #define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K
  172. #define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G
  173. #define _________________NORMAN_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  174. #define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN
  175. #define _________________NORMAN_R2_________________ KC_J, KC_N, KC_I, KC_O, KC_U
  176. #define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  177. // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
  178. // this allows us to quickly modify the bottom row for all of the layouts
  179. // so we don't have to alter it 4 times and hope that we haven't missed
  180. // anything
  181. #define ___________ERGODOX_BOTTOM_LEFT_____________ OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC
  182. #define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  183. #endif