1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00
This commit is contained in:
Darth Affe 2021-11-13 17:57:09 +01:00
commit f69560224d
12 changed files with 1510 additions and 1554 deletions

View File

@ -82,7 +82,7 @@ public class LogitechDeviceProvider : AbstractRGBDeviceProvider
{
{ 0xC336, RGBDeviceType.Keyboard, "G213", LedMappings.ZoneKeyboard, (LogitechDeviceType.Keyboard, 5) },
{ 0xC092, RGBDeviceType.Mouse, "G203 LIGHTSYNC", LedMappings.ZoneMouse, (LogitechDeviceType.Mouse, 1) },
{ 0xC092, RGBDeviceType.Mouse, "G203 Lightsync", LedMappings.ZoneMouse, (LogitechDeviceType.Mouse, 1) },
{ 0xC080, RGBDeviceType.Mouse, "G303", LedMappings.ZoneMouse, (LogitechDeviceType.Mouse, 2) },
{ 0xC081, RGBDeviceType.Mouse, "G900", LedMappings.ZoneMouse, (LogitechDeviceType.Mouse, 2) },
{ 0xC082, RGBDeviceType.Mouse, "G403", LedMappings.ZoneMouse, (LogitechDeviceType.Mouse, 2) },

View File

@ -1,8 +1,8 @@
using RGB.NET.Core;
using RGB.NET.Devices.Razer.Native;
namespace RGB.NET.Devices.Razer;
namespace RGB.NET.Devices.Razer
{
/// <summary>
/// Contains mappings for <see cref="LedId"/> to the matrix location.
/// </summary>
@ -281,6 +281,155 @@ public static class LedMappings
//Row 7 is also empty
};
public static readonly LedMapping<int> KeyboardBlackWidowV3 = new()
{
//Row 0 is empty
#region Row 1
[LedId.Keyboard_Escape] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 2,
[LedId.Keyboard_F1] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 4,
[LedId.Keyboard_F2] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 5,
[LedId.Keyboard_F3] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 6,
[LedId.Keyboard_F4] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 7,
[LedId.Keyboard_F5] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 8,
[LedId.Keyboard_F6] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 9,
[LedId.Keyboard_F7] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 10,
[LedId.Keyboard_F8] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 11,
[LedId.Keyboard_F9] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 12,
[LedId.Keyboard_F10] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 13,
[LedId.Keyboard_F11] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 14,
[LedId.Keyboard_F12] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 15,
[LedId.Keyboard_PrintScreen] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 16,
[LedId.Keyboard_ScrollLock] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 17,
[LedId.Keyboard_PauseBreak] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 18,
[LedId.Logo] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 21,
#endregion
#region Row 2
[LedId.Keyboard_Programmable1] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 1,
[LedId.Keyboard_GraveAccentAndTilde] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 2,
[LedId.Keyboard_1] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 3,
[LedId.Keyboard_2] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 4,
[LedId.Keyboard_3] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 5,
[LedId.Keyboard_4] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 6,
[LedId.Keyboard_5] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 7,
[LedId.Keyboard_6] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 8,
[LedId.Keyboard_7] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 9,
[LedId.Keyboard_8] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 10,
[LedId.Keyboard_9] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 11,
[LedId.Keyboard_0] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 12,
[LedId.Keyboard_MinusAndUnderscore] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 13,
[LedId.Keyboard_EqualsAndPlus] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 14,
[LedId.Keyboard_Backspace] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 15,
[LedId.Keyboard_Insert] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 16,
[LedId.Keyboard_Home] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 17,
[LedId.Keyboard_PageUp] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 18,
[LedId.Keyboard_NumLock] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 19,
[LedId.Keyboard_NumSlash] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 20,
[LedId.Keyboard_NumAsterisk] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 21,
[LedId.Keyboard_NumMinus] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 22,
#endregion
#region Row 3
[LedId.Keyboard_Programmable2] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 1,
[LedId.Keyboard_Tab] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 2,
[LedId.Keyboard_Q] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 3,
[LedId.Keyboard_W] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 4,
[LedId.Keyboard_E] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 5,
[LedId.Keyboard_R] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 6,
[LedId.Keyboard_T] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 7,
[LedId.Keyboard_Y] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 8,
[LedId.Keyboard_U] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 9,
[LedId.Keyboard_I] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 10,
[LedId.Keyboard_O] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 11,
[LedId.Keyboard_P] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 12,
[LedId.Keyboard_BracketLeft] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 13,
[LedId.Keyboard_BracketRight] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 14,
[LedId.Keyboard_Backslash] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 15,
[LedId.Keyboard_Delete] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 16,
[LedId.Keyboard_End] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 17,
[LedId.Keyboard_PageDown] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 18,
[LedId.Keyboard_Num7] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 19,
[LedId.Keyboard_Num8] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 20,
[LedId.Keyboard_Num9] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 21,
[LedId.Keyboard_NumPlus] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 22,
#endregion
#region Row 4
[LedId.Keyboard_Programmable3] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 1,
[LedId.Keyboard_CapsLock] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 2,
[LedId.Keyboard_A] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 3,
[LedId.Keyboard_S] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 4,
[LedId.Keyboard_D] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 5,
[LedId.Keyboard_F] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 6,
[LedId.Keyboard_G] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 7,
[LedId.Keyboard_H] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 8,
[LedId.Keyboard_J] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 9,
[LedId.Keyboard_K] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 10,
[LedId.Keyboard_L] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 11,
[LedId.Keyboard_SemicolonAndColon] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 12,
[LedId.Keyboard_ApostropheAndDoubleQuote] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 13,
[LedId.Keyboard_NonUsTilde] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 14,
[LedId.Keyboard_Enter] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 15,
[LedId.Keyboard_Num4] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 19,
[LedId.Keyboard_Num5] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 20,
[LedId.Keyboard_Num6] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 21,
#endregion
#region Row 5
[LedId.Keyboard_Programmable4] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 1,
[LedId.Keyboard_LeftShift] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 2,
[LedId.Keyboard_NonUsBackslash] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 3,
[LedId.Keyboard_Z] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 4,
[LedId.Keyboard_X] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 5,
[LedId.Keyboard_C] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 6,
[LedId.Keyboard_V] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 7,
[LedId.Keyboard_B] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 8,
[LedId.Keyboard_N] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 9,
[LedId.Keyboard_M] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 10,
[LedId.Keyboard_CommaAndLessThan] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 11,
[LedId.Keyboard_PeriodAndBiggerThan] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 12,
[LedId.Keyboard_SlashAndQuestionMark] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 13,
[LedId.Keyboard_RightShift] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 15,
[LedId.Keyboard_ArrowUp] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 17,
[LedId.Keyboard_Num1] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 19,
[LedId.Keyboard_Num2] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 20,
[LedId.Keyboard_Num3] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 21,
[LedId.Keyboard_NumEnter] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 22,
#endregion
#region Row 6
[LedId.Keyboard_Programmable5] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 1,
[LedId.Keyboard_LeftCtrl] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 2,
[LedId.Keyboard_LeftGui] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 3,
[LedId.Keyboard_LeftAlt] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 4,
[LedId.Keyboard_Space] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 7,
[LedId.Keyboard_RightAlt] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 11,
[LedId.Keyboard_RightGui] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 13,
[LedId.Keyboard_Application] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 14,
[LedId.Keyboard_RightCtrl] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 15,
[LedId.Keyboard_ArrowLeft] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 16,
[LedId.Keyboard_ArrowDown] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 17,
[LedId.Keyboard_ArrowRight] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 18,
[LedId.Keyboard_Num0] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 20,
[LedId.Keyboard_NumPeriodAndDelete] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 21,
#endregion
//Row 7 is also empty
};
/// <summary>
/// Gets the mapping for mice.
/// </summary>
@ -348,3 +497,4 @@ public static class LedMappings
/// </summary>
public static LedMapping<int> ChromaLink { get; } = new();
}
}

