using System; using RGB.NET.Core; using RGB.NET.Devices.Asus.Native; namespace RGB.NET.Devices.Asus { /// /// /// Represents a Asus keyboard. /// public class AsusKeyboardRGBDevice : AsusRGBDevice { #region Constructors /// /// /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the keyboard. internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info) : base(info) { } #endregion #region Methods /// protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: This doesn't make sense at all ... Find someone with such a keyboard! int ledCount = _AsusSDK.GetClaymoreKeyboardLedCount(DeviceInfo.Handle); for (int i = 0; i < ledCount; i++) InitializeLed(LedId.Keyboard_Escape + i, new Rectangle(i * 19, 0, 19, 19)); string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper(); ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, $@"Layouts\Asus\Keyboards\{model}", $"{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString()); } /// protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape; /// protected override Action GetUpdateColorAction() => _AsusSDK.SetClaymoreKeyboardColor; #endregion } }