using System.Collections.Generic; using RGB.NET.Core; using RGB.NET.Devices.Wooting.Generic; namespace RGB.NET.Devices.Wooting.Keyboard; /// /// /// Represents a Wooting keyboard. /// public sealed class WootingKeyboardRGBDevice : WootingRGBDevice, IKeyboard { #region Properties & Fields IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo; #endregion #region Constructors /// /// /// Initializes a new instance of the class. /// /// The specific information provided by Wooting for the keyboard /// The update trigger used to update this device. internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info, IUpdateQueue updateQueue) : base(info, updateQueue) { InitializeLayout(); } #endregion #region Methods private void InitializeLayout() { Dictionary mapping = WootingLedMappings.Mapping[DeviceInfo.WootingDeviceType]; foreach (KeyValuePair led in mapping) AddLed(led.Key, new Point(led.Value.column * 19, led.Value.row * 19), new Size(19, 19)); } /// protected override object GetLedCustomData(LedId ledId) => WootingLedMappings.Mapping[DeviceInfo.WootingDeviceType][ledId]; #endregion }