View File

@ -9,8 +9,8 @@ using RGB.NET.Core;
using RGB.NET.Devices.Razer.Native;
using RGB.NET.HID;
namespace RGB.NET.Devices.Razer;
namespace RGB.NET.Devices.Razer
{
/// <inheritdoc />
/// <summary>
/// Represents a device provider responsible for razer devices.
@ -96,6 +96,7 @@ public class RazerDeviceProvider : AbstractRGBDeviceProvider
{ 0x024A, RGBDeviceType.Keyboard, "Blade Stealth (Late 2019)", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
{ 0x024C, RGBDeviceType.Keyboard, "Blade Pro (Late 2019)", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
{ 0x024D, RGBDeviceType.Keyboard, "Blade 15 Studio Edition (2019)", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
{ 0x024E, RGBDeviceType.Keyboard, "BlackWidow V3", LedMappings.KeyboardBlackWidowV3, RazerEndpointType.Keyboard },
{ 0x0252, RGBDeviceType.Keyboard, "Blade Stealth (Early 2020)", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
{ 0x0253, RGBDeviceType.Keyboard, "Blade 15 Advanced (2020)", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
{ 0x0255, RGBDeviceType.Keyboard, "Blade 15 (Early 2020) Base", LedMappings.LaptopKeyboard, RazerEndpointType.LaptopKeyboard },
@ -104,6 +105,7 @@ public class RazerDeviceProvider : AbstractRGBDeviceProvider
{ 0x25C, RGBDeviceType.Keyboard, "BlackWidow V3 Pro", LedMappings.Keyboard, RazerEndpointType.Keyboard }, // The dongle, may not be present when connected with cable
{ 0x025D, RGBDeviceType.Keyboard, "Ornata Chroma V2", LedMappings.Keyboard, RazerEndpointType.Keyboard },
{ 0x025E, RGBDeviceType.Keyboard, "Cynosa V2", LedMappings.Keyboard, RazerEndpointType.Keyboard },
{ 0x0266, RGBDeviceType.Keyboard, "Huntsman V2", LedMappings.Keyboard, RazerEndpointType.Keyboard },
// Mice
{ 0x0013, RGBDeviceType.Mouse, "Orochi 2011", LedMappings.Mouse, RazerEndpointType.Mouse },
@ -156,11 +158,13 @@ public class RazerDeviceProvider : AbstractRGBDeviceProvider
{ 0x007C, RGBDeviceType.Mouse, "DeathAdder V2 Pro (Wired)", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x007D, RGBDeviceType.Mouse, "DeathAdder V2 Pro (Wireless)", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0083, RGBDeviceType.Mouse, "Basilisk X HyperSpeed", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0085, RGBDeviceType.Mouse, "Basilisk V2", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0088, RGBDeviceType.Mouse, "Basilisk Ultimate", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0084, RGBDeviceType.Mouse, "DeathAdder V2", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x008A, RGBDeviceType.Mouse, "Viper Mini", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x008D, RGBDeviceType.Mouse, "Naga Left Handed Edition", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0091, RGBDeviceType.Mouse, "Viper 8khz", LedMappings.Mouse, RazerEndpointType.Mouse },
{ 0x0096, RGBDeviceType.Mouse, "Naga X", RGB.NET.Devices.Razer.LedMappings.Mouse, RazerEndpointType.Mouse },
// Mousepads
{ 0x0068, RGBDeviceType.Mousepad, "Firefly Hyperflux", LedMappings.Mousepad, RazerEndpointType.Mousepad },
@ -196,7 +200,8 @@ public class RazerDeviceProvider : AbstractRGBDeviceProvider
{ 0x0F09, RGBDeviceType.Unknown, "Chroma Hardware Development Kit (HDK)", LedMappings.ChromaLink, RazerEndpointType.ChromaLink },
{ 0x0F13, RGBDeviceType.Unknown, "Lian Li O11", LedMappings.ChromaLink, RazerEndpointType.ChromaLink },
{ 0x0F1D, RGBDeviceType.Unknown, "Mouse Bungee V3 Chroma", LedMappings.ChromaLink, RazerEndpointType.ChromaLink },
{ 0x0F20, RGBDeviceType.Unknown, "Base Station V2 Chroma", LedMappings.ChromaLink, RazerEndpointType.ChromaLink }
{ 0x0F20, RGBDeviceType.Unknown, "Base Station V2 Chroma", LedMappings.ChromaLink, RazerEndpointType.ChromaLink },
{ 0x0F1F, RGBDeviceType.Unknown, "Addressable RGB Controller", LedMappings.ChromaLink, RazerEndpointType.ChromaLink }
};
#endregion
@ -297,3 +302,4 @@ public class RazerDeviceProvider : AbstractRGBDeviceProvider
#endregion
}
}

View File

@ -1,7 +1,7 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.SteelSeries;
namespace RGB.NET.Devices.SteelSeries
{
/// <summary>
/// Contains mappings for <see cref="LedId"/> to <see cref="SteelSeriesLedId"/>.
/// </summary>
@ -286,6 +286,15 @@ public static class LedMappings
{ LedId.Mousepad12, SteelSeriesLedId.ZoneTwelve },
};
/// <summary>
/// Gets the mapping for two-zone mousepads
/// </summary>
public static LedMapping<SteelSeriesLedId> MousepadTwoZone { get; } = new()
{
{ LedId.Mousepad1, SteelSeriesLedId.ZoneOne },
{ LedId.Mousepad2, SteelSeriesLedId.ZoneTwo }
};
/// <summary>
/// Gets the mapping for 103-zone led strip devices (monitor).
/// </summary>
@ -396,3 +405,4 @@ public static class LedMappings
{ LedId.LedStripe103, SteelSeriesLedId.ZoneOneHundredThree }
};
}
}

