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

# Lighting API reference for LampArray peripherals

> GDK Lighting API reference for enumerating LampArray peripherals like keyboards, mice, and headsets and controlling their RGB lighting.

# Lighting API Reference

Lighting API reference material for the Microsoft Game Development Kit (GDK). Use these APIs to enumerate compatible LampArray peripherals (keyboards, mice, headsets, and other HID lighting devices) and control their RGB lighting.

## Enumerate compatible peripherals

To discover compatible peripherals, register a status callback that the LampArray API invokes for each connected device, and again whenever a device is attached or removed.

1. Implement a [LampArrayStatusCallback](/reference/lighting/lamparray/functions/lamparraystatuscallback) function to receive device connect and disconnect events.
2. Call [RegisterLampArrayStatusCallback](/reference/lighting/lamparray/functions/registerlamparraystatuscallback) to register the callback. Pass a [LampArrayEnumerationKind](/reference/lighting/lamparray/enums/lamparrayenumerationkind) value to control whether initial enumeration runs asynchronously or blocks until every connected device has been reported.
3. In the callback, inspect the [ILampArray](/reference/lighting/lamparray/interfaces/ilamparray/ilamparray) instance to read device properties such as [DeviceId](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getdeviceid), [LampArrayKind](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getlamparraykind), [LampCount](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getlampcount), [VendorId](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getvendorid), and [ProductId](/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getproductid).
4. When you no longer need notifications, call [UnregisterLampArrayCallback](/reference/lighting/lamparray/functions/unregisterlamparraycallback) to stop receiving events.

For a complete walkthrough with sample code, see [LampArray basics](/build/core-features/common/lighting/lighting-basics).

## In this section

[LampArray](/reference/lighting/lamparray/lamparray_members)<br />LampArray API members, including the functions, interfaces, enums, and structs used to enumerate devices and control lighting.

## See also

[Lighting API Overview](/build/core-features/common/lighting/gc-lighting-toc)


## Related topics

- [LampArray API members reference](/reference/lighting/lamparray/lamparray_members.md)
- [Lighting API and LampArray on XBOX and PC](/build/core-features/common/lighting/index.md)
- [LampArrayKind enum reference](/reference/lighting/lamparray/enums/lamparraykind.md)
- [LampArrayCallback function reference](/reference/lighting/lamparray/functions/lamparraycallback.md)
- [LampArrayStatusCallback function reference](/reference/lighting/lamparray/functions/lamparraystatuscallback.md)
