using System.Collections.Generic;
using System.Linq;
using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Enum;
using RGB.NET.Devices.Wooting.Generic;
namespace RGB.NET.Devices.Wooting.Keyboard
{
///
///
/// Represents a Wooting keyboard.
///
public 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
internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info)
: base(info)
{ }
#endregion
#region Methods
///
protected override void InitializeLayout()
{
//TODO DarthAffe 13.02.2021: Check how the mapping can work without knowing the physical layout
Dictionary mapping = WootingKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][WootingPhysicalKeyboardLayout.US];
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) => WootingKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][WootingPhysicalKeyboardLayout.US][ledId];
///
protected override void UpdateLeds(IEnumerable ledsToUpdate) => UpdateQueue?.SetData(GetUpdateData(ledsToUpdate));
#endregion
}
}