1# InputManager
2
3
4## 概述
5
6提供Input设备管理相关的接口。
7
8此类接口包含Input设备的扫描、打开和关闭、特定设备信息查询,以及所有设备列表信息获取等接口。
9
10**起始版本:** 1.0
11
12**相关模块:**[Input](_input.md)
13
14
15## 汇总
16
17
18### Public 属性
19
20| 名称 | 描述 |
21| -------- | -------- |
22| int32_t(\* [ScanInputDevice](#scaninputdevice) )([InputDevDesc](_input_dev_desc.md) \*staArr, uint32_t arrLen) | Input服务用于扫描所有在线设备。  |
23| int32_t(\* [OpenInputDevice](#openinputdevice) )(uint32_t devIndex) | Input服务打开对应设备的设备文件。  |
24| int32_t(\* [CloseInputDevice](#closeinputdevice) )(uint32_t devIndex) | Input服务关闭对应设备的设备文件。  |
25| int32_t(\* [GetInputDevice](#getinputdevice) )(uint32_t devIndex, [InputDeviceInfo](_input_device_info.md) \*\*devInfo) | Input服务获取对应ID的设备信息。  |
26| int32_t(\* [GetInputDeviceList](#getinputdevicelist) )(uint32_t \*devNum, [InputDeviceInfo](_input_device_info.md) \*\*devList, uint32_t size) | Input服务获取所有Input设备列表的设备信息。  |
27
28
29## 类成员变量说明
30
31
32### CloseInputDevice
33
34```
35int32_t(* InputManager::CloseInputDevice) (uint32_t devIndex)
36```
37**描述**
38
39Input服务关闭对应设备的设备文件。
40
41**起始版本:** 1.0
42
43**参数:**
44
45| 名称 | 描述 |
46| -------- | -------- |
47| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 |
48
49**返回:**
50
51INPUT_SUCCESS 表示执行成功。
52
53其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。
54
55
56### GetInputDevice
57
58```
59int32_t(* InputManager::GetInputDevice) (uint32_t devIndex, InputDeviceInfo **devInfo)
60```
61**描述**
62
63Input服务获取对应ID的设备信息。
64
65**起始版本:** 1.0
66
67**参数:**
68
69| 名称 | 描述 |
70| -------- | -------- |
71| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。  |
72| devInfo | 输出参数,即devIndex对应的设备的设备信息,具体参考[InputDeviceInfo](_input_device_info.md)。 |
73
74**返回:**
75
76INPUT_SUCCESS 表示执行成功。
77
78其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。
79
80
81### GetInputDeviceList
82
83```
84int32_t(* InputManager::GetInputDeviceList) (uint32_t *devNum, InputDeviceInfo **devList, uint32_t size)
85```
86**描述**
87
88Input服务获取所有Input设备列表的设备信息。
89
90**起始版本:** 1.0
91
92**参数:**
93
94| 名称 | 描述 |
95| -------- | -------- |
96| devNum | 输出参数,当前已经注册过的所有Input设备的总数。  |
97| devList | 输出参数,Input设备列表所对应的设备信息,具体参考[InputDeviceInfo](_input_device_info.md)。  |
98| size | 输入参数,即指定deviceList数组对应的元素个数。 |
99
100**返回:**
101
102INPUT_SUCCESS 表示执行成功。
103
104其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。
105
106
107### OpenInputDevice
108
109```
110int32_t(* InputManager::OpenInputDevice) (uint32_t devIndex)
111```
112**描述**
113
114Input服务打开对应设备的设备文件。
115
116**起始版本:** 1.0
117
118**参数:**
119
120| 名称 | 描述 |
121| -------- | -------- |
122| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 |
123
124**返回:**
125
126INPUT_SUCCESS 表示执行成功。
127
128其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。
129
130
131### ScanInputDevice
132
133```
134int32_t(* InputManager::ScanInputDevice) (InputDevDesc *staArr, uint32_t arrLen)
135```
136**描述**
137
138Input服务用于扫描所有在线设备。
139
140**起始版本:** 1.0
141
142**参数:**
143
144| 名称 | 描述 |
145| -------- | -------- |
146| staArr | 输出参数,存放Input设备扫描信息的数组,信息包含设备索引以及设备类型。  |
147| arrLen | 输入参数,staArr数组的长度信息。 |
148
149**返回:**
150
151INPUT_SUCCESS 表示执行成功。
152
153其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。
154