drashna.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 _NAV 5
  24. #define _COVECUBE 6
  25. #define _SYMB 8
  26. #define _GAMEPAD 9
  27. #define _DIABLO 10
  28. #define _MOUS 11
  29. #define _MACROS 12
  30. #define _MEDIA 13
  31. #define _LOWER 14
  32. #define _RAISE 15
  33. #define _ADJUST 16
  34. //define modifiers
  35. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  36. #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
  37. #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
  38. #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
  39. #ifndef RGBLIGHT_ANIMATIONS // add "EXTRA_FLADS=-DDRASHNA_SETRGB" to enable this ... but don't
  40. #define rgblight_set_blue rgblight_setrgb (0x00, 0x00, 0xFF);
  41. #define rgblight_set_red rgblight_setrgb (0xFF, 0x00, 0x00);
  42. #define rgblight_set_green rgblight_setrgb (0x00, 0xFF, 0x00);
  43. #define rgblight_set_orange rgblight_setrgb (0xFF, 0x80, 0x00);
  44. #define rgblight_set_teal rgblight_setrgb (0x00, 0xFF, 0xFF);
  45. #define rgblight_set_magenta rgblight_setrgb (0xFF, 0x00, 0xFF);
  46. #define rgblight_set_yellow rgblight_setrgb (0xFF, 0xFF, 0x00);
  47. #define rgblight_set_purple rgblight_setrgb (0x7A, 0x00, 0xFF);
  48. #define rgblight_set_white rgblight_setrgb (0xFF, 0xFF, 0xFF);
  49. #else
  50. #define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF);
  51. #define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF);
  52. #define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF);
  53. #define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF);
  54. #define rgblight_set_teal rgblight_sethsv (0xB4, 0xFF, 0xFF);
  55. #define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF);
  56. #define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF);
  57. #define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF);
  58. #define rgblight_set_white rgblight_sethsv (0x00, 0x00, 0xFF);
  59. #endif // DRASHNA_SETRGB
  60. extern bool is_overwatch;
  61. extern bool rgb_layer_change;
  62. enum userspace_custom_keycodes {
  63. EPRM = SAFE_RANGE, // can always be here
  64. VRSN,
  65. KC_QWERTY,
  66. KC_COLEMAK,
  67. KC_DVORAK,
  68. KC_WORKMAN,
  69. LOWER,
  70. RAISE,
  71. ADJUST,
  72. KC_DIABLO_CLEAR,
  73. KC_OVERWATCH,
  74. KC_SALT,
  75. KC_MORESALT,
  76. KC_SALTHARD,
  77. KC_GOODGAME,
  78. KC_SYMM,
  79. KC_JUSTGAME,
  80. KC_GLHF,
  81. KC_TORB,
  82. KC_AIM,
  83. KC_C9,
  84. KC_GGEZ,
  85. KC_MAKE,
  86. KC_RESET,
  87. KC_RGB_T,
  88. KC_SECRET_1,
  89. KC_SECRET_2,
  90. KC_SECRET_3,
  91. KC_SECRET_4,
  92. KC_SECRET_5,
  93. NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
  94. };
  95. #ifdef TAP_DANCE_ENABLE
  96. enum {
  97. TD_D3_1 = 0,
  98. TD_D3_2,
  99. TD_D3_3,
  100. TD_D3_4
  101. };
  102. #endif
  103. #ifdef TAP_DANCE_ENABLE
  104. #define KC_D3_1 TD(TD_D3_1)
  105. #define KC_D3_2 TD(TD_D3_2)
  106. #define KC_D3_3 TD(TD_D3_3)
  107. #define KC_D3_4 TD(TD_D3_4)
  108. #else
  109. #define KC_D3_1 KC_1
  110. #define KC_D3_2 KC_2
  111. #define KC_D3_3 KC_3
  112. #define KC_D3_4 KC_4
  113. #endif
  114. #define QMK_KEYS_PER_SCAN 8
  115. #ifdef RGBLIGHT_ENABLE
  116. #define RGBLIGHT_SLEEP
  117. #endif
  118. #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.)
  119. #endif