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

# RegisterSystemButtonCallback

> IGameInput::RegisterSystemButtonCallback

# IGameInput::RegisterSystemButtonCallback

Guide 또는 Share 버튼이 눌리거나 놓일 때 호출되는 콜백 함수를 등록합니다.

## 구문

```cpp theme={null}
HRESULT RegisterSystemButtonCallback(
    IGameInputDevice* device,
    GameInputSystemButtons buttonFilter,
    void* context,
    GameInputSystemButtonCallback callbackFunc,
    GameInputCallbackToken* callbackToken
);
```

### 매개변수

*device*   \_In\_opt\_\
형식: IGameInputDevice\*

선택적으로 등록된 콜백이 특정 장치에 대해 트리거되도록 제한합니다.

*buttonFilter*   \_In\_\
형식: GameInputSystemButtons

콜백을 받을 버튼 집합으로, 논리적 OR로 결합됩니다.

*context*   \_In\_opt\_\
형식: void\*

콜백 함수에 관련된 정보를 제공하는 개체입니다. 일반적으로 호출 개체입니다.

*callbackFunc*   \_In\_\
형식: GameInputSystemButtonCallback

시스템 버튼이 눌리거나 놓일 때 호출되는 타이틀 정의 콜백 함수입니다.

*callbackToken*   \_Out\_opt\_\
형식: GameInputCallbackToken\*

등록된 콜백 함수를 식별하는 토큰입니다. 이 토큰은 콜백 함수를 취소하거나 등록 해제해야 하는 경우 등록된 함수를 식별하는 데 사용됩니다.

### 반환값

형식: HRESULT

함수 결과.

## 설명

이 메서드는 Guide 또는 System 버튼이 눌리거나 놓일 때 호출되는 콜백 함수를 등록합니다. 콜백이 발송되는지 여부는 사용자의 프로세스와 다른 프로세스에서 [IGameInput::SetFocusPolicy](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_setfocuspolicy)에 의해 설정된 [GameInputFocusPolicy](/ko/reference/input/gameinput/enums/gameinputfocuspolicy)에 따라 다릅니다. 자세한 내용은 [GameInputFocusPolicy](/ko/reference/input/gameinput/enums/gameinputfocuspolicy)를 참조하세요. XBOX에서는 셸이 항상 Guide 버튼을 소비하므로, 이러한 콜백은 XBOX에서 절대 디스패치되지 않습니다.

콜백 수신을 중지하려면 [IGameInput::UnregisterCallback](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback) 및 [IGameInput::StopCallback](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback) 메서드를 참조하세요.

이는 Windows SDK 10.0.26031 미리 보기 GameInput.h에 추가되었으며, 향후 GDK 릴리스에 추가될 예정입니다.

다음 코드 예제는 Guide 버튼 누름을 수신하는 방법을 보여줍니다.

```cpp theme={null}
Microsoft::WRL::ComPtr<IGameInput> gameInput;

void CALLBACK OnGuideButton(
    _In_ GameInputCallbackToken callbackToken,
    _In_ void * context,
    _In_ IGameInputDevice * device,
    _In_ uint64_t timestamp,
    _In_ GameInputSystemButtons currentButtons,
    _In_ GameInputSystemButtons previousButtons)
{
    bool guidePressed = currentButtons & GameInputSystemButtons::GameInputSystemButtonGuide;
    bool guidePreviouslyPressed = previousButtons & GameInputSystemButtons::GameInputSystemButtonGuide;
    if (guidePressed && !guidePreviouslyPressed)
    {
        // Handle new Guide button press
    }
    else if (!guidePressed && guidePreviouslyPressed)
    {
        // Handle new Guide button release
    }
}

void RegisterForGuideButton() noexcept
{
    GameInputCallbackToken token;
    if (SUCCEEDED(gameInput->RegisterSystemButtonCallback(
        nullptr, // All devices
        GameInputSystemButtons::GameInputSystemButtonGuide, // Filter to the Guide button
        nullptr, // No context
        OnGuideButton, // Callback
        &token))) // token
    {
        // Success!
    }
}
```

## 요구 사항

**헤더:** GameInput.h

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

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

## 함께 보기

[고급 GameInput 항목](/ko/build/core-features/common/input/advanced/input-advanced-topics)\

[GameInput 개요](/ko/build/core-features/common/input/overviews/input-overview)\

[IGameInput](/ko/reference/input/gameinput/interfaces/igameinput/igameinput)

## 버전 기록

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


## Related topics

- [GameInputSystemButtonCallback](/ko/reference/input/gameinput/functions/gameinputsystembuttoncallback.md)
- [IGameInput::RegisterGuideButtonCallback (사용되지 않음)](/ko/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_registerguidebuttoncallback.md)
- [GameInputSystemButtons](/ko/reference/input/gameinput/enums/gameinputsystembuttons.md)
- [GameInputGuidButtonCallback (사용되지 않음)](/ko/reference/input/gameinput/deprecated/functions/gameinputguidebuttoncallback.md)
- [IGameInput::StopCallback](/ko/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback.md)