View File

@ -37,14 +37,17 @@ public class SteelSeriesDeviceProvider : AbstractRGBDeviceProvider
{ 0x0472, RGBDeviceType.Mouse, "Rival 150", LedMappings.MouseOneZone, SteelSeriesDeviceType.OneZone },
{ 0x1710, RGBDeviceType.Mouse, "Rival 300", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x1720, RGBDeviceType.Mouse, "Rival 310", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x1722, RGBDeviceType.Mouse, "Sensei 310", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x170E, RGBDeviceType.Mouse, "Rival 500", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x1724, RGBDeviceType.Mouse, "Rival 600", LedMappings.MouseEightZone, SteelSeriesDeviceType.EightZone },
{ 0x1726, RGBDeviceType.Mouse, "Rival 650", LedMappings.MouseEightZone, SteelSeriesDeviceType.EightZone },
{ 0x172B, RGBDeviceType.Mouse, "Rival 650", LedMappings.MouseEightZone, SteelSeriesDeviceType.EightZone },
{ 0x1700, RGBDeviceType.Mouse, "Rival 700", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x1824, RGBDeviceType.Mouse, "Rival 3 (Old Firmware)", LedMappings.MouseThreeZone, SteelSeriesDeviceType.ThreeZone },
{ 0x184C, RGBDeviceType.Mouse, "Rival 3", LedMappings.MouseThreeZone, SteelSeriesDeviceType.ThreeZone },
{ 0x1830, RGBDeviceType.Mouse, "Rival 3 Wireless", LedMappings.MouseThreeZone, SteelSeriesDeviceType.ThreeZone },
{ 0x1832, RGBDeviceType.Mouse, "Sensei Ten", LedMappings.MouseTwoZone, SteelSeriesDeviceType.TwoZone },
{ 0x1838, RGBDeviceType.Mouse, "Aerox 3 Wireless", LedMappings.MouseThreeZone, SteelSeriesDeviceType.ThreeZone },
//Keyboards
{ 0x161C, RGBDeviceType.Keyboard, "Apex 5", LedMappings.KeyboardMappingUk, SteelSeriesDeviceType.PerKey },
@ -64,6 +67,7 @@ public class SteelSeriesDeviceProvider : AbstractRGBDeviceProvider
//Mousepads
{ 0x1507, RGBDeviceType.Mousepad, "QCK Prism", LedMappings.MousepadTwelveZone, SteelSeriesDeviceType.TwelveZone },
{ 0x150D, RGBDeviceType.Mousepad, "QCK Prism Cloth", LedMappings.MousepadTwoZone, SteelSeriesDeviceType.TwoZone },
//Monitors
{ 0x1126, RGBDeviceType.Monitor, "MGP27C", LedMappings.MonitorOnehundredandthreeZone, SteelSeriesDeviceType.OneHundredAndThreeZone },

