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