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

# GameInput의 햅틱

> GameInput의 햅틱

GameInput이 노출하는 햅틱 기능은 Windows 오디오 시스템과 통합되어, 호환 장치에 파형 데이터를 성능 좋고 견고하게 스트리밍합니다. 햅틱 지원 장치에 대한 오디오 요구 사항은 일반적인 데스크톱 스피커나 헤드폰과 매우 유사합니다. GameInput은 규약과 제조업체가 지정한 메타데이터를 조합하여 입력 장치를 햅틱 재생에 사용할 오디오 엔드포인트와 연결합니다.

<a id="requirementsSection" />

## 요구 사항

1. 장치는 Windows에서 오디오 원본으로 인식되어야 합니다. 연결 매체(USB, Bluetooth® 등)는 중요하지 않습니다.
2. 장치는 하나 이하의 햅틱 엔드포인트만 노출해야 합니다.
3. 장치는 최대 8개 이하의 햅틱 위치만 노출해야 합니다.
4. 장치는 연결된 후 자신의 햅틱 기능을 변경해서는 안 됩니다.
5. 장치에는 동일한 형식(샘플당 비트 수 및 초당 샘플 수)의 여러 오디오 엔드포인트가 있으면 안 됩니다.
6. 장치는 오디오 엔드포인트에 대해 나머지 장치와 동일한 [컨테이너 ID](https://learn.microsoft.com/windows-hardware/drivers/install/container-ids)를 제공해야 합니다.
7. 장치는 햅틱 엔드포인트를 명시적으로 식별하기 위한 레지스트리 항목을 가지고 있어야 합니다. 형식은 다음과 같습니다.

   * 햅틱 장치는 `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GameInput\Devices` 아래 레지스트리에 열거됩니다.
   * 특정 장치 키는 공급업체 ID, 제품 ID, 사용 페이지, 사용 ID를 16진수 문자열로 조합한 것입니다.
   * `HapticSamplesPerSecond`는 햅틱 엔드포인트 형식의 초당 샘플 수(Hz)를 식별하는 DWORD 값입니다.
   * `HapticsBitsPerSample`은 햅틱 엔드포인트 형식의 샘플 비트 수(샘플 크기)를 식별하는 DWORD 값입니다.
   * `HapticLocations`는 햅틱 위치 GUID의 BYTE 배열입니다. 이 배열은 햅틱 채널 매핑에 대응하는 1\~8개의 GUID를 포함해야 합니다.

   이해를 돕기 위해 다음 샘플 장치를 살펴보세요.

   | 필드      | 값                                                                                 |
   | ------- | --------------------------------------------------------------------------------- |
   | 공급업체 ID | 0x045e                                                                            |
   | 제품 ID   | 0x1234                                                                            |
   | 사용 페이지  | 0x0001                                                                            |
   | 사용 ID   | 0x0005                                                                            |
   | 샘플 주파수  | 0x0fa0                                                                            |
   | 샘플 크기   | 0x0010                                                                            |
   | 햅틱 위치   | GAMEINPUT\_HAPTIC\_LOCATION\_GRIP\_LEFT, GAMEINPUT\_HAPTIC\_LOCATION\_GRIP\_RIGHT |

   관련된 햅틱 레지스트리 항목은 다음과 같습니다.

```
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GameInput\Devices\045E123400010005]
    "HapticSamplesPerSecond"=dword:00000fa0
    "HapticBitsPerSample"=dword:00000010
    "HapticLocations"=hex:c2,07,c7,08,bb,66,6c,40,a8,4a,df,e0,85,12,0a,92,77,0b,5a,\
    15,b2,8b,db,40,86,90,b6,d4,11,26,df,c1
```

### 햅틱 위치

현재, 다음의 햅틱 위치 GUID가 일반 사용을 위해 정의되어 있습니다.

```cpp theme={null}
// { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
DEFINE_GUID(GAMEINPUT_HAPTIC_LOCATION_NONE, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

// { 0xc2, 0x07, 0xc7, 0x08, 0xbb, 0x66, 0x6c, 0x40, 0xa8, 0x4a, 0xdf, 0xe0, 0x85, 0x12, 0x0a, 0x92 }
DEFINE_GUID(GAMEINPUT_HAPTIC_LOCATION_GRIP_LEFT, 0x08c707c2, 0x66bb, 0x406c, 0xa8, 0x4a, 0xdf, 0xe0, 0x85, 0x12, 0x0a, 0x92);

// { 0x77, 0x0b, 0x5a, 0x15, 0xb2, 0x8b, 0xdb, 0x40, 0x86, 0x90, 0xb6, 0xd4, 0x11, 0x26, 0xdf, 0xc1 }
DEFINE_GUID(GAMEINPUT_HAPTIC_LOCATION_GRIP_RIGHT, 0x155a0b77, 0x8bb2, 0x40db, 0x86, 0x90, 0xb6, 0xd4, 0x11, 0x26, 0xdf, 0xc1);

// { 0x96, 0xd8, 0xe4, 0x8d, 0x59, 0x55, 0x81, 0x40, 0x86, 0xe5, 0x17, 0x24, 0xcc, 0x07, 0xc6, 0xbc }
DEFINE_GUID(GAMEINPUT_HAPTIC_LOCATION_TRIGGER_LEFT, 0x8de4d896, 0x5559, 0x4081, 0x86, 0xe5, 0x17, 0x24, 0xcc, 0x07, 0xc6, 0xbc);

// { 0x57, 0xb5, 0x0c, 0xff, 0xf5, 0x3a, 0x6b, 0x40, 0x8b, 0x0f, 0x55, 0x5a, 0x2d, 0x92, 0xa2, 0x20 }
DEFINE_GUID(GAMEINPUT_HAPTIC_LOCATION_TRIGGER_RIGHT, 0xff0cb557, 0x3af5, 0x406b, 0x8b, 0x0f, 0x55, 0x5a, 0x2d, 0x92, 0xa2, 0x20);
```

위 예에서 GUID는 인메모리 리틀 엔디언 표현을 사용하여 레지스트리에 직렬화됩니다.

<a id="seealsoSection" />

## 참조 API 문서

* [GameInput(API 콘텐츠)](/reference/input/gameinput/gameinput_members)
  * 구조체
    * [GameInputHapticInfo](/reference/input/gameinput/structs/gameinputhapticinfo)

## 함께 보기

[GetHapticInfo](/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_gethapticinfo)

[GameInputHapticInfo](/reference/input/gameinput/structs/gameinputhapticinfo)

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

[Windows Audio](/build/console-features/audio/overviews/audio)


## Related topics

- [GameInput 하드웨어: 포스 피드백, 햅틱 및 센서](/ko/build/core-features/common/input/hardware/index.md)
- [GameInput의 센서](/ko/build/core-features/common/input/hardware/input-hardware-sensors.md)
- [GameInput](/ko/reference/input/gameinput/gameinput_members.md)
- [사용되지 않는 GameInput API 멤버](/ko/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)
- [기존 입력 스택과 GameInput 결합](/ko/build/core-features/common/input/porting/input-porting.md)
