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

# ILampInfo::GetScanCode 方法

> 傳回與 LampArray 鍵盤上的 Lamp 相關聯的鍵盤掃描碼，讓遊戲可以將照明對應至裝置上的特定實體按鍵。

# ILampInfo::GetScanCode

傳回與此 Lamp 相關聯的鍵盤掃描碼。

## 語法

```cpp theme={null}
uint32_t GetScanCode(
)
```

### 參數

此方法沒有參數。

### 傳回值

類型：uint32\_t

與此 Lamp 相關聯的鍵盤掃描碼。如果此 Lamp 無法透過鍵盤掃描碼定址，則傳回 0。

## 備註

如果 LampArray 不支援掃描碼，此方法將傳回 0 (請參閱 [ILampArray::SupportsScanCodes](/zh-TW/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_supportsscancodes))。

## 需求

**標頭：** LampArray.h

**程式庫：** xgameplatform.lib

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[照明 API 概觀](/zh-TW/build/core-features/common/lighting/gc-lighting-toc)\
[Windows 鍵盤輸入參考 - 掃描碼](https://learn.microsoft.com/windows/win32/inputdev/about-keyboard-input#scan-codes)\
[ILampInfo](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/ilampinfo)


## Related topics

- [ILampInfo::GetIndex 方法](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getindex.md)
- [ILampInfo::GetPurposes 方法](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getpurposes.md)
- [ILampInfo::GetPosition 方法](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getposition.md)
- [ILampInfo::GetNearestSupportedColor 方法](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getnearestsupportedcolor.md)
- [ILampInfo::GetFixedColor 方法](/zh-TW/reference/lighting/lamparray/interfaces/ilampinfo/methods/ilampinfo_getfixedcolor.md)
