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

# GetExtraButtonIndexes

> GetExtraButtonIndexes

# GetExtraButtonIndexes

특정 입력 종류에 대해 장치의 추가 버튼의 컨트롤러 버튼 인덱스를 가져옵니다.

## 구문

```cpp theme={null}
HRESULT GetExtraButtonIndexes(
    GameInputKind inputKind,
    uint32_t extraButtonCount,
    uint8_t* extraButtonIndexes
);
```

### 매개변수

*inputKind*   \_In\_\
형식: GameInputKind

추가 버튼 인덱스를 요청하는 대상 입력 종류입니다.

*extraButtonCount*   \_In\_\
형식: uint32\_t

추가 버튼의 예상되는 버튼 인덱스 수입니다.
이 숫자는 [GetExtraButtonCount](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount)를 호출하여 검색할 수 있습니다.

*extraButtonIndexes*   \_Out\_writes\_(extraButtonCount)\_\
형식: uint8\_t\*

버튼 인덱스 배열에 대한 포인터입니다.

### 반환값

형식: HRESULT

함수 결과.

## 설명

추가 버튼은 물리적 장치에 존재하지만 지정된 입력 종류에 대한 표준 매핑의 일부가 아닌 컨트롤러 버튼입니다.

이 메서드를 호출하기 전에 먼저 [GetExtraButtonCount](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount)를 호출하여 사용 가능한 추가 버튼이 몇 개인지 확인한 다음, 그 수를 extraButtonCount 매개변수로 전달해야 합니다.

다음 코드 조각은 게임패드의 추가 버튼을 활용하는 방법을 보여줍니다:

```cpp theme={null}
bool GetGamepadExtraButtonValues(
    std::vector<bool>* extraButtons,
    IGameInputReading* reading) noexcept
{
    Mwrl::ComPtr<IGameInputDevice> device;
    reading->GetDevice(&device);

    uint32_t extraButtonCount = 0;
    if (FAILED(device->GetExtraButtonCount(GameInputKindGamepad, &extraButtonCount)))
    {
        return false;
    }

    std::vector<uint8_t> buttonIndexes(extraButtonCount);
    extraButtons->resize(extraButtonCount);
    if (FAILED(device->GetExtraButtonIndexes(
        GameInputKindGamepad,
        extraButtonCount,
        buttonIndexes.data())))
    {
        return false;
    }

    std::vector<bool> buttonStates(reading->GetControllerButtonCount());
    reading->GetControllerButtonState(static_cast<uint32_t>(buttonStates.size()), buttonStates.data());

    for (size_t i = 0; i < buttonIndexes.size(); ++i)
    {
        if (buttonIndexes[i] < buttonStates.size())
        {
            (*extraButtons)[i] = buttonStates[buttonIndexes[i]];
        }
    }

    return true;
}
```

## 요구 사항

**헤더:** GameInput.h

**라이브러리:** gameinput.lib

**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[GameInputKind](/ko/reference/input/gameinput/enums/gameinputkind)\

[GetExtraButtonCount](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount)\

[GetExtraAxisIndexes](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxisindexes)\

[IGameInputDevice](/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## 버전 기록

| 버전 | 변경 사항 |
| - | - |
| **v3** | 도입됨. |


## Related topics

- [GetExtraButtonCount](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextrabuttoncount.md)
- [GetExtraAxisIndexes](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxisindexes.md)
- [IGameInputDevice (인터페이스 콘텐츠)](/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)
- [GetExtraAxisCount](/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getextraaxiscount.md)
- [GameInputGamepadInfo](/ko/reference/input/gameinput/structs/gameinputgamepadinfo.md)
