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

> ILampInfo::GetScanCode

# ILampInfo::GetScanCode

返回与此 Lamp 关联的键盘扫描代码。

## 语法

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

### 参数

此方法没有参数。

### 返回值

类型：uint32\_t

与此 Lamp 关联的键盘扫描代码。如果此 Lamp 无法通过键盘扫描代码寻址，则返回 0。

## 备注

如果 LampArray 不支持扫描代码（请参阅 [ILampArray::SupportsScanCodes](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_supportsscancodes)），此方法将返回 0。

## 要求

**头文件：** LampArray.h

**库：** xgameplatform.lib

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[光照 API 概览](/build/core-features/common/lighting/gc-lighting-toc)\
[Windows 键盘输入参考 - 扫描代码](https://learn.microsoft.com/windows/win32/inputdev/about-keyboard-input#scan-codes)\
[ILampInfo](/reference/lighting/lamparray/interfaces/ilampinfo/ilampinfo)


## Related topics

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