> ## 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.

# IGameInputDevice::GetTouchSurfaceCount

> 取得輸入裝置上的觸控表面數目。

取得輸入裝置上的觸控表面數目。

## 語法

```cpp theme={null}
uint32_t GetTouchSurfaceCount();
```

### 參數

此方法沒有參數。

### 傳回值

類型：uint32\_t

裝置上的觸控表面數目；如果裝置沒有觸控表面，則為 0。

## 備註

觸控表面是裝置上回報觸控接觸點的區域，例如 DualSense 或 DualShock 4 控制器上的觸控板。具有至少一個觸控表面的裝置，會在 [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) 傳回的值中包含 `GameInputKindTouch`。

觸控表面是以從零開始的索引來識別，此索引小於此方法傳回的值。使用該索引呼叫 [IGameInputDevice::GetTouchSurfaceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfaceinfo.md) 以取得表面的描述，以及呼叫 [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md) 從讀數中讀取表面上的接觸點。

觸控表面數目在裝置物件的存留期間內不會變更。

> [!NOTE]
>
> 觸控支援取決於裝置和平台。

## 需求

**標頭：** 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)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::GetTouchSurfaceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfaceinfo.md)\
[GameInputTouchSurfaceInfo](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputtouchsurfaceinfo)\
[IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)

## 版本歷程記錄

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


## Related topics

- [IGameInputDevice::GetTouchSurfaceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gettouchsurfaceinfo.md)
- [IGameInputReading::GetTouchContactCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchcontactcount.md)
- [IGameInputReading::GetTouchSurfaceState](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_gettouchsurfacestate.md)
- [IGameInputDevice::GetSupportedInput](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md)
- [IGameInputDevice::GetInputReportCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md)
