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

# GetHapticInfo

> GetHapticInfo

# GetHapticInfo

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

## 語法

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

### 參數

*info*   \_Out\_\
類型：[GameInputHapticInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputhapticinfo.md)\*

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

### 傳回值

類型：HRESULT

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

## 備註

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

## 需求

**標頭：** GameInput.h

**程式庫：** gameinput.lib

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

## 另請參閱

[GameInput 概觀](https://docs.xbox.com/zh-TW/build/core-features/common/input/overviews/input-overview.md)\

[GameInputHapticInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputhapticinfo.md)\

[RegisterDeviceCallback](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)\

[GameInputDeviceStatus](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputdevicestatus.md)\

[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本歷程記錄

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


## Related topics

- [GameInputHapticInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputhapticinfo.md)
- [GameInput 觸覺回饋需求](https://docs.xbox.com/zh-TW/build/core-features/common/input/hardware/input-hardware-haptics.md)
- [IGameInputDevice (介面內容)](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [GameInput API 成員](https://docs.xbox.com/zh-TW/reference/input/gameinput/gameinput_members.md)
- [已淘汰的 GameInput API 成員](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)
