openharmony 鸿蒙 capi-game-device

2026-08-25 浏览 (1)

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

NameDescription
typedef struct GameDevice_AllDeviceInfos GameDevice_AllDeviceInfosDefines the result of OH_GameDevice_GetAllDeviceInfos calls.

Functions

NameDescription
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-pad

openharmony 鸿蒙 capi-game-device-event

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 capi-game-pad-event

openharmony 鸿蒙 capi-game-controller

openharmony 鸿蒙 capi-game-controller-type

openharmony 鸿蒙 gamecontroller-c-error-code

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/q0ArVvvt