View File

@ -0,0 +1,19 @@
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Global
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Wooting.Enum
{
/// <summary>
/// Contains list of available physical layouts for Wooting keyboards.
/// </summary>
/// <remarks>
/// Shop states ANSI (US) and ISO (UK/German/Nodics) - https://wooting.store/collections/wooting-keyboards/products/wooting-two
/// </remarks>
public enum WootingLayoutType
{
ANSI = 0,
ISO = 1
}
}

View File

@ -1,18 +0,0 @@
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Global
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Wooting.Enum;
/// <summary>
/// Contains list of available physical layouts for Wooting keyboards.
/// </summary>
/// <remarks>
/// Shop states ANSI (US) and ISO (UK/German/Nodics) - https://wooting.store/collections/wooting-keyboards/products/wooting-two
/// </remarks>
public enum WootingPhysicalKeyboardLayout
{
US = 0,
UK = 1
}

View File

@ -1,9 +1,10 @@
using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Enum;
using RGB.NET.Devices.Wooting.Helper;
using RGB.NET.Devices.Wooting.Native;
namespace RGB.NET.Devices.Wooting.Generic;
namespace RGB.NET.Devices.Wooting.Generic
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a Wooting-<see cref="T:RGB.NET.Core.IRGBDevice" />.
@ -32,6 +33,8 @@ public class WootingRGBDeviceInfo : IRGBDeviceInfo
/// </summary>
public WootingDeviceType WootingDeviceType { get; }
public WootingLayoutType WootingLayoutType { get; }
#endregion
#region Constructors
@ -45,6 +48,7 @@ public class WootingRGBDeviceInfo : IRGBDeviceInfo
{
this.DeviceType = deviceType;
this.WootingDeviceType = deviceInfo.DeviceType;
this.WootingLayoutType = deviceInfo.LayoutType;
Model = deviceInfo.Model;
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
@ -52,3 +56,4 @@ public class WootingRGBDeviceInfo : IRGBDeviceInfo
#endregion
}
}

