1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Fixed some stuff with logitech devices

This commit is contained in:
Darth Affe 2017-11-15 21:01:28 +01:00
parent c3edd506cb
commit e165c7af16
6 changed files with 14 additions and 11 deletions

View File

@ -60,7 +60,7 @@ namespace RGB.NET.Devices.Logitech
string basePath = info.ImageBasePath; string basePath = info.ImageBasePath;
string layout = info.ImageLayout; string layout = info.ImageLayout;
string layoutPath = info.LayoutPath; string layoutPath = info.LayoutPath;
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{basePath}\{layoutPath}.xml"), layout, PathHelper.GetAbsolutePath($@"Images\Logitech\{basePath}")); ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{layoutPath}.xml"), layout, PathHelper.GetAbsolutePath($@"Images\Logitech\{basePath}"));
} }
/// <summary> /// <summary>

View File

@ -11,19 +11,19 @@ namespace RGB.NET.Devices.Logitech.HID
#region Constants #region Constants
private const int VENDOR_ID = 0x046D; private const int VENDOR_ID = 0x046D;
//TODO DarthAffe 14.11.2017: Add devices //TODO DarthAffe 14.11.2017: Add devices
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_KEY_DEVICES private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_KEY_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> = new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)>
{ {
("G910", RGBDeviceType.Keyboard, 0xC32B, "", "", ""), ("G910", RGBDeviceType.Keyboard, 0xC32B, "Keyboards", "DE", @"Keyboards\G910\UK"), //TODO DarthAffe 15.11.2017: Somehow detect the current layout
("G910", RGBDeviceType.Keyboard, 0xC333, "", "", ""), ("G610", RGBDeviceType.Keyboard, 0xC333, "Keyboards", "DE", @"Keyboards\G610\UK"),
}; };
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_DEVICE_DEVICES private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_DEVICE_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> = new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)>
{ {
("G403", RGBDeviceType.Mouse, 0xC083, "", "", ""), ("G403", RGBDeviceType.Mouse, 0xC083, "Mice", "default", @"Mice\G403"),
}; };
#endregion #endregion

View File

@ -8,7 +8,6 @@ using System.Globalization;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Logitech.HID; using RGB.NET.Devices.Logitech.HID;
using RGB.NET.Devices.Logitech.Native; using RGB.NET.Devices.Logitech.Native;
using RGB.NET.Devices.Logitech.PerKey;
namespace RGB.NET.Devices.Logitech namespace RGB.NET.Devices.Logitech
{ {
@ -102,13 +101,15 @@ namespace RGB.NET.Devices.Logitech
{ {
(string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerKeyDeviceData; (string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerKeyDeviceData;
LogitechRGBDevice device = new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.PerKeyRGB, imageBasePath, imageLayout, layoutPath)); LogitechRGBDevice device = new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.PerKeyRGB, imageBasePath, imageLayout, layoutPath));
device.Initialize();
devices.Add(device); devices.Add(device);
} }
if (DeviceChecker.IsPerDeviceDeviceConnected) if (DeviceChecker.IsPerDeviceDeviceConnected)
{ {
(string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerDeviceDeviceData; (string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerDeviceDeviceData;
LogitechRGBDevice device = new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.DeviceRGB, imageBasePath, imageLayout, layoutPath)); LogitechRGBDevice device = new LogitechPerDeviceRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.DeviceRGB, imageBasePath, imageLayout, layoutPath));
device.Initialize();
devices.Add(device); devices.Add(device);
} }

View File

@ -4,7 +4,7 @@ using System.Linq;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Logitech.Native; using RGB.NET.Devices.Logitech.Native;
namespace RGB.NET.Devices.Logitech.PerDevice namespace RGB.NET.Devices.Logitech
{ {
/// <inheritdoc /> /// <inheritdoc />
/// <summary> /// <summary>
@ -44,7 +44,7 @@ namespace RGB.NET.Devices.Logitech.PerDevice
base.InitializeLayout(); base.InitializeLayout();
if (LedMapping.Count == 0) if (LedMapping.Count == 0)
InitializeLed(new LogitechLedId(this, LogitechLedIds.DEVICE), new Rectangle(0, 0, 1, 1)); InitializeLed(new LogitechLedId(this, LogitechLedIds.DEVICE), new Rectangle(0, 0, 10, 10));
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@ -4,7 +4,7 @@ using System.Linq;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Logitech.Native; using RGB.NET.Devices.Logitech.Native;
namespace RGB.NET.Devices.Logitech.PerKey namespace RGB.NET.Devices.Logitech
{ {
/// <inheritdoc /> /// <inheritdoc />
/// <summary> /// <summary>

View File

@ -3,4 +3,6 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helper/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=keyboard/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=keyboard/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mouse/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mouse/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=perdevice/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=perkey/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>