Parent directory

caps_word.h

1363 bytes
 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
15#pragma once
16
17#include <stdbool.h>
18
19#ifndef CAPS_WORD_IDLE_TIMEOUT
20#    define CAPS_WORD_IDLE_TIMEOUT 5000 // Default timeout of 5 seconds.
21#endif
22
23/** @brief Matrix scan task for Caps Word feature */
24void caps_word_task(void);
25
26#if CAPS_WORD_IDLE_TIMEOUT > 0
27/** @brief Resets timer for Caps Word idle timeout. */
28void caps_word_reset_idle_timer(void);
29#endif
30
31/** @brief Activates Caps Word. */
32void caps_word_on(void);
33
34/** @brief Deactivates Caps Word. */
35void caps_word_off(void);
36
37/** @brief Toggles Caps Word. */
38void caps_word_toggle(void);
39
40/** @brief Gets whether currently active. */
41bool is_caps_word_on(void);
42
43/**
44 * @brief Caps Word set callback.
45 *
46 * @param active True if Caps Word is active, false otherwise
47 */
48void caps_word_set_user(bool active);