mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 13:06:24 +00:00
Separated keyboard, mouse and headset
This commit is contained in:
1 parent
a4a81cf3c3
commit
575804c8bf
31 files changed
+528
-405
No files matched your search
@@ -0,0 +1,46 @@
|
||||
using System.Drawing;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Wrapper.Keyboard
|
||||
{
|
||||
public class CorsairKeyboard : AbstractCueDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public CorsairKeyboardDeviceInfo KeyboardDeviceInfo { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairKeyboard(CorsairKeyboardDeviceInfo info)
|
||||
: base(info)
|
||||
{
|
||||
this.KeyboardDeviceInfo = info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void SetKeyColor(char key, Color color)
|
||||
{
|
||||
int id = _CUESDK.CorsairGetLedIdForKeyName(key);
|
||||
_CorsairLedColor ledColor = new _CorsairLedColor { ledId = id, r = color.R, g = color.G, b = color.B };
|
||||
SetKeyColors(ledColor);
|
||||
}
|
||||
|
||||
public void SetKeyColors(char[] keys, Color color)
|
||||
{
|
||||
_CorsairLedColor[] ledColors = new _CorsairLedColor[keys.Length];
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
int id = _CUESDK.CorsairGetLedIdForKeyName(keys[i]);
|
||||
ledColors[i] = new _CorsairLedColor { ledId = id, r = color.R, g = color.G, b = color.B };
|
||||
}
|
||||
SetKeyColors(ledColors);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using CUE.NET.Enums.Keyboard;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Wrapper.Keyboard
|
||||
{
|
||||
public class CorsairKeyboardDeviceInfo : GenericDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// Physical layout of the keyboard.
|
||||
/// </summary>
|
||||
public CorsairPhysicalKeyboardLayout PhysicalLayout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Logical layout of the keyboard as set in CUE settings.
|
||||
/// </summary>
|
||||
public CorsairLogicalKeyboardLayout LogicalLayout { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Internal constructor of managed CorsairDeviceInfo.
|
||||
/// </summary>
|
||||
/// <param name="nativeInfo">The native CorsairDeviceInfo-struct</param>
|
||||
internal CorsairKeyboardDeviceInfo(_CorsairDeviceInfo nativeInfo)
|
||||
: base(nativeInfo)
|
||||
{
|
||||
this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout;
|
||||
this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user