jonavin.h 3.9 KB

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