View File

@ -1,11 +1,11 @@
// ReSharper disable InconsistentNaming
using System.Collections.Generic;
using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Enum;
using System.Collections.Generic;
namespace RGB.NET.Devices.Wooting.Keyboard;
namespace RGB.NET.Devices.Wooting.Keyboard
{
/// <summary>
/// Contains all the hardware-id mappings for Wooting devices.
/// </summary>
@ -13,105 +13,7 @@ internal static class WootingKeyboardLedMappings
{
#region Properties & Fields
#region TKL
private static readonly Dictionary<LedId, (int row, int column)> TKL_US = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
{ LedId.Keyboard_F3, (0,4) },
{ LedId.Keyboard_F4, (0,5) },
{ LedId.Keyboard_F5, (0,6) },
{ LedId.Keyboard_F6, (0,7) },
{ LedId.Keyboard_F7, (0,8) },
{ LedId.Keyboard_F8, (0,9) },
{ LedId.Keyboard_F9, (0,10) },
{ LedId.Keyboard_F10, (0,11) },
{ LedId.Keyboard_F11, (0,12) },
{ LedId.Keyboard_F12, (0,13) },
{ LedId.Keyboard_PrintScreen, (0,14) },
{ LedId.Keyboard_PauseBreak, (0,15) },
{ LedId.Keyboard_Custom1, (0,16) },
{ LedId.Keyboard_GraveAccentAndTilde, (1,0) },
{ LedId.Keyboard_1, (1,1) },
{ LedId.Keyboard_2, (1,2) },
{ LedId.Keyboard_3, (1,3) },
{ LedId.Keyboard_4, (1,4) },
{ LedId.Keyboard_5, (1,5) },
{ LedId.Keyboard_6, (1,6) },
{ LedId.Keyboard_7, (1,7) },
{ LedId.Keyboard_8, (1,8) },
{ LedId.Keyboard_9, (1,9) },
{ LedId.Keyboard_0, (1,10) },
{ LedId.Keyboard_MinusAndUnderscore, (1,11) },
{ LedId.Keyboard_EqualsAndPlus, (1,12) },
{ LedId.Keyboard_Backspace, (1,13) },
{ LedId.Keyboard_Insert, (1,14) },
{ LedId.Keyboard_Home, (1,15) },
{ LedId.Keyboard_PageUp, (1,16) },
{ LedId.Keyboard_Tab, (2,0) },
{ LedId.Keyboard_Q, (2,1) },
{ LedId.Keyboard_W, (2,2) },
{ LedId.Keyboard_E, (2,3) },
{ LedId.Keyboard_R, (2,4) },
{ LedId.Keyboard_T, (2,5) },
{ LedId.Keyboard_Y, (2,6) },
{ LedId.Keyboard_U, (2,7) },
{ LedId.Keyboard_I, (2,8) },
{ LedId.Keyboard_O, (2,9) },
{ LedId.Keyboard_P, (2,10) },
{ LedId.Keyboard_BracketLeft, (2,11) },
{ LedId.Keyboard_BracketRight, (2,12) },
{ LedId.Keyboard_Backslash, (2,13) },
{ LedId.Keyboard_Delete, (2,14) },
{ LedId.Keyboard_End, (2,15) },
{ LedId.Keyboard_PageDown, (2,16) },
{ LedId.Keyboard_CapsLock, (3,0) },
{ LedId.Keyboard_A, (3,1) },
{ LedId.Keyboard_S, (3,2) },
{ LedId.Keyboard_D, (3,3) },
{ LedId.Keyboard_F, (3,4) },
{ LedId.Keyboard_G, (3,5) },
{ LedId.Keyboard_H, (3,6) },
{ LedId.Keyboard_J, (3,7) },
{ LedId.Keyboard_K, (3,8) },
{ LedId.Keyboard_L, (3,9) },
{ LedId.Keyboard_SemicolonAndColon, (3,10) },
{ LedId.Keyboard_ApostropheAndDoubleQuote, (3,11) },
{ LedId.Keyboard_Enter, (3,13) },
{ LedId.Keyboard_LeftShift, (4,0) },
{ LedId.Keyboard_Z, (4,2) },
{ LedId.Keyboard_X, (4,3) },
{ LedId.Keyboard_C, (4,4) },
{ LedId.Keyboard_V, (4,5) },
{ LedId.Keyboard_B, (4,6) },
{ LedId.Keyboard_N, (4,7) },
{ LedId.Keyboard_M, (4,8) },
{ LedId.Keyboard_CommaAndLessThan, (4,9) },
{ LedId.Keyboard_PeriodAndBiggerThan, (4,10) },
{ LedId.Keyboard_SlashAndQuestionMark, (4,11) },
{ LedId.Keyboard_RightShift, (4,13) },
{ LedId.Keyboard_ArrowUp, (4,15) },
{ LedId.Keyboard_LeftCtrl, (5,0) },
{ LedId.Keyboard_LeftGui, (5,1) },
{ LedId.Keyboard_LeftAlt, (5,2) },
{ LedId.Keyboard_Space, (5,6) },
{ LedId.Keyboard_RightAlt, (5,10) },
{ LedId.Keyboard_RightGui, (5,11) },
{ LedId.Keyboard_Application, (5,12) },
{ LedId.Keyboard_RightCtrl, (5,13) },
{ LedId.Keyboard_ArrowLeft, (5,14) },
{ LedId.Keyboard_ArrowDown, (5,15) },
{ LedId.Keyboard_ArrowRight, (5,16) }
};
private static readonly Dictionary<LedId, (int row, int column)> TKL_UK = new()
private static readonly Dictionary<LedId, (int row, int column)> TKL = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
@ -209,128 +111,7 @@ internal static class WootingKeyboardLedMappings
{ LedId.Keyboard_ArrowRight, (5,16) }
};
#endregion
#region Fullsize
private static readonly Dictionary<LedId, (int row, int column)> Fullsize_US = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
{ LedId.Keyboard_F3, (0,4) },
{ LedId.Keyboard_F4, (0,5) },
{ LedId.Keyboard_F5, (0,6) },
{ LedId.Keyboard_F6, (0,7) },
{ LedId.Keyboard_F7, (0,8) },
{ LedId.Keyboard_F8, (0,9) },
{ LedId.Keyboard_F9, (0,10) },
{ LedId.Keyboard_F10, (0,11) },
{ LedId.Keyboard_F11, (0,12) },
{ LedId.Keyboard_F12, (0,13) },
{ LedId.Keyboard_PrintScreen, (0,14) },
{ LedId.Keyboard_PauseBreak, (0,15) },
{ LedId.Keyboard_ScrollLock, (0,16) },
{ LedId.Keyboard_Custom1, (0,17) },
{ LedId.Keyboard_Custom2, (0,18) },
{ LedId.Keyboard_Custom3, (0,19) },
{ LedId.Keyboard_Custom4, (0,20) },
{ LedId.Keyboard_GraveAccentAndTilde, (1,0) },
{ LedId.Keyboard_1, (1,1) },
{ LedId.Keyboard_2, (1,2) },
{ LedId.Keyboard_3, (1,3) },
{ LedId.Keyboard_4, (1,4) },
{ LedId.Keyboard_5, (1,5) },
{ LedId.Keyboard_6, (1,6) },
{ LedId.Keyboard_7, (1,7) },
{ LedId.Keyboard_8, (1,8) },
{ LedId.Keyboard_9, (1,9) },
{ LedId.Keyboard_0, (1,10) },
{ LedId.Keyboard_MinusAndUnderscore, (1,11) },
{ LedId.Keyboard_EqualsAndPlus, (1,12) },
{ LedId.Keyboard_Backspace, (1,13) },
{ LedId.Keyboard_Insert, (1,14) },
{ LedId.Keyboard_Home, (1,15) },
{ LedId.Keyboard_PageUp, (1,16) },
{ LedId.Keyboard_NumLock, (1,17) },
{ LedId.Keyboard_NumSlash, (1,18) },
{ LedId.Keyboard_NumAsterisk, (1,19) },
{ LedId.Keyboard_NumMinus, (1,20) },
{ LedId.Keyboard_Tab, (2,0) },
{ LedId.Keyboard_Q, (2,1) },
{ LedId.Keyboard_W, (2,2) },
{ LedId.Keyboard_E, (2,3) },
{ LedId.Keyboard_R, (2,4) },
{ LedId.Keyboard_T, (2,5) },
{ LedId.Keyboard_Y, (2,6) },
{ LedId.Keyboard_U, (2,7) },
{ LedId.Keyboard_I, (2,8) },
{ LedId.Keyboard_O, (2,9) },
{ LedId.Keyboard_P, (2,10) },
{ LedId.Keyboard_BracketLeft, (2,11) },
{ LedId.Keyboard_BracketRight, (2,12) },
{ LedId.Keyboard_Backslash, (2,13) },
{ LedId.Keyboard_Delete, (2,14) },
{ LedId.Keyboard_End, (2,15) },
{ LedId.Keyboard_PageDown, (2,16) },
{ LedId.Keyboard_Num7, (2,17) },
{ LedId.Keyboard_Num8, (2,18) },
{ LedId.Keyboard_Num9, (2,19) },
{ LedId.Keyboard_NumPlus, (2,20) },
{ LedId.Keyboard_CapsLock, (3,0) },
{ LedId.Keyboard_A, (3,1) },
{ LedId.Keyboard_S, (3,2) },
{ LedId.Keyboard_D, (3,3) },
{ LedId.Keyboard_F, (3,4) },
{ LedId.Keyboard_G, (3,5) },
{ LedId.Keyboard_H, (3,6) },
{ LedId.Keyboard_J, (3,7) },
{ LedId.Keyboard_K, (3,8) },
{ LedId.Keyboard_L, (3,9) },
{ LedId.Keyboard_SemicolonAndColon, (3,10) },
{ LedId.Keyboard_ApostropheAndDoubleQuote, (3,11) },
{ LedId.Keyboard_Enter, (3,13) },
{ LedId.Keyboard_Num4, (3,17) },
{ LedId.Keyboard_Num5, (3,18) },
{ LedId.Keyboard_Num6, (3,19) },
{ LedId.Keyboard_LeftShift, (4,0) },
{ LedId.Keyboard_Z, (4,2) },
{ LedId.Keyboard_X, (4,3) },
{ LedId.Keyboard_C, (4,4) },
{ LedId.Keyboard_V, (4,5) },
{ LedId.Keyboard_B, (4,6) },
{ LedId.Keyboard_N, (4,7) },
{ LedId.Keyboard_M, (4,8) },
{ LedId.Keyboard_CommaAndLessThan, (4,9) },
{ LedId.Keyboard_PeriodAndBiggerThan, (4,10) },
{ LedId.Keyboard_SlashAndQuestionMark, (4,11) },
{ LedId.Keyboard_RightShift, (4,13) },
{ LedId.Keyboard_ArrowUp, (4,15) },
{ LedId.Keyboard_Num1, (4,17) },
{ LedId.Keyboard_Num2, (4,18) },
{ LedId.Keyboard_Num3, (4,19) },
{ LedId.Keyboard_NumEnter, (4,20) },
{ LedId.Keyboard_LeftCtrl, (5,0) },
{ LedId.Keyboard_LeftGui, (5,1) },
{ LedId.Keyboard_LeftAlt, (5,2) },
{ LedId.Keyboard_Space, (5,6) },
{ LedId.Keyboard_RightAlt, (5,10) },
{ LedId.Keyboard_RightGui, (5,11) },
{ LedId.Keyboard_Application, (5,12) },
{ LedId.Keyboard_RightCtrl, (5,13) },
{ LedId.Keyboard_ArrowLeft, (5,14) },
{ LedId.Keyboard_ArrowDown, (5,15) },
{ LedId.Keyboard_ArrowRight, (5,16) },
{ LedId.Keyboard_Num0, (5,18) },
{ LedId.Keyboard_NumPeriodAndDelete, (5,19) }
};
private static readonly Dictionary<LedId, (int row, int column)> Fullsize_UK = new()
private static readonly Dictionary<LedId, (int row, int column)> Fullsize = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
@ -449,28 +230,15 @@ internal static class WootingKeyboardLedMappings
{ LedId.Keyboard_NumPeriodAndDelete, (5,19) }
};
#endregion
/// <summary>
/// Contains all the hardware-id mappings for Wooting devices.
/// </summary>
public static readonly Dictionary<WootingDeviceType, Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>> Mapping =
new()
public static readonly Dictionary<WootingDeviceType, Dictionary<LedId, (int row, int column)>> Mapping = new()
{
{ WootingDeviceType.KeyboardTKL, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
{
{ WootingPhysicalKeyboardLayout.US, TKL_US },
{ WootingPhysicalKeyboardLayout.UK, TKL_UK }
}
},
{ WootingDeviceType.Keyboard, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
{
{ WootingPhysicalKeyboardLayout.US, Fullsize_US },
{ WootingPhysicalKeyboardLayout.UK, Fullsize_UK }
}
}
[WootingDeviceType.Keyboard] = Fullsize,
[WootingDeviceType.KeyboardTKL] = TKL
};
#endregion
}
}

