mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Merge pull request #187 from DarthAffe/SDK/Razer
Razer improvements & missing PIDs
This commit is contained in:
commit
82ca48d933
43
RGB.NET.Devices.Razer/Enum/RazerEndpointType.cs
Normal file
43
RGB.NET.Devices.Razer/Enum/RazerEndpointType.cs
Normal file
@ -0,0 +1,43 @@
|
||||
namespace RGB.NET.Devices.Razer
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a type of Razer SDK endpoint
|
||||
/// </summary>
|
||||
public enum RazerEndpointType
|
||||
{
|
||||
/// <summary>
|
||||
/// The keyboard endpoint
|
||||
/// </summary>
|
||||
Keyboard,
|
||||
|
||||
/// <summary>
|
||||
/// The laptop keyboard endpoint, shares the <see cref="Keyboard"/> endpoint but has a different LED layout
|
||||
/// </summary>
|
||||
LaptopKeyboard,
|
||||
|
||||
/// <summary>
|
||||
/// The mouse endpoint
|
||||
/// </summary>
|
||||
Mouse,
|
||||
|
||||
/// <summary>
|
||||
/// The headset endpoint
|
||||
/// </summary>
|
||||
Headset,
|
||||
|
||||
/// <summary>
|
||||
/// The mousepad endpoint
|
||||
/// </summary>
|
||||
Mousepad,
|
||||
|
||||
/// <summary>
|
||||
/// The keypad endpoint
|
||||
/// </summary>
|
||||
Keypad,
|
||||
|
||||
/// <summary>
|
||||
/// The Chroma Link endpoint
|
||||
/// </summary>
|
||||
ChromaLink,
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Razer
|
||||
{
|
||||
@ -26,6 +25,11 @@ namespace RGB.NET.Devices.Razer
|
||||
/// <inheritdoc />
|
||||
public object? LayoutMetadata { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Razer SDK endpoint type the <see cref="IRGBDevice"/> is addressed through.
|
||||
/// </summary>
|
||||
public RazerEndpointType EndpointType { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@ -34,10 +38,12 @@ namespace RGB.NET.Devices.Razer
|
||||
/// Internal constructor of managed <see cref="RazerRGBDeviceInfo"/>.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="endpointType">The Razer SDK endpoint type the <see cref="IRGBDevice"/> is addressed through.</param>
|
||||
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
|
||||
internal RazerRGBDeviceInfo(RGBDeviceType deviceType, string model)
|
||||
internal RazerRGBDeviceInfo(RGBDeviceType deviceType, RazerEndpointType endpointType, string model)
|
||||
{
|
||||
this.DeviceType = deviceType;
|
||||
this.EndpointType = endpointType;
|
||||
this.Model = model;
|
||||
|
||||
DeviceName = $"{Manufacturer} {Model}";
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
using System.Linq;
|
||||
using HidSharp;
|
||||
using RGB.NET.Core;
|
||||
using DeviceDataList = System.Collections.Generic.List<(string model, RGB.NET.Core.RGBDeviceType deviceType, int id)>;
|
||||
using DeviceDataList =
|
||||
System.Collections.Generic.List<(string model, RGB.NET.Core.RGBDeviceType deviceType, RGB.NET.Devices.Razer.RazerEndpointType
|
||||
razerDeviceType, int id)>;
|
||||
|
||||
namespace RGB.NET.Devices.Razer.HID
|
||||
{
|
||||
@ -16,147 +18,149 @@ namespace RGB.NET.Devices.Razer.HID
|
||||
= new()
|
||||
{
|
||||
// Keyboards
|
||||
("BlackWidow Ultimate 2012", RGBDeviceType.Keyboard, 0x010D),
|
||||
("BlackWidow Classic (Alternate)", RGBDeviceType.Keyboard, 0x010E),
|
||||
("Anansi", RGBDeviceType.Keyboard, 0x010F),
|
||||
("BlackWidow Ultimate 2013", RGBDeviceType.Keyboard, 0x011A),
|
||||
("BlackWidow Stealth", RGBDeviceType.Keyboard, 0x011B),
|
||||
("DeathStalker Expert", RGBDeviceType.Keyboard, 0x0202),
|
||||
("BlackWidow Chroma", RGBDeviceType.Keyboard, 0x0203),
|
||||
("DeathStalker Chroma", RGBDeviceType.Keyboard, 0x0204),
|
||||
("Blade Stealth", RGBDeviceType.Keyboard, 0x0205),
|
||||
("BlackWidow Tournament Edition Chroma", RGBDeviceType.Keyboard, 0x0209),
|
||||
("Blade QHD", RGBDeviceType.Keyboard, 0x020F),
|
||||
("Blade Pro (Late 2016)", RGBDeviceType.Keyboard, 0x0210),
|
||||
("BlackWidow Chroma (Overwatch)", RGBDeviceType.Keyboard, 0x0211),
|
||||
("BlackWidow Ultimate 2016", RGBDeviceType.Keyboard, 0x0214),
|
||||
("BlackWidow X Chroma", RGBDeviceType.Keyboard, 0x0216),
|
||||
("BlackWidow X Ultimate", RGBDeviceType.Keyboard, 0x0217),
|
||||
("BlackWidow X Tournament Edition Chroma", RGBDeviceType.Keyboard, 0x021A),
|
||||
("Ornata Chroma", RGBDeviceType.Keyboard, 0x021E),
|
||||
("Ornata", RGBDeviceType.Keyboard, 0x021F),
|
||||
("Blade Stealth (Late 2016)", RGBDeviceType.Keyboard, 0x0220),
|
||||
("BlackWidow Chroma V2", RGBDeviceType.Keyboard, 0x0221),
|
||||
("Blade (Late 2016)", RGBDeviceType.Keyboard, 0x0224),
|
||||
("Blade Pro (2017)", RGBDeviceType.Keyboard, 0x0225),
|
||||
("Huntsman Elite", RGBDeviceType.Keyboard, 0x0226),
|
||||
("Huntsman", RGBDeviceType.Keyboard, 0x0227),
|
||||
("BlackWidow Elite", RGBDeviceType.Keyboard, 0x0228),
|
||||
("Cynosa Chroma", RGBDeviceType.Keyboard, 0x022A),
|
||||
("Blade Stealth (Mid 2017)", RGBDeviceType.Keyboard, 0x022D),
|
||||
("Blade Pro FullHD (2017)", RGBDeviceType.Keyboard, 0x022F),
|
||||
("Blade Stealth (Late 2017)", RGBDeviceType.Keyboard, 0x0232),
|
||||
("Blade 15 (2018)", RGBDeviceType.Keyboard, 0x0233),
|
||||
("Blade Pro 17 (2019)", RGBDeviceType.Keyboard, 0x0234),
|
||||
("BlackWidow Lite (2018)", RGBDeviceType.Keyboard, 0x0235),
|
||||
("BlackWidow Essential", RGBDeviceType.Keyboard, 0x0237),
|
||||
("Blade Stealth (2019)", RGBDeviceType.Keyboard, 0x0239),
|
||||
("Blade 15 (2019) Advanced", RGBDeviceType.Keyboard, 0x023A),
|
||||
("Blade 15 (2018) Base Model", RGBDeviceType.Keyboard, 0x023B),
|
||||
("Cynosa Lite", RGBDeviceType.Keyboard, 0x023F),
|
||||
("Blade 15 (2018) Mercury", RGBDeviceType.Keyboard, 0x0240),
|
||||
("BlackWidow (2019)", RGBDeviceType.Keyboard, 0x0241),
|
||||
("Huntsman Tournament Edition", RGBDeviceType.Keyboard, 0x0243),
|
||||
("Blade 15 (Mid 2019) Mercury", RGBDeviceType.Keyboard, 0x0245),
|
||||
("Blade 15 (Mid 2019) Base", RGBDeviceType.Keyboard, 0x0246),
|
||||
("Blade Stealth (Late 2019)", RGBDeviceType.Keyboard, 0x024A),
|
||||
("Blade Pro (Late 2019)", RGBDeviceType.Keyboard, 0x024C),
|
||||
("Blade 15 Studio Edition (2019)", RGBDeviceType.Keyboard, 0x024D),
|
||||
("Blade Stealth (Early 2020)", RGBDeviceType.Keyboard, 0x0252),
|
||||
("Blade 15 Advanced (2020)", RGBDeviceType.Keyboard, 0x0253),
|
||||
("Blade 15 (Early 2020) Base", RGBDeviceType.Keyboard, 0x0255),
|
||||
("Blade Stealth (Late 2020)", RGBDeviceType.Keyboard, 0x0259),
|
||||
("Ornata Chroma V2", RGBDeviceType.Keyboard, 0x025D),
|
||||
("Cynosa V2", RGBDeviceType.Keyboard, 0x025E),
|
||||
("BlackWidow Ultimate 2012", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x010D),
|
||||
("BlackWidow Classic (Alternate)", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x010E),
|
||||
("Anansi", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x010F),
|
||||
("BlackWidow Ultimate 2013", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x011A),
|
||||
("BlackWidow Stealth", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x011B),
|
||||
("DeathStalker Expert", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0202),
|
||||
("BlackWidow Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0203),
|
||||
("DeathStalker Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0204),
|
||||
("Blade Stealth", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0205),
|
||||
("BlackWidow Tournament Edition Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0209),
|
||||
("Blade QHD", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x020F),
|
||||
("Blade Pro (Late 2016)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0210),
|
||||
("BlackWidow Chroma (Overwatch)", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0211),
|
||||
("BlackWidow Ultimate 2016", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0214),
|
||||
("BlackWidow X Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0216),
|
||||
("BlackWidow X Ultimate", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0217),
|
||||
("BlackWidow X Tournament Edition Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x021A),
|
||||
("Ornata Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x021E),
|
||||
("Ornata", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x021F),
|
||||
("Blade Stealth (Late 2016)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0220),
|
||||
("BlackWidow Chroma V2", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0221),
|
||||
("Blade (Late 2016)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0224),
|
||||
("Blade Pro (2017)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0225),
|
||||
("Huntsman Elite", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0226),
|
||||
("Huntsman", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0227),
|
||||
("BlackWidow Elite", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0228),
|
||||
("Cynosa Chroma", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x022A),
|
||||
("Blade Stealth (Mid 2017)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x022D),
|
||||
("Blade Pro FullHD (2017)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x022F),
|
||||
("Blade Stealth (Late 2017)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0232),
|
||||
("Blade 15 (2018)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0233),
|
||||
("Blade Pro 17 (2019)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0234),
|
||||
("BlackWidow Lite (2018)", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0235),
|
||||
("BlackWidow Essential", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0237),
|
||||
("Blade Stealth (2019)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0239),
|
||||
("Blade 15 (2019) Advanced", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x023A),
|
||||
("Blade 15 (2018) Base Model", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x023B),
|
||||
("Cynosa Lite", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x023F),
|
||||
("Blade 15 (2018) Mercury", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0240),
|
||||
("BlackWidow (2019)", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0241),
|
||||
("Huntsman Tournament Edition", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x0243),
|
||||
("Blade 15 (Mid 2019) Mercury", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0245),
|
||||
("Blade 15 (Mid 2019) Base", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0246),
|
||||
("Blade Stealth (Late 2019)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x024A),
|
||||
("Blade Pro (Late 2019)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x024C),
|
||||
("Blade 15 Studio Edition (2019)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x024D),
|
||||
("Blade Stealth (Early 2020)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0252),
|
||||
("Blade 15 Advanced (2020)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0253),
|
||||
("Blade 15 (Early 2020) Base", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0255),
|
||||
("Blade Stealth (Late 2020)", RGBDeviceType.Keyboard, RazerEndpointType.LaptopKeyboard, 0x0259),
|
||||
("BlackWidow V3 Pro", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x25A), // The keyboard, only present when connected with cable
|
||||
("BlackWidow V3 Pro", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x25C), // The dongle, may not be present when connected with cable
|
||||
("Ornata Chroma V2", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x025D),
|
||||
("Cynosa V2", RGBDeviceType.Keyboard, RazerEndpointType.Keyboard, 0x025E),
|
||||
|
||||
// Mice
|
||||
("Orochi 2011", RGBDeviceType.Mouse, 0x0013),
|
||||
("DeathAdder 3.5G", RGBDeviceType.Mouse, 0x0016),
|
||||
("Abyssus 1800", RGBDeviceType.Mouse, 0x0020),
|
||||
("Mamba 2012 (Wired)", RGBDeviceType.Mouse, 0x0024),
|
||||
("Mamba 2012 (Wireless)", RGBDeviceType.Mouse, 0x0025),
|
||||
("Naga 2012", RGBDeviceType.Mouse, 0x002E),
|
||||
("Imperator 2012", RGBDeviceType.Mouse, 0x002F),
|
||||
("Ouroboros 2012", RGBDeviceType.Mouse, 0x0032),
|
||||
("Taipan", RGBDeviceType.Mouse, 0x0034),
|
||||
("Naga Hex (Red)", RGBDeviceType.Mouse, 0x0036),
|
||||
("DeathAdder 2013", RGBDeviceType.Mouse, 0x0037),
|
||||
("DeathAdder 1800", RGBDeviceType.Mouse, 0x0038),
|
||||
("Orochi 2013", RGBDeviceType.Mouse, 0x0039),
|
||||
("Naga 2014", RGBDeviceType.Mouse, 0x0040),
|
||||
("Naga Hex", RGBDeviceType.Mouse, 0x0041),
|
||||
("Abyssus 2014", RGBDeviceType.Mouse, 0x0042),
|
||||
("DeathAdder Chroma", RGBDeviceType.Mouse, 0x0043),
|
||||
("Mamba (Wired)", RGBDeviceType.Mouse, 0x0044),
|
||||
("Mamba (Wireless)", RGBDeviceType.Mouse, 0x0045),
|
||||
("Mamba Tournament Edition", RGBDeviceType.Mouse, 0x0046),
|
||||
("Orochi (Wired)", RGBDeviceType.Mouse, 0x0048),
|
||||
("Diamondback Chroma", RGBDeviceType.Mouse, 0x004C),
|
||||
("DeathAdder 2000", RGBDeviceType.Mouse, 0x004F),
|
||||
("Naga Hex V2", RGBDeviceType.Mouse, 0x0050),
|
||||
("Naga Chroma", RGBDeviceType.Mouse, 0x0053),
|
||||
("DeathAdder 3500", RGBDeviceType.Mouse, 0x0054),
|
||||
("Lancehead (Wired)", RGBDeviceType.Mouse, 0x0059),
|
||||
("Lancehead (Wireless)", RGBDeviceType.Mouse, 0x005A),
|
||||
("Abyssus V2", RGBDeviceType.Mouse, 0x005B),
|
||||
("DeathAdder Elite", RGBDeviceType.Mouse, 0x005C),
|
||||
("Abyssus 2000", RGBDeviceType.Mouse, 0x005E),
|
||||
("Lancehead Tournament Edition", RGBDeviceType.Mouse, 0x0060),
|
||||
("Atheris (Receiver)", RGBDeviceType.Mouse, 0x0062),
|
||||
("Basilisk", RGBDeviceType.Mouse, 0x0064),
|
||||
("Naga Trinity", RGBDeviceType.Mouse, 0x0067),
|
||||
("Abyssus Elite (D.Va Edition)", RGBDeviceType.Mouse, 0x006A),
|
||||
("Abyssus Essential", RGBDeviceType.Mouse, 0x006B),
|
||||
("Mamba Elite (Wired)", RGBDeviceType.Mouse, 0x006C),
|
||||
("DeathAdder Essential", RGBDeviceType.Mouse, 0x006E),
|
||||
("Lancehead Wireless (Receiver)", RGBDeviceType.Mouse, 0x006F),
|
||||
("Lancehead Wireless (Wired)", RGBDeviceType.Mouse, 0x0070),
|
||||
("DeathAdder Essential (White Edition)", RGBDeviceType.Mouse, 0x0071),
|
||||
("Mamba Wireless (Receiver)", RGBDeviceType.Mouse, 0x0072),
|
||||
("Mamba Wireless (Wired)", RGBDeviceType.Mouse, 0x0073),
|
||||
("Viper", RGBDeviceType.Mouse, 0x0078),
|
||||
("Viper Ultimate (Wired)", RGBDeviceType.Mouse, 0x007A),
|
||||
("Viper Ultimate (Wireless)", RGBDeviceType.Mouse, 0x007B),
|
||||
("DeathAdder V2 Pro (Wired)", RGBDeviceType.Mouse, 0x007C),
|
||||
("DeathAdder V2 Pro (Wireless)", RGBDeviceType.Mouse, 0x007D),
|
||||
("Basilisk X HyperSpeed", RGBDeviceType.Mouse, 0x0083),
|
||||
("Basilisk Ultimate", RGBDeviceType.Mouse, 0x0088),
|
||||
("DeathAdder V2", RGBDeviceType.Mouse, 0x0084),
|
||||
("Viper Mini", RGBDeviceType.Mouse, 0x008A),
|
||||
("Orochi 2011", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0013),
|
||||
("DeathAdder 3.5G", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0016),
|
||||
("Abyssus 1800", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0020),
|
||||
("Mamba 2012 (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0024),
|
||||
("Mamba 2012 (Wireless)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0025),
|
||||
("Naga 2012", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x002E),
|
||||
("Imperator 2012", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x002F),
|
||||
("Ouroboros 2012", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0032),
|
||||
("Taipan", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0034),
|
||||
("Naga Hex (Red)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0036),
|
||||
("DeathAdder 2013", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0037),
|
||||
("DeathAdder 1800", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0038),
|
||||
("Orochi 2013", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0039),
|
||||
("Naga 2014", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0040),
|
||||
("Naga Hex", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0041),
|
||||
("Abyssus 2014", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0042),
|
||||
("DeathAdder Chroma", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0043),
|
||||
("Mamba (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0044),
|
||||
("Mamba (Wireless)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0045),
|
||||
("Mamba Tournament Edition", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0046),
|
||||
("Orochi (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0048),
|
||||
("Diamondback Chroma", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x004C),
|
||||
("DeathAdder 2000", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x004F),
|
||||
("Naga Hex V2", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0050),
|
||||
("Naga Chroma", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0053),
|
||||
("DeathAdder 3500", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0054),
|
||||
("Lancehead (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0059),
|
||||
("Lancehead (Wireless)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x005A),
|
||||
("Abyssus V2", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x005B),
|
||||
("DeathAdder Elite", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x005C),
|
||||
("Abyssus 2000", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x005E),
|
||||
("Lancehead Tournament Edition", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0060),
|
||||
("Atheris (Receiver)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0062),
|
||||
("Basilisk", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0064),
|
||||
("Naga Trinity", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0067),
|
||||
("Abyssus Elite (D.Va Edition)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x006A),
|
||||
("Abyssus Essential", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x006B),
|
||||
("Mamba Elite (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x006C),
|
||||
("DeathAdder Essential", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x006E),
|
||||
("Lancehead Wireless (Receiver)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x006F),
|
||||
("Lancehead Wireless (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0070),
|
||||
("DeathAdder Essential (White Edition)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0071),
|
||||
("Mamba Wireless (Receiver)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0072),
|
||||
("Mamba Wireless (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0073),
|
||||
("Viper", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0078),
|
||||
("Viper Ultimate (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x007A),
|
||||
("Viper Ultimate (Wireless)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x007B),
|
||||
("DeathAdder V2 Pro (Wired)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x007C),
|
||||
("DeathAdder V2 Pro (Wireless)", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x007D),
|
||||
("Basilisk X HyperSpeed", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0083),
|
||||
("Basilisk Ultimate", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0088),
|
||||
("DeathAdder V2", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x0084),
|
||||
("Viper Mini", RGBDeviceType.Mouse, RazerEndpointType.Mouse, 0x008A),
|
||||
|
||||
// Mousepads
|
||||
("Firefly Hyperflux", RGBDeviceType.Mousepad, 0x0068),
|
||||
("Firefly", RGBDeviceType.Mousepad, 0x0C00),
|
||||
("Goliathus", RGBDeviceType.Mousepad, 0x0C01),
|
||||
("Goliathus Extended", RGBDeviceType.Mousepad, 0x0C02),
|
||||
("Firefly v2", RGBDeviceType.Mousepad, 0x0C04),
|
||||
("Firefly Hyperflux", RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, 0x0068),
|
||||
("Firefly", RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, 0x0C00),
|
||||
("Goliathus", RGBDeviceType.Mousepad, RazerEndpointType.ChromaLink, 0x0C01),
|
||||
("Goliathus Extended", RGBDeviceType.Mousepad, RazerEndpointType.ChromaLink, 0x0C02),
|
||||
("Firefly v2", RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, 0x0C04),
|
||||
|
||||
// Headsets
|
||||
("Kraken 7.1", RGBDeviceType.Headset, 0x0501),
|
||||
("Kraken 7.1 Chroma", RGBDeviceType.Headset, 0x0504),
|
||||
("Kraken 7.1", RGBDeviceType.Headset, 0x0506),
|
||||
("Kraken 7.1 V2", RGBDeviceType.Headset, 0x0510),
|
||||
("Kraken Ultimate", RGBDeviceType.Headset, 0x0527),
|
||||
("Kraken Kitty Edition", RGBDeviceType.Headset, 0x0F19),
|
||||
("Kraken 7.1", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0501),
|
||||
("Kraken 7.1 Chroma", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0504),
|
||||
("Kraken 7.1", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0506),
|
||||
("Kraken 7.1 V2", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0510),
|
||||
("Kraken Ultimate", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0527),
|
||||
("Kraken Kitty Edition", RGBDeviceType.Headset, RazerEndpointType.Headset, 0x0F19),
|
||||
|
||||
// Keypads
|
||||
("Nostromo", RGBDeviceType.Keypad, 0x0111),
|
||||
("Orbweaver", RGBDeviceType.Keypad, 0x0113),
|
||||
("Tartarus", RGBDeviceType.Keypad, 0x0201),
|
||||
("Orbweaver Chroma", RGBDeviceType.Keypad, 0x0207),
|
||||
("Tartarus Chroma", RGBDeviceType.Keypad, 0x0208),
|
||||
("Tartarus V2", RGBDeviceType.Keypad, 0x022B),
|
||||
("Tartarus Pro", RGBDeviceType.Keypad, 0x0244),
|
||||
("Nostromo", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0111),
|
||||
("Orbweaver", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0113),
|
||||
("Tartarus", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0201),
|
||||
("Orbweaver Chroma", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0207),
|
||||
("Tartarus Chroma", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0208),
|
||||
("Tartarus V2", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x022B),
|
||||
("Tartarus Pro", RGBDeviceType.Keypad, RazerEndpointType.Keypad, 0x0244),
|
||||
|
||||
// Misc - unsupported through the effects API
|
||||
// ("Core", RGBDeviceType.GraphicsCard, 0x0215),
|
||||
// ("Base Station Chroma", RGBDeviceType.HeadsetStand, 0x0F08),
|
||||
// ("Nommo Chroma", RGBDeviceType.Unknown, 0x0517),
|
||||
// ("Nommo Pro", RGBDeviceType.Unknown, 0x0518),
|
||||
// ("Chroma Mug Holder", RGBDeviceType.Unknown, 0x0F07),
|
||||
// ("Chroma Hardware Development Kit (HDK)", RGBDeviceType.Unknown, 0x0F09),
|
||||
// ("Mouse Bungee V3 Chroma", RGBDeviceType.Unknown, 0x0F1D),
|
||||
// ("Base Station V2 Chroma", RGBDeviceType.Unknown, 0x0F20)
|
||||
// Misc - guessing these are through ChromaLink
|
||||
("Core", RGBDeviceType.GraphicsCard, RazerEndpointType.ChromaLink, 0x0215),
|
||||
("Base Station Chroma", RGBDeviceType.HeadsetStand, RazerEndpointType.ChromaLink, 0x0F08),
|
||||
("Nommo Chroma", RGBDeviceType.Speaker, RazerEndpointType.ChromaLink, 0x0517),
|
||||
("Nommo Pro", RGBDeviceType.Speaker, RazerEndpointType.ChromaLink, 0x0518),
|
||||
("Chroma Mug Holder", RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, 0x0F07),
|
||||
("Chroma Hardware Development Kit (HDK)", RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, 0x0F09),
|
||||
("Mouse Bungee V3 Chroma", RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, 0x0F1D),
|
||||
("Base Station V2 Chroma", RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, 0x0F20)
|
||||
};
|
||||
|
||||
#endregion
|
||||
@ -175,7 +179,7 @@ namespace RGB.NET.Devices.Razer.HID
|
||||
|
||||
HashSet<int> ids = new(DeviceList.Local.GetHidDevices(VENDOR_ID).Select(x => x.ProductID).Distinct());
|
||||
DeviceDataList connectedDevices = DEVICES.Where(d => ids.Contains(d.id) && loadFilter.HasFlag(d.deviceType)).ToList();
|
||||
|
||||
|
||||
ConnectedDevices.AddRange(connectedDevices);
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace RGB.NET.Devices.Razer
|
||||
|
||||
private void InitializeLayout()
|
||||
{
|
||||
// TODO Look at DeviceInfo.EndpointType and act accordingly for both Keyboard and LaptopKeyboard
|
||||
for (int i = 0; i < _Defines.KEYBOARD_MAX_ROW; i++)
|
||||
for (int j = 0; j < _Defines.KEYBOARD_MAX_COLUMN; j++)
|
||||
AddLed(LedId.Keyboard_Escape + ((i * _Defines.KEYBOARD_MAX_COLUMN) + j), new Point(j * 20, i * 20), new Size(19, 19));
|
||||
|
||||
@ -24,9 +24,11 @@ namespace RGB.NET.Devices.Razer
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Razer.RazerKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
|
||||
internal RazerKeyboardRGBDeviceInfo(string model)
|
||||
: base(RGBDeviceType.Keyboard, model)
|
||||
{ }
|
||||
/// <param name="endpointType">The Razer SDK endpoint type the <see cref="IRGBDevice"/> is addressed through.</param>
|
||||
internal RazerKeyboardRGBDeviceInfo(string model, RazerEndpointType endpointType)
|
||||
: base(RGBDeviceType.Keyboard, endpointType, model)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
internal const int CHROMALINK_EFFECT_ID = 1;
|
||||
internal const int KEYBOARD_EFFECT_ID = 9;
|
||||
internal const int MOUSEPAD_EFFECT_ID = 6;
|
||||
internal const int MOUSE_EFFECT_ID = 3;
|
||||
internal const int MOUSE_EFFECT_ID = 8;
|
||||
internal const int KEYPAD_EFFECT_ID = 2;
|
||||
|
||||
internal const int KEYBOARD_MAX_ROW = 8;
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
internal const int MOUSE_MAX_ROW = 9;
|
||||
internal const int MOUSE_MAX_COLUMN = 7;
|
||||
internal const int MOUSE_MAX_LEDS = KEYBOARD_MAX_ROW * KEYBOARD_MAX_COLUMN;
|
||||
internal const int MOUSE_MAX_LEDS = MOUSE_MAX_ROW * MOUSE_MAX_COLUMN;
|
||||
|
||||
internal const int HEADSET_MAX_LEDS = 5;
|
||||
|
||||
|
||||
@ -79,18 +79,18 @@ namespace RGB.NET.Devices.Razer
|
||||
|
||||
if (LoadEmulatorDevices)
|
||||
{
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Keyboard))
|
||||
devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Mouse))
|
||||
devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, "Emulator Mouse"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Headset) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Headset))
|
||||
devices.Add(new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Headset, "Emulator Headset"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mousepad) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Mousepad))
|
||||
devices.Add(new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mousepad, "Emulator Mousepad"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Keypad) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Keypad))
|
||||
devices.Add(new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Keypad, "Emulator Keypad"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Unknown) && devices.All(d => d.DeviceInfo.DeviceType != RGBDeviceType.Unknown))
|
||||
devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, "Emulator Chroma Link"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && devices.All(d => d is not RazerKeyboardRGBDevice))
|
||||
devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard", RazerEndpointType.Keyboard), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && devices.All(d => d is not RazerMouseRGBDevice))
|
||||
devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, RazerEndpointType.Mouse, "Emulator Mouse"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Headset) && devices.All(d => d is not RazerHeadsetRGBDevice))
|
||||
devices.Add(new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Headset, RazerEndpointType.Headset, "Emulator Headset"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mousepad) && devices.All(d => d is not RazerMousepadRGBDevice))
|
||||
devices.Add(new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, "Emulator Mousepad"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Keypad) && devices.All(d => d is not RazerMousepadRGBDevice))
|
||||
devices.Add(new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Keypad, RazerEndpointType.Keypad, "Emulator Keypad"), GetUpdateTrigger()));
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Unknown) && devices.All(d => d is not RazerChromaLinkRGBDevice))
|
||||
devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, "Emulator Chroma Link"), GetUpdateTrigger()));
|
||||
}
|
||||
|
||||
return devices;
|
||||
@ -98,21 +98,29 @@ namespace RGB.NET.Devices.Razer
|
||||
|
||||
protected override IEnumerable<IRGBDevice> LoadDevices()
|
||||
{
|
||||
foreach ((var model, RGBDeviceType deviceType, int _) in DeviceChecker.ConnectedDevices)
|
||||
// Only take the first device of each endpoint type, the Razer SDK doesn't allow separate control over multiple devices using the same endpoint
|
||||
foreach ((var model, RGBDeviceType deviceType, RazerEndpointType endpointType, int _) in DeviceChecker.ConnectedDevices.GroupBy(GetEndpointDeviceType).Select(t => t.First()))
|
||||
{
|
||||
yield return deviceType switch
|
||||
yield return endpointType switch
|
||||
{
|
||||
RGBDeviceType.Keyboard => new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo(model), GetUpdateTrigger()),
|
||||
RGBDeviceType.Mouse => new RazerMouseRGBDevice(new RazerRGBDeviceInfo(deviceType, model), GetUpdateTrigger()),
|
||||
RGBDeviceType.Headset => new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(deviceType, model), GetUpdateTrigger()),
|
||||
RGBDeviceType.Mousepad => new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(deviceType, model), GetUpdateTrigger()),
|
||||
RGBDeviceType.Keypad => new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(deviceType, model), GetUpdateTrigger()),
|
||||
RGBDeviceType.Unknown => new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(deviceType, model), GetUpdateTrigger()),
|
||||
_ => throw new RGBDeviceException($"Razer SDK does not support {deviceType} devices")
|
||||
RazerEndpointType.Keyboard => new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo(model, endpointType), GetUpdateTrigger()),
|
||||
RazerEndpointType.LaptopKeyboard => new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo(model, endpointType), GetUpdateTrigger()),
|
||||
RazerEndpointType.Mouse => new RazerMouseRGBDevice(new RazerRGBDeviceInfo(deviceType, endpointType, model), GetUpdateTrigger()),
|
||||
RazerEndpointType.Headset => new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(deviceType, endpointType, model), GetUpdateTrigger()),
|
||||
RazerEndpointType.Mousepad => new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(deviceType, endpointType, model), GetUpdateTrigger()),
|
||||
RazerEndpointType.Keypad => new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(deviceType, endpointType, model), GetUpdateTrigger()),
|
||||
RazerEndpointType.ChromaLink => new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(deviceType, endpointType, model), GetUpdateTrigger()),
|
||||
_ => throw new RGBDeviceException($"Razer SDK does not support endpoint '{endpointType}'")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private RazerEndpointType GetEndpointDeviceType((string model, RGBDeviceType deviceType, RazerEndpointType razerDeviceType, int id) device)
|
||||
{
|
||||
// Treat laptop keyboards as regular keyboards
|
||||
return device.razerDeviceType == RazerEndpointType.LaptopKeyboard ? RazerEndpointType.Keyboard : device.razerDeviceType;
|
||||
}
|
||||
|
||||
private void ThrowRazerError(RazerError errorCode) => throw new RazerException(errorCode);
|
||||
|
||||
private void TryUnInit()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user