drashna.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /* Define layer names */
  27. enum userspace_layers {
  28. _QWERTY = 0,
  29. _NUMLOCK = 0,
  30. _COLEMAK,
  31. _DVORAK,
  32. _WORKMAN,
  33. _NORMAN,
  34. _MALTRON,
  35. _EUCALYN,
  36. _CARPLAX,
  37. _MODS, /* layer 8 */
  38. _GAMEPAD,
  39. _DIABLO,
  40. _MACROS,
  41. _MEDIA,
  42. _LOWER,
  43. _RAISE,
  44. _ADJUST,
  45. };
  46. bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
  47. bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
  48. void matrix_init_keymap(void);
  49. void shutdown_keymap(void);
  50. void suspend_power_down_keymap(void);
  51. void suspend_wakeup_init_keymap(void);
  52. void matrix_scan_keymap(void);
  53. layer_state_t layer_state_set_keymap(layer_state_t state);
  54. layer_state_t default_layer_state_set_keymap(layer_state_t state);
  55. void led_set_keymap(uint8_t usb_led);
  56. void eeconfig_init_keymap(void);
  57. typedef union {
  58. uint32_t raw;
  59. struct {
  60. bool rgb_layer_change :1;
  61. bool is_overwatch :1;
  62. bool nuke_switch :1;
  63. uint8_t unicode_mod :4;
  64. bool swapped_numbers :1;
  65. bool rgb_matrix_idle_anim :1;
  66. };
  67. } userspace_config_t;
  68. extern userspace_config_t userspace_config;
  69. /*
  70. Custom Keycodes for Diablo 3 layer
  71. But since TD() doesn't work when tap dance is disabled
  72. We use custom codes here, so we can substitute the right stuff
  73. */
  74. #ifdef TAP_DANCE_ENABLE
  75. # define KC_D3_1 TD(TD_D3_1)
  76. # define KC_D3_2 TD(TD_D3_2)
  77. # define KC_D3_3 TD(TD_D3_3)
  78. # define KC_D3_4 TD(TD_D3_4)
  79. #else // TAP_DANCE_ENABLE
  80. # define KC_D3_1 KC_1
  81. # define KC_D3_2 KC_2
  82. # define KC_D3_3 KC_3
  83. # define KC_D3_4 KC_4
  84. #endif // TAP_DANCE_ENABLE