openharmony 鸿蒙 capi-game-pad

2026-08-25 浏览 (1)

game_pad.h

Overview

Defines APIs for game controllers.

File to include: <GameControllerKit/game_pad.h>

Library: libohgame_controller.z.so

System capability: SystemCapability.Game.GameController

Since: 21

Related module: GameController

Summary

Functions

NameDescription
GameController_ErrorCode OH_GamePad_LeftShoulder_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Shoulder button event.
GameController_ErrorCode OH_GamePad_LeftShoulder_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Left Shoulder button event.
GameController_ErrorCode OH_GamePad_RightShoulder_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Shoulder button event.
GameController_ErrorCode OH_GamePad_RightShoulder_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Right Shoulder button event.
GameController_ErrorCode OH_GamePad_LeftTrigger_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Trigger button event.
GameController_ErrorCode OH_GamePad_LeftTrigger_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Left Trigger button event.
GameController_ErrorCode OH_GamePad_LeftTrigger_RegisterAxisInputMonitor (GamePad_AxisInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Trigger axis event.
GameController_ErrorCode OH_GamePad_LeftTrigger_UnregisterAxisInputMonitor (void)Unregisters the listening callback for the Left Trigger axis event.
GameController_ErrorCode OH_GamePad_RightTrigger_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Trigger button event.
GameController_ErrorCode OH_GamePad_RightTrigger_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Right Trigger button event.
GameController_ErrorCode OH_GamePad_RightTrigger_RegisterAxisInputMonitor (GamePad_AxisInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Trigger axis event.
GameController_ErrorCode OH_GamePad_RightTrigger_UnregisterAxisInputMonitor (void)Unregisters the listening callback for the Right Trigger axis event.
GameController_ErrorCode OH_GamePad_ButtonMenu_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Menu button event.
GameController_ErrorCode OH_GamePad_ButtonMenu_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Menu button event.
GameController_ErrorCode OH_GamePad_ButtonHome_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Home button event.
GameController_ErrorCode OH_GamePad_ButtonHome_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Home button event.
GameController_ErrorCode OH_GamePad_ButtonA_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the A button event.
GameController_ErrorCode OH_GamePad_ButtonA_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the A button event.
GameController_ErrorCode OH_GamePad_ButtonB_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the B button event.
GameController_ErrorCode OH_GamePad_ButtonB_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the B button event.
GameController_ErrorCode OH_GamePad_ButtonX_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the X button event.
GameController_ErrorCode OH_GamePad_ButtonX_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the X button event.
GameController_ErrorCode OH_GamePad_ButtonY_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Y button event.
GameController_ErrorCode OH_GamePad_ButtonY_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Y button event.
GameController_ErrorCode OH_GamePad_ButtonC_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the C button event.
GameController_ErrorCode OH_GamePad_ButtonC_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the C button event.
GameController_ErrorCode OH_GamePad_Dpad_LeftButton_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_LeftButton_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Left Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_RightButton_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_RightButton_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Right Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_UpButton_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Up Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_UpButton_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Up Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_DownButton_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Down Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_DownButton_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Down Directional button event.
GameController_ErrorCode OH_GamePad_Dpad_RegisterAxisInputMonitor (GamePad_AxisInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Directional Pad button axis event.
GameController_ErrorCode OH_GamePad_Dpad_UnregisterAxisInputMonitor (void)Unregisters the listening callback for the Directional Pad button axis event.
GameController_ErrorCode OH_GamePad_LeftThumbstick_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Thumbstick button event.
GameController_ErrorCode OH_GamePad_LeftThumbstick_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Left Thumbstick button event.
GameController_ErrorCode OH_GamePad_LeftThumbstick_RegisterAxisInputMonitor (GamePad_AxisInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Left Thumbstick axis event.
GameController_ErrorCode OH_GamePad_LeftThumbstick_UnregisterAxisInputMonitor (void)Unregisters the listening callback for the Left Thumbstick axis event.
GameController_ErrorCode OH_GamePad_RightThumbstick_RegisterButtonInputMonitor (GamePad_ButtonInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Thumbstick button event.
GameController_ErrorCode OH_GamePad_RightThumbstick_UnregisterButtonInputMonitor (void)Unregisters the listening callback for the Right Thumbstick button event.
GameController_ErrorCode OH_GamePad_RightThumbstick_RegisterAxisInputMonitor (GamePad_AxisInputMonitorCallback inputMonitorCallback)Registers the listening callback for the Right Thumbstick axis event.
GameController_ErrorCode OH_GamePad_RightThumbstick_UnregisterAxisInputMonitor (void)Unregisters the listening callback for the Right Thumbstick axis event.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-game-device-event

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 capi-game-device

openharmony 鸿蒙 capi-game-pad-event

openharmony 鸿蒙 capi-game-controller

openharmony 鸿蒙 capi-game-controller-type

openharmony 鸿蒙 gamecontroller-c-error-code

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