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**描述** 38Input服务关闭对应设备的设备文件。 39 40**起始版本:** 1.0 41 42**参数:** 43 44| 名称 | 描述 | 45| -------- | -------- | 46| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 47 48**返回:** 49 50INPUT_SUCCESS 表示执行成功。 51 52其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 53 54 55### GetInputDevice 56 57``` 58int32_t(* InputManager::GetInputDevice) (uint32_t devIndex, InputDeviceInfo **devInfo) 59``` 60**描述** 61Input服务获取对应ID的设备信息。 62 63**起始版本:** 1.0 64 65**参数:** 66 67| 名称 | 描述 | 68| -------- | -------- | 69| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 70| devInfo | 输出参数,即devIndex对应的设备的设备信息,具体参考[InputDeviceInfo](_input_device_info.md)。 | 71 72**返回:** 73 74INPUT_SUCCESS 表示执行成功。 75 76其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 77 78 79### GetInputDeviceList 80 81``` 82int32_t(* InputManager::GetInputDeviceList) (uint32_t *devNum, InputDeviceInfo **devList, uint32_t size) 83``` 84**描述** 85Input服务获取所有Input设备列表的设备信息。 86 87**起始版本:** 1.0 88 89**参数:** 90 91| 名称 | 描述 | 92| -------- | -------- | 93| devNum | 输出参数,当前已经注册过的所有Input设备的总数。 | 94| devList | 输出参数,Input设备列表所对应的设备信息,具体参考[InputDeviceInfo](_input_device_info.md)。 | 95| size | 输入参数,即指定deviceList数组对应的元素个数。 | 96 97**返回:** 98 99INPUT_SUCCESS 表示执行成功。 100 101其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 102 103 104### OpenInputDevice 105 106``` 107int32_t(* InputManager::OpenInputDevice) (uint32_t devIndex) 108``` 109**描述** 110Input服务打开对应设备的设备文件。 111 112**起始版本:** 1.0 113 114**参数:** 115 116| 名称 | 描述 | 117| -------- | -------- | 118| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 119 120**返回:** 121 122INPUT_SUCCESS 表示执行成功。 123 124其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 125 126 127### ScanInputDevice 128 129``` 130int32_t(* InputManager::ScanInputDevice) (InputDevDesc *staArr, uint32_t arrLen) 131``` 132**描述** 133Input服务用于扫描所有在线设备。 134 135**起始版本:** 1.0 136 137**参数:** 138 139| 名称 | 描述 | 140| -------- | -------- | 141| staArr | 输出参数,存放Input设备扫描信息的数组,信息包含设备索引以及设备类型。 | 142| arrLen | 输入参数,staArr数组的长度信息。 | 143 144**返回:** 145 146INPUT_SUCCESS 表示执行成功。 147 148其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 149