mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using RGB.NET.Core;
|
|
|
|
namespace RGB.NET.Devices.Asus
|
|
{
|
|
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
|
/// <summary>
|
|
/// Represents a Asus keyboard.
|
|
/// </summary>
|
|
public class AsusKeyboardRGBDevice : AsusRGBDevice<AsusKeyboardRGBDeviceInfo>, IKeyboard
|
|
{
|
|
#region Constructors
|
|
|
|
/// <inheritdoc />
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" /> class.
|
|
/// </summary>
|
|
/// <param name="info">The specific information provided by Asus for the keyboard.</param>
|
|
internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info)
|
|
: base(info)
|
|
{ }
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
/// <inheritdoc />
|
|
protected override void InitializeLayout()
|
|
{
|
|
//TODO DarthAffe 07.10.2017: This doesn't make sense at all ... Find someone with such a keyboard!
|
|
int ledCount = DeviceInfo.Device.Lights.Count;
|
|
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());
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape;
|
|
|
|
#endregion
|
|
}
|
|
}
|