View File

@ -3,8 +3,8 @@ using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Enum;
using RGB.NET.Devices.Wooting.Generic;
namespace RGB.NET.Devices.Wooting.Keyboard;
namespace RGB.NET.Devices.Wooting.Keyboard
{
/// <inheritdoc cref="WootingRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a Wooting keyboard.
@ -37,18 +37,18 @@ public class WootingKeyboardRGBDevice : WootingRGBDevice<WootingKeyboardRGBDevic
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.WootingDeviceType][WootingPhysicalKeyboardLayout.US];
Dictionary<LedId, (int row, int column)> mapping = WootingKeyboardLedMappings.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) => WootingKeyboardLedMappings.Mapping[DeviceInfo.WootingDeviceType][WootingPhysicalKeyboardLayout.US][ledId];
protected override object GetLedCustomData(LedId ledId) => WootingKeyboardLedMappings.Mapping[DeviceInfo.WootingDeviceType][ledId];
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(GetUpdateData(ledsToUpdate));
#endregion
}
}

View File

@ -1,9 +1,10 @@
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;
namespace RGB.NET.Devices.Wooting.Keyboard
{
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Wooting.Keyboard.WootingKeyboardRGBDevice" />.
/// </summary>
@ -12,7 +13,7 @@ public class WootingKeyboardRGBDeviceInfo : WootingRGBDeviceInfo, IKeyboardDevic
#region Properties & Fields
/// <inheritdoc />
public KeyboardLayoutType Layout => KeyboardLayoutType.Unknown;
public KeyboardLayoutType Layout { get; }
#endregion
@ -25,7 +26,15 @@ public class WootingKeyboardRGBDeviceInfo : WootingRGBDeviceInfo, IKeyboardDevic
/// <param name="deviceInfo">The native <see cref="T:RGB.NET.Devices.Wooting.Native._WootingDeviceInfo" />.</param>
internal WootingKeyboardRGBDeviceInfo(_WootingDeviceInfo deviceInfo)
: base(RGBDeviceType.Keyboard, deviceInfo)
{ }
{
Layout = WootingLayoutType switch
{
WootingLayoutType.ANSI => KeyboardLayoutType.ANSI,
WootingLayoutType.ISO => KeyboardLayoutType.ISO,
_ => KeyboardLayoutType.Unknown
};
}
#endregion
}
}

View File

@ -4,8 +4,8 @@
using System.Runtime.InteropServices;
using RGB.NET.Devices.Wooting.Enum;
namespace RGB.NET.Devices.Wooting.Native;
namespace RGB.NET.Devices.Wooting.Native
{
[StructLayout(LayoutKind.Sequential)]
internal struct _WootingDeviceInfo
{
@ -22,4 +22,7 @@ internal struct _WootingDeviceInfo
internal WootingDeviceType DeviceType { get; private set; }
internal bool V2Interface { get; set; }
internal WootingLayoutType LayoutType { get; private set; }
}
}