drashna.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. #ifndef RGBLIGHT_ANIMATIONS // add "EXTRA_FLADS=-DDRASHNA_SETRGB" to enable this ... but don't
  42. #define rgblight_set_blue rgblight_setrgb (0x00, 0x00, 0xFF);
  43. #define rgblight_set_red rgblight_setrgb (0xFF, 0x00, 0x00);
  44. #define rgblight_set_green rgblight_setrgb (0x00, 0xFF, 0x00);
  45. #define rgblight_set_orange rgblight_setrgb (0xFF, 0x80, 0x00);
  46. #define rgblight_set_teal rgblight_setrgb (0x00, 0xFF, 0xFF);
  47. #define rgblight_set_magenta rgblight_setrgb (0xFF, 0x00, 0xFF);
  48. #define rgblight_set_yellow rgblight_setrgb (0xFF, 0xFF, 0x00);
  49. #define rgblight_set_purple rgblight_setrgb (0x7A, 0x00, 0xFF);
  50. #define rgblight_set_white rgblight_setrgb (0xFF, 0xFF, 0xFF);
  51. #else
  52. #define rgblight_set_white rgblight_sethsv (0, 0x00, 255);
  53. #define rgblight_set_red rgblight_sethsv (0, 255, 255);
  54. #define rgblight_set_coral rgblight_sethsv (16, 176, 255);
  55. #define rgblight_set_orange rgblight_sethsv (39, 255, 255);
  56. #define rgblight_set_goldenrod rgblight_sethsv (43, 218, 218);
  57. #define rgblight_set_gold rgblight_sethsv (51, 255, 255);
  58. #define rgblight_set_yellow rgblight_sethsv (60, 255, 255);
  59. #define rgblight_set_chartreuse rgblight_sethsv (90, 255, 255);
  60. #define rgblight_set_green rgblight_sethsv (120, 255, 255);
  61. #define rgblight_set_springgreen rgblight_sethsv (150, 255, 255);
  62. #define rgblight_set_turquoise rgblight_sethsv (174, 90, 112);
  63. #define rgblight_set_teal rgblight_sethsv (180, 255, 128);
  64. #define rgblight_set_cyan rgblight_sethsv (180, 255, 255);
  65. #define rgblight_set_azure rgblight_sethsv (186, 102, 255);
  66. #define rgblight_set_blue rgblight_sethsv (240, 255, 255);
  67. #define rgblight_set_purple rgblight_sethsv (270, 255, 255);
  68. #define rgblight_set_magenta rgblight_sethsv (300, 255, 255);
  69. #define rgblight_set_pink rgblight_sethsv (330, 128, 255);
  70. //#define rgblight_set_ rgblight_sethsv (0, 255, 255);
  71. #endif // DRASHNA_SETRGB
  72. extern bool is_overwatch;
  73. extern bool rgb_layer_change;
  74. enum userspace_custom_keycodes {
  75. EPRM = SAFE_RANGE, // can always be here
  76. VRSN,
  77. KC_QWERTY,
  78. KC_COLEMAK,
  79. KC_DVORAK,
  80. KC_WORKMAN,
  81. LOWER,
  82. RAISE,
  83. ADJUST,
  84. KC_DIABLO_CLEAR,
  85. KC_OVERWATCH,
  86. KC_SALT,
  87. KC_MORESALT,
  88. KC_SALTHARD,
  89. KC_GOODGAME,
  90. KC_SYMM,
  91. KC_JUSTGAME,
  92. KC_GLHF,
  93. KC_TORB,
  94. KC_AIM,
  95. KC_C9,
  96. KC_GGEZ,
  97. KC_MAKE,
  98. KC_RESET,
  99. KC_RGB_T,
  100. KC_SECRET_1,
  101. KC_SECRET_2,
  102. KC_SECRET_3,
  103. KC_SECRET_4,
  104. KC_SECRET_5,
  105. KC_FXCL,
  106. NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
  107. };
  108. #ifdef TAP_DANCE_ENABLE
  109. enum {
  110. TD_D3_1 = 0,
  111. TD_D3_2,
  112. TD_D3_3,
  113. TD_D3_4
  114. };
  115. #endif
  116. #ifdef TAP_DANCE_ENABLE
  117. #define KC_D3_1 TD(TD_D3_1)
  118. #define KC_D3_2 TD(TD_D3_2)
  119. #define KC_D3_3 TD(TD_D3_3)
  120. #define KC_D3_4 TD(TD_D3_4)
  121. #else
  122. #define KC_D3_1 KC_1
  123. #define KC_D3_2 KC_2
  124. #define KC_D3_3 KC_3
  125. #define KC_D3_4 KC_4
  126. #endif
  127. #define QMK_KEYS_PER_SCAN 8
  128. #ifdef RGBLIGHT_ENABLE
  129. #define RGBLIGHT_SLEEP
  130. #endif
  131. #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
  132. #define NO_ACTION_MACRO
  133. #define NO_ACTION_FUNCTION
  134. #ifdef FAUXCLICKY_ENABLE
  135. #define AUD_ON FC_ON
  136. #define AUD_OFF FC_OFF
  137. #else
  138. #define AUD_ON AU_ON
  139. #define AUD_OFF AU_OFF
  140. #endif
  141. // Since our quirky block definitions are basically a list of comma separated
  142. // arguments, we need a wrapper in order for these definitions to be
  143. // expanded before being used as arguments to the LAYOUT_xxx macro.
  144. #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)
  145. #define KEYMAP_wrapper(...) KEYMAP(__VA_ARGS__)
  146. // Blocks for each of the four major keyboard layouts
  147. // Organized so we can quickly adapt and modify all of them
  148. // at once, rather than for each keyboard, one at a time.
  149. // And this allows wor much cleaner blocks in the keymaps.
  150. // For instance Tap/Hold for Control on all of the layouts
  151. #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
  152. #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
  153. #define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  154. #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
  155. #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
  156. #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  157. #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
  158. #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
  159. #define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
  160. #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
  161. #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
  162. #define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
  163. #define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
  164. #define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
  165. #define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
  166. #define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L
  167. #define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S
  168. #define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
  169. #define _________________WORKMAN_L1________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
  170. #define _________________WORKMAN_L2________________ KC_A, KC_O, KC_E, KC_U, KC_I
  171. #define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
  172. #define _________________WORKMAN_R1________________ KC_F, KC_G, KC_C, KC_R, KC_L
  173. #define _________________WORKMAN_R2________________ KC_D, KC_H, KC_T, KC_N, KC_S
  174. #define _________________WORKMAN_R3________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
  175. // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
  176. // this allows us to quickly modify the bottom row for all of the layouts
  177. // so we don't have to alter it 4 times and hope that we haven't missed
  178. // anything
  179. #define ___________ERGODOX_BOTTOM_LEFT_____________ KC_QUOT, KC_LGUI, KC_LBRC, KC_RBRC
  180. #define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  181. #endif