gourdo1.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* Copyright 2021 Jonavin Eng @Jonavin
  2. Copyright 2022 gourdo1 <gourdo1@outlook.com>
  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. // LAYERS -- Note: to avoid compile problems, make sure total layers matches DYNAMIC_KEYMAP_LAYER_COUNT defined in config.h (where _COLEMAK layer is defined)
  16. enum custom_user_layers {
  17. _BASE,
  18. _FN1,
  19. _NUMPADMOUSE,
  20. _MOUSEKEY,
  21. #ifdef GAME_ENABLE
  22. _GAME
  23. #endif //GAME_ENABLE
  24. };
  25. #define KC_CAD LALT(LCTL(KC_DEL))
  26. #define LOCKPC LGUI(KC_L)
  27. #define KC_AF4 LALT(KC_F4)
  28. #define KC_TASK LCTL(LSFT(KC_ESC))
  29. #define CT_PGUP RCTL(KC_PGUP)
  30. #define CT_PGDN RCTL(KC_PGDN)
  31. #define CT_HOME RCTL(KC_HOME)
  32. #define CT_END RCTL(KC_END)
  33. #define SWAP_L SGUI(KC_LEFT) // Swap application to left display
  34. #define SWAP_R SGUI(KC_RGHT) // Swap application to right display
  35. // KEYCODES
  36. enum custom_user_keycodes {
  37. KC_00 = SAFE_RANGE,
  38. ENCFUNC, // Encoder function
  39. CAPSNUM, // Capslock key function
  40. LEFTOFENC, // Key to the left of the encoder (i.e. F13)
  41. BELOWENC, // Key below encoder
  42. PRNCONF, // Print verbose statuses of all user_config toggles
  43. WINLOCK, // Toggles Windows key on and off
  44. RGB_TOI, // Timeout idle time up
  45. RGB_TOD, // Timeout idle time down
  46. RGB_NITE, // Disables RGB backlighting effects but allows RGB indicators to still work
  47. TG_CAPS, // Toggles RGB highlighting of alphas during capslock
  48. TG_PAD, // Toggles RGB highlighting of keys on numpad+mousekeys layer
  49. TG_TDCAP, // Toggles double tap shift for CapsLock
  50. TG_DEL, // Swaps DEL and HOME key locations
  51. TG_ENC, // Toggle Encoder button functionality
  52. TG_ESC, // Toggle ESC double tap for _BASE layer
  53. TG_INS, // Toggle location of INS
  54. TG_SPCMOD, // Toggle disabling of modded-SPACE functions
  55. TG_AUTOCR, // Toggle AutoCorrect
  56. TG_ENGCAP, // Toggle highlighting Non-English letters during CAPSLOCK on ISO boards
  57. YAHOO, // yahoo.com
  58. OUTLOOK, // outlook.com
  59. GMAIL, // gmail.com
  60. HOTMAIL, // hotmail.com
  61. DOTCOM, // .com
  62. EMO_SHRUG, // `\_("/)_/`
  63. EMO_CONFUSE, // (*_*)
  64. EMO_SAD, // :'-(
  65. EMO_NERVOUS, // (~_~;)
  66. EMO_JOY, // (^o^)
  67. EMO_TEARS, // (T_T)
  68. KC_TSTOG, // Tab Scroll Toggle
  69. NEW_SAFE_RANGE // New safe range for keymap level custom keycodes
  70. };
  71. // Set up boolean variables to track user customizable configuration options
  72. typedef union {
  73. uint32_t raw;
  74. struct {
  75. bool rgb_hilite_caps :1;
  76. bool rgb_hilite_numpad :1;
  77. bool esc_double_tap_to_baselyr :1;
  78. bool del_right_home_top :1;
  79. bool double_tap_shift_for_capslock :1;
  80. bool encoder_press_mute_or_media :1;
  81. bool ins_on_shft_bkspc_or_del :1;
  82. bool disable_space_mods :1;
  83. bool autocorrect :1;
  84. bool rgb_english_caps :1;
  85. };
  86. } user_config_t;
  87. user_config_t user_config;
  88. //#define LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN)
  89. // ENCODER ACTIONS
  90. #ifdef ENCODER_ENABLE
  91. void encoder_action_volume(bool clockwise);
  92. void encoder_action_mediatrack(bool clockwise);
  93. void encoder_action_navword(bool clockwise);
  94. void encoder_action_navpage(bool clockwise);
  95. uint8_t get_selected_layer(void);
  96. void encoder_action_layerchange(bool clockwise);
  97. #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
  98. void encoder_action_rgb_speed(bool clockwise);
  99. void encoder_action_rgb_hue(bool clockwise);
  100. void encoder_action_rgb_saturation(bool clockwise);
  101. void encoder_action_rgb_brightness(bool clockwise);
  102. void encoder_action_rgb_mode(bool clockwise);
  103. #endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE
  104. #ifdef ALTTAB_SCROLL_ENABLE
  105. void encoder_action_alttabscroll(bool clockwise);
  106. void encoder_toggle_alttabscroll(void);
  107. void encoder_tick_alttabscroll(void);
  108. #endif // ALTTAB_SCROLL_ENABLE
  109. #endif // ENCODER_ENABLE
  110. #ifdef RGB_MATRIX_ENABLE
  111. void activate_rgb_nightmode(bool turn_on);
  112. bool get_rgb_nightmode(void);
  113. #endif
  114. // IDLE TIMEOUTS
  115. #ifdef IDLE_TIMEOUT_ENABLE
  116. #define TIMEOUT_THRESHOLD_DEFAULT 15 // default timeout minutes
  117. #define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value)
  118. //prototype functions
  119. uint16_t get_timeout_threshold(void);
  120. void timeout_reset_timer(void);
  121. void timeout_update_threshold(bool increase);
  122. void timeout_tick_timer(void);
  123. #endif //IDLE_TIMEOUT_ENABLE
  124. // OTHER FUNCTION PROTOTYPE
  125. void activate_numlock(bool turn_on);