drashna.h 7.4 KB

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