mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Added gRPC sdk client
This commit is contained in:
14 files changed
+426
-130
No files matched your search
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Wooting.Enum;
|
||||
using RGB.NET.Devices.Wooting.Generic;
|
||||
|
||||
namespace RGB.NET.Devices.Wooting.Keyboard;
|
||||
@@ -22,28 +22,12 @@ public sealed class WootingKeyboardRGBDevice : WootingRGBDevice<WootingKeyboardR
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Wooting.Keyboard.WootingKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the Wooting device.</param>
|
||||
/// <param name="info">The specific information provided by Wooting for the keyboard</param>
|
||||
/// <param name="updateTrigger">The update trigger used to update this device.</param>
|
||||
internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info, IUpdateQueue updateQueue)
|
||||
: base(info, updateQueue)
|
||||
{
|
||||
InitializeLayout();
|
||||
}
|
||||
/// <param name="updateQueue">The update queue used to update this device.</param>
|
||||
internal WootingKeyboardRGBDevice(WootingDeviceType deviceType, WootingKeyboardRGBDeviceInfo info, IUpdateQueue updateQueue)
|
||||
: base(deviceType, info, updateQueue)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void InitializeLayout()
|
||||
{
|
||||
Dictionary<LedId, (int row, int column)> mapping = WootingLedMappings.Mapping[DeviceInfo.WootingDeviceType];
|
||||
|
||||
foreach (KeyValuePair<LedId, (int row, int column)> led in mapping)
|
||||
AddLed(led.Key, new Point(led.Value.column * 19, led.Value.row * 19), new Size(19, 19));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object GetLedCustomData(LedId ledId) => WootingLedMappings.Mapping[DeviceInfo.WootingDeviceType][ledId];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -23,17 +23,14 @@ public sealed class WootingKeyboardRGBDeviceInfo : WootingRGBDeviceInfo, IKeyboa
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceInfo">The native <see cref="T:RGB.NET.Devices.Wooting.Native._WootingDeviceInfo" />.</param>
|
||||
internal WootingKeyboardRGBDeviceInfo(_WootingDeviceInfo deviceInfo, byte deviceIndex)
|
||||
: base(RGBDeviceType.Keyboard, deviceInfo, deviceIndex)
|
||||
/// <param name="layout">The layout of the keyboard.</param>
|
||||
/// <param name="model">The model of the keyboard.</param>
|
||||
/// <param name="name">The name of the keyboard.</param>
|
||||
internal WootingKeyboardRGBDeviceInfo(KeyboardLayoutType layout, string model, string name)
|
||||
: base(RGBDeviceType.Keyboard, model, name)
|
||||
{
|
||||
Layout = WootingLayoutType switch
|
||||
{
|
||||
WootingLayoutType.ANSI => KeyboardLayoutType.ANSI,
|
||||
WootingLayoutType.ISO => KeyboardLayoutType.ISO,
|
||||
_ => KeyboardLayoutType.Unknown
|
||||
};
|
||||
Layout = layout;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user