You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
4.1 KiB

  1. /* Copyright 2021 Jonavin Eng @Jonavin
  2. Copyright 2022 gourdo1 <jcblake@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. // DEFINE MACROS
  16. #define ARRAYSIZE(arr) sizeof(arr) / sizeof(arr[0])
  17. // LAYERS
  18. enum custom_user_layers {
  19. _BASE,
  20. _FN1,
  21. _NUMPADMOUSE,
  22. _MOUSEKEY,
  23. };
  24. #define KC_CAD LALT(LCTL(KC_DEL))
  25. #define KC_AF4 LALT(KC_F4)
  26. #define KC_TASK LCTL(LSFT(KC_ESC))
  27. #define CT_PGUP RCTL(KC_PGUP)
  28. #define CT_PGDN RCTL(KC_PGDN)
  29. #define CT_HOME RCTL(KC_HOME)
  30. #define CT_END RCTL(KC_END)
  31. #define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped
  32. #define KC_RAISESPC LT(_MOUSEKEY, KC_SPC) // _MOUSEKEY layer mod when held, space when tapped
  33. #define KC_LOWERSPC LT(_NUMPADMOUSE, KC_SPC) // _NUMPAD-MOUSE layer mod when held, space when tapped
  34. #define KC_SHIFTSPC LSFT(KC_SPC)
  35. #define SWAP_L SGUI(KC_LEFT) // Swap application to left display
  36. #define SWAP_R SGUI(KC_RGHT) // Swap application to right display
  37. // KEYCODES
  38. enum custom_user_keycodes {
  39. KC_00 = SAFE_RANGE,
  40. ENCFUNC,
  41. KC_WINLCK, // Toggles Win key on and off
  42. RGB_TOI, // Timeout idle time up
  43. RGB_TOD, // Timeout idle time down
  44. RGB_NITE, // Turns off all rgb but allow rgb indicators to work
  45. YAHOO, // yahoo.com
  46. OUTLOOK, // outlook.com
  47. GMAIL, // gmail.com
  48. HOTMAIL, // hotmail.com
  49. DOTCOM, // .com
  50. EMO_SHRUG, // `\_("/)_/`
  51. EMO_CONFUSE, // (*_*)
  52. EMO_SAD, // :'-(
  53. EMO_NERVOUS, // (~_~;)
  54. EMO_JOY, // (^o^)
  55. EMO_TEARS, // (T_T)
  56. KC_TSTOG, // Tab Scroll Toggle
  57. NEW_SAFE_RANGE // new safe range for keymap level custom keycodes
  58. };
  59. #ifdef TD_LSFT_CAPSLOCK_ENABLE
  60. // Tap Dance Definitions
  61. enum custom_tapdance {
  62. TD_LSFT_CAPSLOCK,
  63. TD_LSFT_CAPS_WIN,
  64. TD_ESC_BASELYR
  65. };
  66. #define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK)
  67. #define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN)
  68. #define KC_ESCLYR TD(TD_ESC_BASELYR)
  69. #else // regular Shift
  70. #define KC_LSFTCAPS KC_LSFT
  71. // regular Escape
  72. #define KC_ESCLYR KC_ESC
  73. #endif // TD_LSFT_CAPSLOCK_ENABLE
  74. // ENCODER ACTIONS
  75. #ifdef ENCODER_ENABLE
  76. void encoder_action_volume(bool clockwise);
  77. void encoder_action_mediatrack(bool clockwise);
  78. void encoder_action_navword(bool clockwise);
  79. void encoder_action_navpage(bool clockwise);
  80. uint8_t get_selected_layer(void);
  81. void encoder_action_layerchange(bool clockwise);
  82. #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
  83. void encoder_action_rgb_speed(bool clockwise);
  84. void encoder_action_rgb_hue(bool clockwise);
  85. void encoder_action_rgb_saturation(bool clockwise);
  86. void encoder_action_rgb_brightness(bool clockwise);
  87. void encoder_action_rgb_mode(bool clockwise);
  88. #endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE
  89. #ifdef ALTTAB_SCROLL_ENABLE
  90. void encoder_action_alttabscroll(bool clockwise);
  91. void encoder_toggle_alttabscroll(void);
  92. void encoder_tick_alttabscroll(void);
  93. #endif // ALTTAB_SCROLL_ENABLE
  94. #endif // ENCODER_ENABLE
  95. #ifdef RGB_MATRIX_ENABLE
  96. void activate_rgb_nightmode(bool turn_on);
  97. bool get_rgb_nightmode(void);
  98. #endif
  99. // IDLE TIMEOUTS
  100. #ifdef IDLE_TIMEOUT_ENABLE
  101. #define TIMEOUT_THRESHOLD_DEFAULT 15 // default timeout minutes
  102. #define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value)
  103. //prototype functions
  104. uint16_t get_timeout_threshold(void);
  105. void timeout_reset_timer(void);
  106. void timeout_update_threshold(bool increase);
  107. void timeout_tick_timer(void);
  108. #endif //IDLE_TIMEOUT_ENABLE
  109. // OTHER FUNCTION PROTOTYPE
  110. void activate_numlock(bool turn_on);