game_device.h
Overview
Defines APIs for game devices.
File to include: <GameControllerKit/game_device.h>
Library: libohgame_controller.z.so
System capability: SystemCapability.Game.GameController
Since: 21
Related module: GameController
Summary
Types
| Name | Description |
|---|---|
| typedef struct GameDevice_AllDeviceInfos GameDevice_AllDeviceInfos | Defines the result of OH_GameDevice_GetAllDeviceInfos calls. |
Functions
| Name | Description |
|---|---|
| GameController_ErrorCode OH_GameDevice_GetAllDeviceInfos (GameDevice_AllDeviceInfos **allDeviceInfos) | Obtains information about all online devices. |
| GameController_ErrorCode OH_GameDevice_RegisterDeviceMonitor (GameDevice_DeviceMonitorCallback deviceMonitorCallback) | Registers the listening callback for device status change events. |
| GameController_ErrorCode OH_GameDevice_UnregisterDeviceMonitor (void) | Unregisters the listening callback for device status change events. |
| GameController_ErrorCode OH_GameDevice_DestroyAllDeviceInfos (GameDevice_AllDeviceInfos **allDeviceInfos) | Destroys a GameDevice_AllDeviceInfos instance when it is no longer used. |
| GameController_ErrorCode OH_GameDevice_AllDeviceInfos_GetCount (const struct GameDevice_AllDeviceInfos *allDeviceInfos, int32_t *count) | Obtains the number of devices. |
| GameController_ErrorCode OH_GameDevice_AllDeviceInfos_GetDeviceInfo (const struct GameDevice_AllDeviceInfos *allDeviceInfos, const int32_t index, GameDevice_DeviceInfo **deviceInfo) | Obtains the information about a device with a specified index from all device information. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-game-device-event
openharmony 鸿蒙 capi-game-pad-event
openharmony 鸿蒙 capi-game-controller