Share via


LampArray Class

Definition

Represents a LampArray device attached the system. Currently, only HID LampArrays are supported.

public ref class LampArray sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LampArray final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class LampArray
Public NotInheritable Class LampArray
Inheritance
Object Platform::Object IInspectable LampArray
Attributes

Windows requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v7.0)

Examples

LampArray sample

Demonstrates how to control RGB lighting of peripheral devices using the Windows.Devices.Lights and Windows.Devices.Lights.Effects APIs.

AutoRGB Sample

Demonstrates how to extract a single, representative color from a desktop screen and use it to illuminate LED lamps on a connected RGB device.

Remarks

LampArray devices have one or more lamp indexes (for example, lights/LEDs/bulbs, etc…) whose color state can be directly manipulated. Static information (retrieved from the device) describe supported colors, geometric positions and intended purposes for each lamp index.

These devices can be found as part of composite devices (for example, keyboard with RGB lighting) or as standalone.

An application can set lamp state at any time, but state will only be applied by the system while application is in focus.

LampArrays are enumerated by DeviceWatcher, and retrieved via FromIdAsync.

Properties

BoundingBox

Gets the logical bounding box encompassing the LampArray.

BrightnessLevel

Gets or sets the overall brightness of the LampArray, where 0.0 is completely off and 1.0 is maximum brightness.

Every lamp is scaled equally by the brightness.

DeviceId

Gets the plug and play (PnP) device identifier of the underlying LampArray device.

HardwareProductId

The hardware product Id of the underlying device.

HardwareVendorId

The hardware vendor Id of the underlying device.

HardwareVersion

The hardware version of the underlying device.

IsAvailable

Gets whether the lamp array is available or unavailable for control by this process.

IsConnected

Gets a value indicating whether the LampArray device is connected to the system.

IsEnabled

Gets or sets the enabled state.

LampArrayKind

Gets the type of lamp array device.

LampCount

The number of lamps part of this LampArray.

MinUpdateInterval

Minimal interval (required by the device) between the system sending two updates for any one lamp. This is comparable to the effective device refresh rate.

SupportsVirtualKeys

Boolean indicating whether any lamp is mapped to a virtual key.

Methods

FromIdAsync(String)

Retrieves a LampArray object asynchronously for the LampArray device that has the specified plug and play (PnP) device identifier/device instance path.

GetDeviceSelector()

Retrieves an Advanced Query Syntax (AQS) string encompassing all LampArray devices on the system.

GetIndicesForKey(VirtualKey)

Searches for all lamp indices that are bound to the specific VirtualKey

GetIndicesForPurposes(LampPurposes)

Searches for all lamp indices that are bound to the specified LampPurposes.

GetLampInfo(Int32)

Fetches the LampInfo corresponding to the lamp index.

RequestMessageAsync(Int32)

Asynchronously retrieves an IBuffer representing the message identified by the message identifer argument.

SendMessageAsync(Int32, IBuffer)

Asynchronously sends a message identified by the message identifer argument.

SetColor(Color)

Sets every lamp belonging to the LampArray to the desired color.

SetColorForIndex(Int32, Color)

Sets the lamp corresponding to the index to the desired color.

SetColorsForIndices(Color[], Int32[])

Sets the color for multiple lamps. Position within each array maps lamp index to desired color.

SetColorsForKey(Color, VirtualKey)

Sets the color for all lamps that map to the key. Multiple lamps can map to the same key.

SetColorsForKeys(Color[], VirtualKey[])

Sets the color of multiple lamps, corresponding to mapped keys. Position within each array maps keys to desired color.

SetColorsForPurposes(Color, LampPurposes)

Sets the color of multiple lamps, corresponding to LampPurposes.

SetSingleColorForIndices(Color, Int32[])

Sets all lamps specified to the same color.

Events

AvailabilityChanged

Is raised when the value of IsAvailable changes; which can happen when the user changes system access to the device through the device settings.

The event handler's parameters are the sender LampArray whose property has changed, and an Object (which is always null).

Applies to

See also