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.

43 lines
1.4 KiB

  1. // Copyright 2021-2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "quantum.h"
  16. #ifndef CAPS_WORD_IDLE_TIMEOUT
  17. # define CAPS_WORD_IDLE_TIMEOUT 5000 // Default timeout of 5 seconds.
  18. #endif // CAPS_WORD_IDLE_TIMEOUT
  19. #if CAPS_WORD_IDLE_TIMEOUT > 0
  20. /** @brief Matrix scan task for Caps Word feature */
  21. void caps_word_task(void);
  22. /** @brief Resets timer for Caps Word idle timeout. */
  23. void caps_word_reset_idle_timer(void);
  24. #else
  25. static inline void caps_word_task(void) {}
  26. #endif // CAPS_WORD_IDLE_TIMEOUT > 0
  27. void caps_word_on(void); /**< Activates Caps Word. */
  28. void caps_word_off(void); /**< Deactivates Caps Word. */
  29. void caps_word_toggle(void); /**< Toggles Caps Word. */
  30. bool is_caps_word_on(void); /**< Gets whether currently active. */
  31. /**
  32. * @brief Caps Word set callback.
  33. *
  34. * @param active True if Caps Word is active, false otherwise
  35. */
  36. void caps_word_set_user(bool active);