mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 04:56:44 +00:00
Refactored to do everything based on LEDs.
This will adapt the devices and reduces the importance of the "special case keyboard"
This commit is contained in:
1 parent
bfe51add66
commit
5a018d0743
24 files changed
+847
-894
No files matched your search
@@ -2,7 +2,7 @@
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using System.Drawing;
|
||||
using CUE.NET.Devices.Keyboard.Enums;
|
||||
using CUE.NET.Devices.Generic.Enums;
|
||||
|
||||
namespace CUE.NET.Brushes
|
||||
{
|
||||
@@ -14,12 +14,12 @@ namespace CUE.NET.Brushes
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// Gets the id of the target-key.
|
||||
/// Gets the ID of the target-LED.
|
||||
/// </summary>
|
||||
public CorsairKeyboardKeyId Key { get; }
|
||||
public CorsairLedId LedId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the point representing the position to render the target-key.
|
||||
/// Gets the point representing the position to render the target-LED.
|
||||
/// </summary>
|
||||
public PointF Point { get; }
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace CUE.NET.Brushes
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BrushRenderTarget"/> class.
|
||||
/// </summary>
|
||||
/// <param name="key">The id of the target-key.</param>
|
||||
/// <param name="point">The point representing the position to render the target-key.</param>
|
||||
public BrushRenderTarget(CorsairKeyboardKeyId key, PointF point)
|
||||
/// <param name="ledId">The ID of the target-LED.</param>
|
||||
/// <param name="point">The point representing the position to render the target-LED.</param>
|
||||
public BrushRenderTarget(CorsairLedId ledId, PointF point)
|
||||
{
|
||||
this.Point = point;
|
||||
this.Key = key;
|
||||
this.LedId = ledId;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CUE.NET.Brushes
|
||||
/// <returns>The color at the specified point.</returns>
|
||||
protected override Color GetColorAtPoint(RectangleF rectangle, BrushRenderTarget renderTarget)
|
||||
{
|
||||
CorsairKey key = CueSDK.KeyboardSDK[renderTarget.Key];
|
||||
CorsairKey key = CueSDK.KeyboardSDK[(CorsairKeyboardKeyId)renderTarget.LedId];
|
||||
if (key == null) return Color.Transparent;
|
||||
|
||||
Color color;
|
||||
|
||||
Reference in new issue
Block a user