1 /*
2  * Copyright 2024 Google LLC
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_INPUT_HID_H_
8 #define ZEPHYR_INCLUDE_INPUT_HID_H_
9 
10 /**
11  * @addtogroup input_interface
12  * @{
13  */
14 
15 /**
16  * @brief Convert an input code to HID code.
17  *
18  * Takes an input code as input and returns the corresponding HID code as
19  * output. The return value is -1 if the code is not found, if found it can
20  * safely be casted to a uint8_t type.
21  *
22  * @param input_code Event code (see @ref INPUT_KEY_CODES).
23  * @retval the HID code corresponding to the input code.
24  * @retval -1 if there's no HID code for the specified input code.
25  */
26 int16_t input_to_hid_code(uint16_t input_code);
27 
28 /**
29  * @brief Convert an input code to HID modifier.
30  *
31  * Takes an input code as input and returns the corresponding HID modifier as
32  * output or 0.
33  *
34  * @param input_code Event code (see @ref INPUT_KEY_CODES).
35  * @retval the HID modifier corresponding to the input code.
36  * @retval 0 if there's no HID modifier for the specified input code.
37  */
38 uint8_t input_to_hid_modifier(uint16_t input_code);
39 
40 /** @} */
41 
42 #endif /* ZEPHYR_INCLUDE_INPUT_HID_H_ */
43