> ## 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::GetInputReportInfo

> 擷取裝置所定義之原始輸入報告的描述。

擷取裝置所定義之原始輸入報告的描述。

## 語法

```cpp theme={null}
uint32_t GetInputReportInfo(
    uint32_t infoArrayCount,
    GameInputRawDeviceReportInfo* infoArray
);
```

### 參數

*infoArrayCount*   \_In\_\
類型：uint32\_t

*infoArray* 中的元素數目。若要擷取所有輸入報告，請傳遞 [GetInputReportCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md) 傳回的值。

*infoArray*   \_Out\_writes\_to\_opt\_(infoArrayCount, return)\
類型：[GameInputRawDeviceReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)\*

指向陣列的指標，此陣列會針對每個輸入報告接收一個結構。可以是 `nullptr`，在此情況下不會寫入任何內容，且方法會傳回 0。

### 傳回值

類型：uint32\_t

寫入 *infoArray* 的元素數目。此值為 *infoArrayCount* 與裝置上輸入報告數目兩者中的較小值；如果 *infoArray* 為 `nullptr` 或裝置沒有輸入報告，則為 0。

## 備註

每個元素都是一個 [GameInputRawDeviceReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md) 結構，其 `kind` 成員為 `GameInputRawInputReport`，`id` 成員為裝置定義的報告識別碼，`size` 成員則為報告資料的大小 (以位元組為單位)。

呼叫 [GetInputReportCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md) 以取得輸入報告數目，配置該大小的陣列，然後呼叫 `GetInputReportInfo` 加以填入。如果 *infoArrayCount* 小於輸入報告數目，則只會寫入前 *infoArrayCount* 個元素。在裝置連線期間，裝置的輸入報告不會變更，因此您可以只查詢一次並快取結果。

每個元素的 `id` 成員，會與 [IGameInputReading::GetRawReport](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getrawreport.md) 從此裝置之讀數傳回的原始報告中，由 [IGameInputRawDeviceReport::GetReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/methods/igameinputrawdevicereport_getreportinfo.md) 傳回的報告識別碼相符。

下列範例示範如何擷取裝置的輸入報告。

```cpp theme={null}
uint32_t reportCount = device->GetInputReportCount();
std::vector<GameInputRawDeviceReportInfo> reports(reportCount);
reports.resize(device->GetInputReportInfo(reportCount, reports.data()));

for (const GameInputRawDeviceReportInfo& report : reports)
{
    // report.id identifies an input report that can arrive in readings;
    // report.size is the size of its data in bytes.
}
```

在 GameInput v3 及更早版本中，此資訊可從 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md) 所傳回 [GameInputDeviceInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 結構的 `inputReportInfo` 成員取得。

## 需求

**標頭：** 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)\
[GetInputReportCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md)\
[GameInputRawDeviceReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)\
[GameInputRawDeviceReportKind](https://docs.xbox.com/zh-TW/reference/input/gameinput/enums/gameinputrawdevicereportkind.md)\
[IGameInputRawDeviceReport](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputrawdevicereport/igameinputrawdevicereport.md)\
[IGameInputReading::GetRawReport](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getrawreport.md)\
[GameInput 進階主題](https://docs.xbox.com/zh-TW/build/core-features/common/input/advanced/input-advanced-topics.md)\
[IGameInputDevice](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 版本歷程記錄

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


## Related topics

- [GameInputRawDeviceReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/structs/gameinputrawdevicereportinfo.md)
- [IGameInputDevice::GetInputReportCount](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getinputreportcount.md)
- [IGameInputDevice (介面內容)](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [IGameInputDevice::GetFeatureReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getfeaturereportinfo.md)
- [IGameInputDevice::GetOutputReportInfo](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getoutputreportinfo.md)
