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

# XInputGetKeystroke

> XInputGetKeystroke

# XInputGetKeystroke

게임패드 입력 이벤트를 검색합니다.

## 구문

```cpp theme={null}
DWORD XInputGetKeystroke(  
         DWORD dwUserIndex,  
         _Reserved_ dwReserved,  
         XINPUT_KEYSTROKE* pKeystroke  
)  
```

### 매개변수

*dwUserIndex*   \_In\_\
형식: DWORD

장치와 연결된 로그인된 게이머의 인덱스입니다. 값은 0에서 XUSER\_MAX\_COUNT - 1 범위입니다. XUSER\_INDEX\_ANY는 임의의 사용자에게서 다음으로 사용 가능한 입력 이벤트를 가져오는 데 사용됩니다.

*dwReserved*   \
형식: *Reserved*

이 매개변수는 사용되지 않습니다.

*pKeystroke*   \_Out\_\
형식: [XINPUT\_KEYSTROKE\*](/reference/input/xinputongameinput/structs/xinput_keystroke)

입력 이벤트를 받는 [XINPUT\_KEYSTROKE](/reference/input/xinputongameinput/structs/xinput_keystroke) 구조체에 대한 포인터입니다.

### 반환값

형식: DWORD

* 함수가 성공하면 **ERROR\_SUCCESS**를 반환합니다.
* 새로 눌린 키가 없으면 함수는 **ERROR\_EMPTY**를 반환합니다.
* 컨트롤러가 연결되지 않았거나 사용자가 활성화하지 않은 경우 함수는 **ERROR\_DEVICE\_NOT\_CONNECTED**를 반환합니다. 아래의 설명 섹션을 참조하세요.
* 함수가 실패하면 Winerror.h에 정의된 오류 코드를 반환합니다.

## 설명

무선 컨트롤러는 시스템 시작 시 활성 상태로 간주되지 않습니다. 무선 컨트롤러가 활성화되기 전에 XInput 함수 중 하나가 호출되면 해당 호출은 **ERROR\_DEVICE\_NOT\_CONNECTED**를 반환합니다. 게임 타이틀은 반환 코드를 확인하고 이 조건을 처리할 준비가 되어 있어야 합니다. 유선 컨트롤러는 삽입될 때 자동으로 활성화됩니다. 무선 컨트롤러는 사용자가 시작 버튼 또는 가이드 버튼을 눌러 컨트롤러를 켤 때 활성화됩니다.

XInput에서 GameInput으로 이식하려는 코드가 GetKeyStroke 함수를 호출하지 않는 경우 XINPUT\_ON\_GAMEINPUT\_NO\_XINPUTGETKEYSTROKE를 정의하여 XInput 래퍼의 크기를 줄일 수 있습니다. 자세한 내용은 [XInput에서 GameInput으로 이식](/build/core-features/common/input/porting/input-porting-xinput#optimizingSection)을 참조하세요.

## 요구 사항

**헤더:** XInputOnGameInput.h

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

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

## 참고 항목

[XInput을 GameInput으로 이식](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_KEYSTROKE](/ko/reference/input/xinputongameinput/structs/xinput_keystroke.md)
- [XInputOnGameInput](/ko/reference/input/xinputongameinput/xinputongameinput_members.md)
- [XInput에서 GameInput으로 포팅](/ko/build/core-features/common/input/porting/input-porting-xinput.md)
- [XInputGetCapabilities](/ko/reference/input/xinputongameinput/functions/xinputgetcapabilities.md)
- [XInputGetState](/ko/reference/input/xinputongameinput/functions/xinputgetstate.md)
