drashna.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #pragma once
  15. #include "quantum.h"
  16. #include "version.h"
  17. #include "eeprom.h"
  18. #include "wrappers.h"
  19. #include "process_records.h"
  20. #ifdef TAP_DANCE_ENABLE
  21. # include "tap_dances.h"
  22. #endif // TAP_DANCE_ENABLE
  23. #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
  24. # include "rgb_stuff.h"
  25. #endif
  26. #if defined(AUDIO_ENABLE) && __GNUC__ > 7
  27. # if __has_include("drashna_song_list.h")
  28. # include "drashna_song_list.h"
  29. # endif
  30. #endif
  31. /* Define layer names */
  32. enum userspace_layers {
  33. _QWERTY = 0,
  34. _NUMLOCK = 0,
  35. _COLEMAK,
  36. _DVORAK,
  37. _WORKMAN,
  38. _NORMAN,
  39. _MALTRON,
  40. _EUCALYN,
  41. _CARPLAX,
  42. _MODS, /* layer 8 */
  43. _GAMEPAD,
  44. _DIABLO,
  45. _MACROS,
  46. _MEDIA,
  47. _LOWER,
  48. _RAISE,
  49. _ADJUST,
  50. };
  51. /*
  52. define modifiers here, since MOD_* doesn't seem to work for these
  53. */
  54. bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
  55. bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
  56. bool send_game_macro(const char *str, keyrecord_t *record, bool override);
  57. void matrix_init_keymap(void);
  58. void shutdown_keymap(void);
  59. void suspend_power_down_keymap(void);
  60. void suspend_wakeup_init_keymap(void);
  61. void matrix_scan_keymap(void);
  62. uint32_t layer_state_set_keymap (uint32_t state);
  63. uint32_t default_layer_state_set_keymap (uint32_t state);
  64. void led_set_keymap(uint8_t usb_led);
  65. void eeconfig_init_keymap(void);
  66. typedef union {
  67. uint32_t raw;
  68. struct {
  69. bool rgb_layer_change :1;
  70. bool is_overwatch :1;
  71. bool nuke_switch :1;
  72. uint8_t unicode_mod :4;
  73. bool swapped_numbers :1;
  74. };
  75. } userspace_config_t;
  76. extern userspace_config_t userspace_config;
  77. /*
  78. Custom Keycodes for Diablo 3 layer
  79. But since TD() doesn't work when tap dance is disabled
  80. We use custom codes here, so we can substitute the right stuff
  81. */
  82. #ifdef TAP_DANCE_ENABLE
  83. # define KC_D3_1 TD(TD_D3_1)
  84. # define KC_D3_2 TD(TD_D3_2)
  85. # define KC_D3_3 TD(TD_D3_3)
  86. # define KC_D3_4 TD(TD_D3_4)
  87. #else // TAP_DANCE_ENABLE
  88. # define KC_D3_1 KC_1
  89. # define KC_D3_2 KC_2
  90. # define KC_D3_3 KC_3
  91. # define KC_D3_4 KC_4
  92. #endif // TAP_DANCE_ENABLE