> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetHapticInfo

> GetHapticInfo

# GetHapticInfo

提供有關輸入裝置完整觸覺屬性和功能的動態資訊。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
HRESULT GetHapticInfo(
    GameInputHapticInfo* info);
```

### 參數

*info*   \_Out\_\
類型：[GameInputHapticInfo](/zh-TW/reference/input/gameinput/structs/gameinputhapticinfo)\*

包含目前裝置之觸覺中繼資料的結構。

### 傳回值

類型：HRESULT

如果目前裝置的觸覺功能尚未就緒 (或因其他原因無法使用)，則傳回 `GAMEINPUT_E_HAPTIC_NOT_FOUND`。

<a id="remarksSection" />

## 備註

`GetHapticInfo` 方法會查詢目前裝置的觸覺中繼資料。由於觸覺功能依賴 Windows 音訊堆疊，因此在裝置抵達時可能尚無法取得此資訊。強烈建議您不要在裝置連線時呼叫 `GetHapticInfo` 方法，而是[註冊裝置回呼](/zh-TW/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback)並等候 `GameInputDeviceHapticInfoReady` [裝置狀態](/zh-TW/reference/input/gameinput/enums/gameinputdevicestatus)通知。這麼做可確保支援觸覺功能的裝置在被輪詢中繼資料之前，有足夠的時間初始化必要的資源。

<a id="requirementsSection" />

## 需求

**標頭：** GameInput.h

**程式庫：** gameinput.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[GameInput 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)<br />
[GameInputHapticInfo](/zh-TW/reference/input/gameinput/structs/gameinputhapticinfo)<br />
[RegisterDeviceCallback](/zh-TW/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback)<br />
[GameInputDeviceStatus](/zh-TW/reference/input/gameinput/enums/gameinputdevicestatus)<br />
[IGameInputDevice](/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v2** | 已推出。 |


## Related topics

- [GetHapticInfo](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gethapticinfo.md)
- [GameInputHapticInfo](/reference/input/gameinput/structs/gameinputhapticinfo.md)
- [Haptics in GameInput](/build/core-features/common/input/hardware/input-hardware-haptics.md)
- [Hápticos en GameInput](/es/build/core-features/common/input/hardware/input-hardware-haptics.md)
- [GameInput 中的触觉反馈](/zh-CN/build/core-features/common/input/hardware/input-hardware-haptics.md)
