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.

121 lines
3.6 KiB

  1. /* Copyright 2021 Jonavin Eng @Jonavin
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #pragma once
  14. // DEFINE MACROS
  15. #define ARRAYSIZE(arr) sizeof(arr)/sizeof(arr[0])
  16. // LAYERS
  17. enum custom_user_layers {
  18. _BASE,
  19. _FN1,
  20. _LOWER,
  21. _RAISE,
  22. };
  23. // KEYCODES
  24. enum custom_user_keycodes {
  25. KC_00 = SAFE_RANGE,
  26. ENCFUNC,
  27. KC_WINLCK, //Toggles Win key on and off
  28. RGB_TOI, // Timeout idle time up
  29. RGB_TOD, // Timeout idle time down
  30. RGB_NITE, // Turns off all rgb but allow rgb indicators to work
  31. EMO_SHRUG, // `\_("/)_/`
  32. EMO_CONFUSE, // (*_*)
  33. EMO_SAD, // :'-(
  34. EMO_NERVOUS, // (~_~;)
  35. EMO_JOY, // (^o^)
  36. EMO_TEARS, // (T_T)
  37. NEW_SAFE_RANGE // new safe range for keymap level custom keycodes
  38. };
  39. #define KC_CAD LALT(LCTL(KC_DEL))
  40. #define KC_AF4 LALT(KC_F4)
  41. #define KC_TASK LCTL(LSFT(KC_ESC))
  42. #define CT_PGUP RCTL(KC_PGUP)
  43. #define CT_PGDN RCTL(KC_PGDN)
  44. #define CT_HOME RCTL(KC_HOME)
  45. #define CT_END RCTL(KC_END)
  46. #define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped
  47. #define KC_RAISESPC LT(_RAISE,KC_SPC) // _RAISE layer mod when held, space when tapped
  48. #define KC_LOWERSPC LT(_LOWER,KC_SPC) // _LOWER layer mod when held, space when tapped
  49. #ifdef TD_LSFT_CAPSLOCK_ENABLE
  50. // Tap Dance Definitions
  51. enum custom_tapdance {
  52. TD_LSFT_CAPSLOCK,
  53. TD_LSFT_CAPS_WIN
  54. };
  55. #define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK)
  56. #define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN)
  57. #else // regular Shift
  58. #define KC_LSFTCAPS KC_LSFT
  59. #endif // TD_LSFT_CAPSLOCK_ENABLE
  60. // ENCODER ACTIONS
  61. #ifdef ENCODER_ENABLE
  62. void encoder_action_volume(bool clockwise);
  63. void encoder_action_mediatrack(bool clockwise);
  64. void encoder_action_navword(bool clockwise);
  65. void encoder_action_navpage(bool clockwise);
  66. uint8_t get_selected_layer(void);
  67. void encoder_action_layerchange(bool clockwise);
  68. #if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
  69. void encoder_action_rgb_speed(bool clockwise);
  70. void encoder_action_rgb_hue(bool clockwise);
  71. void encoder_action_rgb_saturation(bool clockwise);
  72. void encoder_action_rgb_brightness(bool clockwise);
  73. void encoder_action_rgb_mode(bool clockwise);
  74. #endif // RGB_MATRIX_ENABLE / RGBLIGHT_ENABLE
  75. #endif // ENCODER_ENABLE
  76. #ifdef RGB_MATRIX_ENABLE
  77. //RGB custom colours
  78. #define RGB_GODSPEED 0x00, 0xE4, 0xFF // colour for matching keycaps
  79. #define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Nautilus Font colours
  80. void activate_rgb_nightmode (bool turn_on);
  81. bool get_rgb_nightmode(void);
  82. #endif
  83. // IDLE TIMEOUTS
  84. #ifdef IDLE_TIMEOUT_ENABLE
  85. #define TIMEOUT_THRESHOLD_DEFAULT 5 // default timeout minutes
  86. #define TIMEOUT_THRESHOLD_MAX 140 // upper limits (2 hours and 10 minutes -- no rgb indicators above this value)
  87. //prototype functions
  88. uint16_t get_timeout_threshold(void);
  89. void timeout_reset_timer(void);
  90. void timeout_update_threshold(bool increase);
  91. void timeout_tick_timer(void);
  92. #endif //IDLE_TIMEOUT_ENABLE
  93. // OTHER FUNCTION PROTOTYPE
  94. void activate_numlock(bool turn_on);