1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-31 17:53:39 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
417b9be3f9
Merge pull request #380 from DarthAffe/Actions
(MINOR) Updated workflows and bumped version for release
2024-03-08 21:47:22 +01:00
ced13e9ec2 (MINOR) Updated workflows and bumped version for release 2024-03-08 20:50:58 +01:00
4f0f25e34e
Merge pull request #379 from DarthAffe/RazerDebugDevices
Razer: Load Debug Device Properties for Each Device Type
2024-03-08 20:38:01 +01:00
58ed8bb2f1
Merge pull request #378 from diogotr7/feature/msi-pid
Add extra MSI pid to steelseries provider
2024-03-08 20:35:40 +01:00
Aytaç Kayadelen
d82eebd769 Razer: Load Debug Device Properties for Each Device Type 2024-03-08 20:28:09 +01:00
Diogo Trindade
3ca782a6a7
Add extra MSI pid to steelseries provider 2024-03-02 22:16:07 +00:00
6 changed files with 54 additions and 35 deletions

View File

@ -14,11 +14,11 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4.1.1
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x
@ -26,7 +26,7 @@ jobs:
6.0.x 6.0.x
- name: Git Semantic Version - name: Git Semantic Version
id: versioning id: versioning
uses: PaulHatch/semantic-version@v4.0.3 uses: PaulHatch/semantic-version@v5.4.0
with: with:
short_tags: false short_tags: false
format: "${major}.${minor}.${patch}-prerelease.${increment}" format: "${major}.${minor}.${patch}-prerelease.${increment}"
@ -37,25 +37,25 @@ jobs:
- name: Test - name: Test
run: dotnet test --no-build --verbosity normal --configuration Release run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET6 - name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET6 name: RGB.NET-NET6
path: bin/net6.0/RGB.NET.*.dll path: bin/net6.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET7 - name: Upload a Build Artifact NET7
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET7 name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET8 - name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET8 name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload Nuget Build Artifact - name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-Nugets name: RGB.NET-Nugets
path: bin/*nupkg path: bin/*nupkg

View File

@ -10,9 +10,9 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4.1.1
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x

View File

@ -13,11 +13,11 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4.1.1
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x
@ -25,7 +25,7 @@ jobs:
6.0.x 6.0.x
- name: Git Semantic Version - name: Git Semantic Version
id: versioning id: versioning
uses: PaulHatch/semantic-version@v4.0.3 uses: PaulHatch/semantic-version@v5.4.0
with: with:
short_tags: false short_tags: false
format: "${major}.${minor}.${patch}" format: "${major}.${minor}.${patch}"
@ -36,25 +36,25 @@ jobs:
- name: Test - name: Test
run: dotnet test --no-build --verbosity normal --configuration Release run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET6 - name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET6 name: RGB.NET-NET6
path: bin/net6.0/RGB.NET.*.dll path: bin/net6.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET7 - name: Upload a Build Artifact NET7
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET7 name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET8 - name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-NET8 name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload Nuget Build Artifact - name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v4.3.1
with: with:
name: RGB.NET-Nugets name: RGB.NET-Nugets
path: bin/*nupkg path: bin/*nupkg

View File

@ -1,42 +1,55 @@
namespace RGB.NET.Devices.Razer; using System;
namespace RGB.NET.Devices.Razer;
/// <summary> /// <summary>
/// Represents a type of Razer SDK endpoint /// Represents a type of Razer SDK endpoint
/// </summary> /// </summary>
[Flags]
public enum RazerEndpointType public enum RazerEndpointType
{ {
/// <summary>
/// No endpoint
/// </summary>
None = 0,
/// <summary> /// <summary>
/// The keyboard endpoint /// The keyboard endpoint
/// </summary> /// </summary>
Keyboard, Keyboard = 1 << 0,
/// <summary> /// <summary>
/// The laptop keyboard endpoint, shares the <see cref="Keyboard"/> endpoint but has a different LED layout /// The laptop keyboard endpoint, shares the <see cref="Keyboard"/> endpoint but has a different LED layout
/// </summary> /// </summary>
LaptopKeyboard, LaptopKeyboard = 1 << 1,
/// <summary> /// <summary>
/// The mouse endpoint /// The mouse endpoint
/// </summary> /// </summary>
Mouse, Mouse = 1 << 2,
/// <summary> /// <summary>
/// The headset endpoint /// The headset endpoint
/// </summary> /// </summary>
Headset, Headset = 1 << 3,
/// <summary> /// <summary>
/// The mousepad endpoint /// The mousepad endpoint
/// </summary> /// </summary>
Mousepad, Mousepad = 1 << 4,
/// <summary> /// <summary>
/// The keypad endpoint /// The keypad endpoint
/// </summary> /// </summary>
Keypad, Keypad = 1 << 5,
/// <summary> /// <summary>
/// The Chroma Link endpoint /// The Chroma Link endpoint
/// </summary> /// </summary>
ChromaLink, ChromaLink = 1 << 6,
/// <summary>
/// All endpoints
/// </summary>
All = ~None
} }

View File

@ -50,7 +50,7 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
/// <summary> /// <summary>
/// Forces to load the devices represented by the emulator even if they aren't reported to exist. /// Forces to load the devices represented by the emulator even if they aren't reported to exist.
/// </summary> /// </summary>
public bool LoadEmulatorDevices { get; set; } = false; public RazerEndpointType LoadEmulatorDevices { get; set; } = RazerEndpointType.None;
private const int VENDOR_ID = 0x1532; private const int VENDOR_ID = 0x1532;
@ -313,21 +313,26 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
{ {
DeviceDefinitions.LoadFilter = loadFilter; DeviceDefinitions.LoadFilter = loadFilter;
IList<IRGBDevice> devices = base.GetLoadedDevices(loadFilter).ToList(); List<IRGBDevice> devices = base.GetLoadedDevices(loadFilter).ToList();
if (LoadEmulatorDevices) if (LoadEmulatorDevices != RazerEndpointType.None)
{ {
if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && devices.All(d => d is not RazerKeyboardRGBDevice)) if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && (LoadEmulatorDevices.HasFlag(RazerEndpointType.Keyboard) || LoadEmulatorDevices.HasFlag(RazerEndpointType.LaptopKeyboard)) && devices.All(d => d is not RazerKeyboardRGBDevice))
devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard", RazerEndpointType.Keyboard), GetUpdateTrigger(), LedMappings.Keyboard)); devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard", RazerEndpointType.Keyboard), GetUpdateTrigger(), LedMappings.Keyboard));
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && devices.All(d => d is not RazerMouseRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Mouse) && devices.All(d => d is not RazerMouseRGBDevice))
devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, RazerEndpointType.Mouse, "Emulator Mouse"), GetUpdateTrigger(), LedMappings.Mouse)); devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, RazerEndpointType.Mouse, "Emulator Mouse"), GetUpdateTrigger(), LedMappings.Mouse));
if (loadFilter.HasFlag(RGBDeviceType.Headset) && devices.All(d => d is not RazerHeadsetRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Headset) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Headset) && devices.All(d => d is not RazerHeadsetRGBDevice))
devices.Add(new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Headset, RazerEndpointType.Headset, "Emulator Headset"), GetUpdateTrigger())); 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))
if (loadFilter.HasFlag(RGBDeviceType.Mousepad) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Mousepad) && devices.All(d => d is not RazerMousepadRGBDevice))
devices.Add(new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, "Emulator Mousepad"), GetUpdateTrigger())); 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))
if (loadFilter.HasFlag(RGBDeviceType.Keypad) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Keypad) && devices.All(d => d is not RazerMousepadRGBDevice))
devices.Add(new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Keypad, RazerEndpointType.Keypad, "Emulator Keypad"), GetUpdateTrigger())); 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))
if (loadFilter.HasFlag(RGBDeviceType.Unknown) && LoadEmulatorDevices.HasFlag(RazerEndpointType.ChromaLink) && devices.All(d => d is not RazerChromaLinkRGBDevice))
devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, "Emulator Chroma Link"), GetUpdateTrigger())); devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, "Emulator Chroma Link"), GetUpdateTrigger()));
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.SteelSeries.API; using RGB.NET.Devices.SteelSeries.API;
@ -78,6 +78,7 @@ public sealed class SteelSeriesDeviceProvider : AbstractRGBDeviceProvider
{ 0x1614, RGBDeviceType.Keyboard, "Apex Pro TKL", LedMappings.KeyboardTklMappingUk, SteelSeriesDeviceType.PerKey }, { 0x1614, RGBDeviceType.Keyboard, "Apex Pro TKL", LedMappings.KeyboardTklMappingUk, SteelSeriesDeviceType.PerKey },
{ 0x2036, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey }, { 0x2036, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey },
{ 0x113A, RGBDeviceType.Keyboard, "MSI GE78HX", LedMappings.KeyboardMSIGE78Mapping, SteelSeriesDeviceType.PerKey }, { 0x113A, RGBDeviceType.Keyboard, "MSI GE78HX", LedMappings.KeyboardMSIGE78Mapping, SteelSeriesDeviceType.PerKey },
{ 0x1122, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey },
//Headsets //Headsets
{ 0x12AA, RGBDeviceType.Headset, "Arctis 5", LedMappings.HeadsetTwoZone, SteelSeriesDeviceType.TwoZone }, { 0x12AA, RGBDeviceType.Headset, "Arctis 5", LedMappings.HeadsetTwoZone, SteelSeriesDeviceType.TwoZone },