process_records.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 "drashna.h"
  5. enum userspace_custom_keycodes {
  6. VRSN = QK_USER, // Prints QMK Firmware and board info
  7. KC_QWERTY, // Sets default layer to QWERTY
  8. FIRST_DEFAULT_LAYER_KEYCODE = KC_QWERTY, // Sets default layer to QWERTY
  9. KC_COLEMAK_DH, // Sets default layer to COLEMAK
  10. KC_COLEMAK, // Sets default layer to COLEMAK
  11. KC_DVORAK, // Sets default layer to DVORAK
  12. LAST_DEFAULT_LAYER_KEYCODE = KC_DVORAK, // Sets default layer to WORKMAN
  13. KC_DIABLO_CLEAR, // Clears all Diablo Timers
  14. KC_RGB_T, // Toggles RGB Layer Indication mode
  15. RGB_IDL, // RGB Idling animations
  16. KC_SECRET_1, // test1
  17. KC_SECRET_2, // test2
  18. KC_SECRET_3, // test3
  19. KC_SECRET_4, // test4
  20. KC_SECRET_5, // test5
  21. KC_CCCV, // Hold to copy, tap to paste
  22. KC_NUKE, // NUCLEAR LAUNCH DETECTED!!!
  23. UC_FLIP, // (ಠ痊ಠ)┻━┻
  24. UC_TABL, // ┬─┬ノ( º _ ºノ)
  25. UC_SHRG, // ¯\_(ツ)_/¯
  26. UC_DISA, // ಠ_ಠ
  27. UC_IRNY,
  28. UC_CLUE,
  29. KEYLOCK, // Locks keyboard by unmounting driver
  30. KC_NOMODE,
  31. KC_WIDE,
  32. KC_SCRIPT,
  33. KC_BLOCKS,
  34. KC_REGIONAL,
  35. KC_AUSSIE,
  36. KC_ZALGO,
  37. KC_SUPER,
  38. KC_COMIC,
  39. KC_ACCEL,
  40. OLED_LOCK,
  41. STORE_SETUPS,
  42. PRINT_SETUPS,
  43. USER_SAFE_RANGE, // use "NEWPLACEHOLDER for keymap specific codes
  44. };
  45. bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
  46. bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
  47. void post_process_record_keymap(uint16_t keycode, keyrecord_t *record);
  48. #ifdef CUSTOM_UNICODE_ENABLE
  49. bool process_record_unicode(uint16_t keycode, keyrecord_t *record);
  50. #endif
  51. #define LOWER MO(_LOWER)
  52. #define RAISE MO(_RAISE)
  53. #define ADJUST MO(_ADJUST)
  54. #define TG_MODS OS_TOGG
  55. #define TG_GAME TG(_GAMEPAD)
  56. #define TG_DBLO TG(_DIABLO)
  57. #define OS_LWR OSL(_LOWER)
  58. #define OS_RSE OSL(_RAISE)
  59. #define KC_SEC1 KC_SECRET_1
  60. #define KC_SEC2 KC_SECRET_2
  61. #define KC_SEC3 KC_SECRET_3
  62. #define KC_SEC4 KC_SECRET_4
  63. #define KC_SEC5 KC_SECRET_5
  64. #define QWERTY KC_QWERTY
  65. #define DVORAK KC_DVORAK
  66. #define COLEMAK KC_COLEMAK
  67. #define COLEMAKDH KC_COLEMAK_DH
  68. #define DEFLYR1 FIRST_DEFAULT_LAYER_KEYCODE
  69. #define DEFLYR2 (FIRST_DEFAULT_LAYER_KEYCODE + 1)
  70. #define DEFLYR3 (FIRST_DEFAULT_LAYER_KEYCODE + 2)
  71. #define DEFLYR4 (FIRST_DEFAULT_LAYER_KEYCODE + 3)
  72. #if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 3)
  73. # define DEFLYR5 (FIRST_DEFAULT_LAYER_KEYCODE + 4)
  74. # define DEFLYR6 (FIRST_DEFAULT_LAYER_KEYCODE + 5)
  75. # define DEFLYR7 (FIRST_DEFAULT_LAYER_KEYCODE + 6)
  76. # define DEFLYR8 (FIRST_DEFAULT_LAYER_KEYCODE + 7)
  77. # if LAST_DEFAULT_LAYER_KEYCODE > (FIRST_DEFAULT_LAYER_KEYCODE + 7)
  78. # define DEFLYR9 (FIRST_DEFAULT_LAYER_KEYCODE + 8)
  79. # define DEFLYR10 (FIRST_DEFAULT_LAYER_KEYCODE + 9)
  80. # define DEFLYR11 (FIRST_DEFAULT_LAYER_KEYCODE + 10)
  81. # define DEFLYR12 (FIRST_DEFAULT_LAYER_KEYCODE + 11)
  82. # endif
  83. #endif
  84. #ifdef SWAP_HANDS_ENABLE
  85. # define KC_C1R3 SH_T(KC_TAB)
  86. #elif defined(DRASHNA_LP)
  87. # define KC_C1R3 TG(_GAMEPAD)
  88. #else // SWAP_HANDS_ENABLE
  89. # define KC_C1R3 KC_TAB
  90. #endif // SWAP_HANDS_ENABLE
  91. #define BK_LWER LT(_LOWER, KC_BSPC)
  92. #define SP_LWER LT(_LOWER, KC_SPC)
  93. #define DL_RAIS LT(_RAISE, KC_DEL)
  94. #define ET_RAIS LT(_RAISE, KC_ENTER)
  95. /* OSM keycodes, to keep things clean and easy to change */
  96. #define KC_MLSF OSM(MOD_LSFT)
  97. #define KC_MRSF OSM(MOD_RSFT)
  98. #define OS_LGUI OSM(MOD_LGUI)
  99. #define OS_RGUI OSM(MOD_RGUI)
  100. #define OS_LSFT OSM(MOD_LSFT)
  101. #define OS_RSFT OSM(MOD_RSFT)
  102. #define OS_LCTL OSM(MOD_LCTL)
  103. #define OS_RCTL OSM(MOD_RCTL)
  104. #define OS_LALT OSM(MOD_LALT)
  105. #define OS_RALT OSM(MOD_RALT)
  106. #define OS_MEH OSM(MOD_MEH)
  107. #define OS_HYPR OSM(MOD_HYPR)
  108. #define ALT_APP ALT_T(KC_APP)
  109. #define MG_NKRO MAGIC_TOGGLE_NKRO
  110. #define AUTO_CTN QK_AUTOCORRECT_TOGGLE
  111. /*
  112. Custom Keycodes for Diablo 3 layer
  113. But since TD() doesn't work when tap dance is disabled
  114. We use custom codes here, so we can substitute the right stuff
  115. */
  116. #ifdef TAP_DANCE_ENABLE
  117. # define KC_D3_1 TD(TD_D3_1)
  118. # define KC_D3_2 TD(TD_D3_2)
  119. # define KC_D3_3 TD(TD_D3_3)
  120. # define KC_D3_4 TD(TD_D3_4)
  121. #else // TAP_DANCE_ENABLE
  122. # define KC_D3_1 KC_1
  123. # define KC_D3_2 KC_2
  124. # define KC_D3_3 KC_3
  125. # define KC_D3_4 KC_4
  126. #endif // TAP_DANCE_ENABLE