mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Updated wooting device provider to support newer keyboards
This commit is contained in:
1 parent
e332d79a47
commit
17bd13b995
8 files changed
+34
-56
No files matched your search
@@ -13,9 +13,9 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
#region Wooting One
|
||||
#region TKL
|
||||
|
||||
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_US = new()
|
||||
private static readonly Dictionary<LedId, (int row, int column)> TKL_US = new()
|
||||
{
|
||||
{ LedId.Keyboard_Escape, (0,0) },
|
||||
{ LedId.Keyboard_F1, (0,2) },
|
||||
@@ -111,7 +111,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
{ LedId.Keyboard_ArrowRight, (5,16) }
|
||||
};
|
||||
|
||||
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_UK = new()
|
||||
private static readonly Dictionary<LedId, (int row, int column)> TKL_UK = new()
|
||||
{
|
||||
{ LedId.Keyboard_Escape, (0,0) },
|
||||
{ LedId.Keyboard_F1, (0,2) },
|
||||
@@ -178,7 +178,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
{ LedId.Keyboard_L, (3,9) },
|
||||
{ LedId.Keyboard_SemicolonAndColon, (3,10) },
|
||||
{ LedId.Keyboard_ApostropheAndDoubleQuote, (3,11) },
|
||||
{ LedId.Keyboard_NonUsTilde, (3,11) },
|
||||
{ LedId.Keyboard_NonUsTilde, (3,12) },
|
||||
{ LedId.Keyboard_Enter, (3,13) },
|
||||
|
||||
{ LedId.Keyboard_LeftShift, (4,0) },
|
||||
@@ -211,9 +211,9 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
|
||||
#endregion
|
||||
|
||||
#region Wooting Two
|
||||
#region Fullsize
|
||||
|
||||
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_US = new()
|
||||
private static readonly Dictionary<LedId, (int row, int column)> Fullsize_US = new()
|
||||
{
|
||||
{ LedId.Keyboard_Escape, (0,0) },
|
||||
{ LedId.Keyboard_F1, (0,2) },
|
||||
@@ -330,7 +330,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
{ LedId.Keyboard_NumPeriodAndDelete, (5,19) }
|
||||
};
|
||||
|
||||
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_UK = new()
|
||||
private static readonly Dictionary<LedId, (int row, int column)> Fullsize_UK = new()
|
||||
{
|
||||
{ LedId.Keyboard_Escape, (0,0) },
|
||||
{ LedId.Keyboard_F1, (0,2) },
|
||||
@@ -454,20 +454,20 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
/// <summary>
|
||||
/// Contains all the hardware-id mappings for Wooting devices.
|
||||
/// </summary>
|
||||
public static readonly Dictionary<WootingDevicesIndexes, Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>> Mapping =
|
||||
public static readonly Dictionary<WootingDeviceType, Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>> Mapping =
|
||||
new()
|
||||
{
|
||||
{ WootingDevicesIndexes.WootingOne, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
|
||||
{ WootingDeviceType.KeyboardTKL, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
|
||||
{
|
||||
{ WootingPhysicalKeyboardLayout.US, WootingOne_US },
|
||||
{ WootingPhysicalKeyboardLayout.UK, WootingOne_UK }
|
||||
{ WootingPhysicalKeyboardLayout.US, TKL_US },
|
||||
{ WootingPhysicalKeyboardLayout.UK, TKL_UK }
|
||||
}
|
||||
},
|
||||
|
||||
{ WootingDevicesIndexes.WootingTwo, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
|
||||
{ WootingDeviceType.Keyboard, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
|
||||
{
|
||||
{ WootingPhysicalKeyboardLayout.US, WootingTwo_US },
|
||||
{ WootingPhysicalKeyboardLayout.UK, WootingTwo_UK }
|
||||
{ WootingPhysicalKeyboardLayout.US, Fullsize_US },
|
||||
{ WootingPhysicalKeyboardLayout.UK, Fullsize_UK }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,14 +38,14 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
private void InitializeLayout()
|
||||
{
|
||||
//TODO DarthAffe 13.02.2021: Check how the mapping can work without knowing the physical layout
|
||||
Dictionary<LedId, (int row, int column)> mapping = WootingKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][WootingPhysicalKeyboardLayout.US];
|
||||
Dictionary<LedId, (int row, int column)> mapping = WootingKeyboardLedMappings.Mapping[DeviceInfo.WootingDeviceType][WootingPhysicalKeyboardLayout.US];
|
||||
|
||||
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) => WootingKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][WootingPhysicalKeyboardLayout.US][ledId];
|
||||
protected override object GetLedCustomData(LedId ledId) => WootingKeyboardLedMappings.Mapping[DeviceInfo.WootingDeviceType][WootingPhysicalKeyboardLayout.US][ledId];
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(GetUpdateData(ledsToUpdate));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Wooting.Enum;
|
||||
using RGB.NET.Devices.Wooting.Generic;
|
||||
using RGB.NET.Devices.Wooting.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
{
|
||||
@@ -22,9 +23,9 @@ namespace RGB.NET.Devices.Wooting.Keyboard
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param>
|
||||
internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex)
|
||||
: base(RGBDeviceType.Keyboard, deviceIndex)
|
||||
/// <param name="deviceInfo">The native <see cref="T:RGB.NET.Devices.Wooting.Native._WootingDeviceInfo" />.</param>
|
||||
internal WootingKeyboardRGBDeviceInfo(_WootingDeviceInfo deviceInfo)
|
||||
: base(RGBDeviceType.Keyboard, deviceInfo)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user