drashna.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include QMK_KEYBOARD_H
  5. #include "eeprom.h"
  6. #include "keyrecords/wrappers.h"
  7. #include "keyrecords/process_records.h"
  8. #include "callbacks.h"
  9. #ifdef TAP_DANCE_ENABLE
  10. # include "keyrecords/tap_dances.h"
  11. #endif // TAP_DANCE_ENABLE
  12. #if defined(RGBLIGHT_ENABLE)
  13. # include "rgb/rgb_stuff.h"
  14. #endif
  15. #if defined(RGB_MATRIX_ENABLE)
  16. # include "rgb/rgb_matrix_stuff.h"
  17. #endif
  18. #if defined(OLED_ENABLE)
  19. # include "oled/oled_stuff.h"
  20. #endif
  21. #ifdef SPLIT_KEYBOARD
  22. # include "split/transport_sync.h"
  23. #endif
  24. #ifdef POINTING_DEVICE_ENABLE
  25. # include "pointing/pointing.h"
  26. #endif
  27. /* Define layer names */
  28. enum userspace_layers {
  29. _QWERTY = 0,
  30. _NUMLOCK = 0,
  31. FIRST_DEFAULT_LAYER = 0,
  32. _COLEMAK_DH,
  33. _COLEMAK,
  34. _DVORAK,
  35. LAST_DEFAULT_LAYER = _DVORAK,
  36. _GAMEPAD,
  37. _DIABLO,
  38. _DIABLOII,
  39. _MOUSE,
  40. _MEDIA,
  41. _LOWER,
  42. _RAISE,
  43. _ADJUST,
  44. };
  45. #define _MACROS _MOUSE
  46. #define _DEFAULT_LAYER_1 FIRST_DEFAULT_LAYER
  47. #define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 1)
  48. #define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 2)
  49. #define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 3)
  50. #if LAST_DEFAULT_LAYER > (FIRST_DEFAULT_LAYER + 3)
  51. # define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 4)
  52. # define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 5)
  53. # define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 6)
  54. # define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 7)
  55. # if LAST_DEFAULT_LAYER > (FIRST_DEFAULT_LAYER + 7)
  56. # define _DEFAULT_LAYER_2 (FIRST_DEFAULT_LAYER + 8)
  57. # define _DEFAULT_LAYER_3 (FIRST_DEFAULT_LAYER + 9)
  58. # define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 10)
  59. # define _DEFAULT_LAYER_4 (FIRST_DEFAULT_LAYER + 11)
  60. # endif
  61. #endif
  62. #define DEFAULT_LAYER_1_HSV HSV_CYAN
  63. #define DEFAULT_LAYER_2_HSV HSV_CHARTREUSE
  64. #define DEFAULT_LAYER_3_HSV HSV_MAGENTA
  65. #define DEFAULT_LAYER_4_HSV HSV_GOLDENROD
  66. #define DEFAULT_LAYER_1_RGB RGB_CYAN
  67. #define DEFAULT_LAYER_2_RGB RGB_CHARTREUSE
  68. #define DEFAULT_LAYER_3_RGB RGB_MAGENTA
  69. #define DEFAULT_LAYER_4_RGB RGB_GOLDENROD
  70. bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
  71. bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
  72. bool hasAllBitsInMask(uint8_t value, uint8_t mask);
  73. void tap_code16_nomods(uint16_t kc);
  74. // clang-format off
  75. typedef union {
  76. uint32_t raw;
  77. struct {
  78. bool rgb_layer_change :1;
  79. bool is_overwatch :1;
  80. bool nuke_switch :1;
  81. bool swapped_numbers :1;
  82. bool rgb_matrix_idle_anim :1;
  83. bool autocorrection :1;
  84. };
  85. } userspace_config_t;
  86. // clang-format on
  87. extern userspace_config_t userspace_config;