mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-10 20:46:24 +00:00
Reorganized project into a (hopefully) better structure
This commit is contained in:
1 parent
ce4e80c24b
commit
fc66ac0ceb
33 files changed
+111
-99
No files matched your search
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.Generic
|
||||
{
|
||||
public abstract class AbstractCueDevice : ICueDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public IDeviceInfo DeviceInfo { get; }
|
||||
|
||||
private Dictionary<int, CorsairLed> Leds { get; } = new Dictionary<int, CorsairLed>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
protected AbstractCueDevice(IDeviceInfo info)
|
||||
{
|
||||
this.DeviceInfo = info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
protected CorsairLed GetLed(int ledId)
|
||||
{
|
||||
if (!this.Leds.ContainsKey(ledId))
|
||||
this.Leds.Add(ledId, new CorsairLed());
|
||||
|
||||
return this.Leds[ledId];
|
||||
}
|
||||
|
||||
public virtual void UpdateLeds(bool fullUpdate = false)
|
||||
{
|
||||
IList<KeyValuePair<int, CorsairLed>> ledsToUpdate = (fullUpdate ? this.Leds : this.Leds.Where(x => x.Value.IsDirty)).ToList();
|
||||
|
||||
if (!ledsToUpdate.Any())
|
||||
return; // CUE seems to crash if 'CorsairSetLedsColors' is called with a zero length array
|
||||
|
||||
int structSize = Marshal.SizeOf(typeof(_CorsairLedColor));
|
||||
IntPtr ptr = Marshal.AllocHGlobal(structSize * ledsToUpdate.Count);
|
||||
IntPtr addPtr = new IntPtr(ptr.ToInt64());
|
||||
foreach (KeyValuePair<int, CorsairLed> led in ledsToUpdate)
|
||||
{
|
||||
_CorsairLedColor color = new _CorsairLedColor
|
||||
{
|
||||
ledId = led.Key,
|
||||
r = led.Value.Color.R,
|
||||
g = led.Value.Color.G,
|
||||
b = led.Value.Color.B
|
||||
};
|
||||
|
||||
Marshal.StructureToPtr(color, addPtr, false);
|
||||
addPtr = new IntPtr(addPtr.ToInt64() + structSize);
|
||||
}
|
||||
_CUESDK.CorsairSetLedsColors(ledsToUpdate.Count, ptr);
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace CUE.NET.Devices.Generic
|
||||
{
|
||||
public class CorsairLed
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public bool IsDirty { get; private set; } = false;
|
||||
|
||||
private Color _color = Color.Black;
|
||||
public Color Color
|
||||
{
|
||||
get { return _color; }
|
||||
set
|
||||
{
|
||||
if (_color != value)
|
||||
IsDirty = true;
|
||||
|
||||
_color = value;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO DarthAffe 19.09.2015: Add effects and stuff
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairLed() { }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.Generic
|
||||
{
|
||||
/// <summary>
|
||||
/// Managed wrapper for CorsairProtocolDetails.
|
||||
/// </summary>
|
||||
public class CorsairProtocolDetails
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// String containing version of SDK(like “1.0.0.1”).
|
||||
/// Always contains valid value even if there was no CUE found.
|
||||
/// </summary>
|
||||
public string SdkVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// String containing version of CUE(like “1.0.0.1”) or NULL if CUE was not found.
|
||||
/// </summary>
|
||||
public string ServerVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Integer that specifies version of protocol that is implemented by current SDK.
|
||||
/// Numbering starts from 1.
|
||||
/// Always contains valid value even if there was no CUE found.
|
||||
/// </summary>
|
||||
public int SdkProtocolVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Integer that specifies version of protocol that is implemented by CUE.
|
||||
/// Numbering starts from 1.
|
||||
/// If CUE was not found then this value will be 0.
|
||||
/// </summary>
|
||||
public int ServerProtocolVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Boolean that specifies if there were breaking changes between version of protocol implemented by server and client.
|
||||
/// </summary>
|
||||
public bool BreakingChanges { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Internal constructor of managed CorsairProtocolDetails.
|
||||
/// </summary>
|
||||
/// <param name="nativeDetails">The native CorsairProtocolDetails-struct</param>
|
||||
internal CorsairProtocolDetails(_CorsairProtocolDetails nativeDetails)
|
||||
{
|
||||
this.SdkVersion = nativeDetails.sdkVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.sdkVersion);
|
||||
this.ServerVersion = nativeDetails.serverVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.serverVersion);
|
||||
this.SdkProtocolVersion = nativeDetails.sdkProtocolVersion;
|
||||
this.ServerProtocolVersion = nativeDetails.serverProtocolVersion;
|
||||
this.BreakingChanges = nativeDetails.breakingChanges != 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace CUE.NET.Devices.Generic.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available SDK access modes.
|
||||
/// </summary>
|
||||
public enum CorsairAccessMode
|
||||
{
|
||||
ExclusiveLightingControl = 0
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
|
||||
namespace CUE.NET.Devices.Generic.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of device capabilities
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum CorsairDeviceCaps
|
||||
{
|
||||
/// <summary>
|
||||
/// For devices that do not support any SDK functions
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// For devices that has controlled lighting
|
||||
/// </summary>
|
||||
Lighting = 1
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace CUE.NET.Devices.Generic.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available device types.
|
||||
/// </summary>
|
||||
public enum CorsairDeviceType
|
||||
{
|
||||
Unknown = 0,
|
||||
Mouse = 1,
|
||||
Keyboard = 2,
|
||||
Headset = 3
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace CUE.NET.Devices.Generic.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Shared list of all errors which could happen during calling of Corsair* functions.
|
||||
/// </summary>
|
||||
public enum CorsairError
|
||||
{
|
||||
/// <summary>
|
||||
/// If previously called function completed successfully.
|
||||
/// </summary>
|
||||
Success,
|
||||
|
||||
/// <summary>
|
||||
/// CUE is not running or was shut down or third-party control is disabled in CUE settings. (runtime error)
|
||||
/// </summary>
|
||||
ServerNotFound,
|
||||
|
||||
/// <summary>
|
||||
/// If some other client has or took over exclusive control. (runtime error)
|
||||
/// </summary>
|
||||
NoControl,
|
||||
|
||||
/// <summary>
|
||||
/// If developer did not perform protocol handshake. (developer error)
|
||||
/// </summary>
|
||||
ProtocolHandshakeMissing,
|
||||
|
||||
/// <summary>
|
||||
/// If developer is calling the function that is not supported by the server (either because protocol has broken by server or client or because the function is new and server is too old.
|
||||
/// Check CorsairProtocolDetails for details). (developer error)
|
||||
/// </summary>
|
||||
IncompatibleProtocol,
|
||||
|
||||
/// <summary>
|
||||
/// If developer supplied invalid arguments to the function (for specifics look at function descriptions). (developer error)
|
||||
/// </summary>
|
||||
InvalidArguments
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using CUE.NET.Devices.Generic.Enums;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.Generic
|
||||
{
|
||||
public class GenericDeviceInfo : IDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// Device type.
|
||||
/// </summary>
|
||||
public CorsairDeviceType Type { get; }
|
||||
|
||||
//TODO DarthAffe 17.09.2015: This could be an Enum
|
||||
/// <summary>
|
||||
/// Device model (like “K95RGB”).
|
||||
/// </summary>
|
||||
public string Model { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Flags that describes device capabilities
|
||||
/// </summary>
|
||||
public CorsairDeviceCaps CapsMask { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Internal constructor of managed CorsairDeviceInfo.
|
||||
/// </summary>
|
||||
/// <param name="nativeInfo">The native CorsairDeviceInfo-struct</param>
|
||||
internal GenericDeviceInfo(_CorsairDeviceInfo nativeInfo)
|
||||
{
|
||||
this.Type = nativeInfo.type;
|
||||
this.Model = nativeInfo.model == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeInfo.model);
|
||||
this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using CUE.NET.Devices.Generic;
|
||||
|
||||
namespace CUE.NET.Devices.Headset
|
||||
{
|
||||
//TODO DarthAffe 18.09.2015: Implement
|
||||
public class CorsairHeadset : AbstractCueDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairHeadset(CorsairHeadsetDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.Headset
|
||||
{
|
||||
public class CorsairHeadsetDeviceInfo : GenericDeviceInfo
|
||||
{
|
||||
internal CorsairHeadsetDeviceInfo(_CorsairDeviceInfo nativeInfo)
|
||||
: base(nativeInfo)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CUE.NET.Devices.Headset.Enums
|
||||
{
|
||||
public enum CorsairHeadsetLedId
|
||||
{
|
||||
LeftLogo = 152,
|
||||
RightLogo = 153
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace CUE.NET.Devices
|
||||
{
|
||||
public interface ICueDevice
|
||||
{
|
||||
IDeviceInfo DeviceInfo { get; }
|
||||
|
||||
void UpdateLeds(bool fullUpdate = false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using CUE.NET.Devices.Generic.Enums;
|
||||
|
||||
namespace CUE.NET.Devices
|
||||
{
|
||||
public interface IDeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Device type
|
||||
/// </summary>
|
||||
CorsairDeviceType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Device model (like “K95RGB”).
|
||||
/// </summary>
|
||||
string Model { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Flags that describes device capabilities
|
||||
/// </summary>
|
||||
CorsairDeviceCaps CapsMask { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Devices.Keyboard.Enums;
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard
|
||||
{
|
||||
public class CorsairKey
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public CorsairKeyboardKeyId KeyId { get; }
|
||||
public CorsairLed Led { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairKey(CorsairKeyboardKeyId keyId, CorsairLed led)
|
||||
{
|
||||
this.KeyId = keyId;
|
||||
this.Led = led;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Devices.Keyboard.Enums;
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard
|
||||
{
|
||||
public class CorsairKeyboard : AbstractCueDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public CorsairKeyboardDeviceInfo KeyboardDeviceInfo { get; }
|
||||
|
||||
private Dictionary<CorsairKeyboardKeyId, CorsairKey> _keys = new Dictionary<CorsairKeyboardKeyId, CorsairKey>();
|
||||
public CorsairKey this[CorsairKeyboardKeyId keyId]
|
||||
{
|
||||
get { return this._keys[keyId]; }
|
||||
private set { throw new NotSupportedException(); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairKeyboard(CorsairKeyboardDeviceInfo info)
|
||||
: base(info)
|
||||
{
|
||||
this.KeyboardDeviceInfo = info;
|
||||
|
||||
this.InitializeKeys();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void InitializeKeys()
|
||||
{
|
||||
foreach (CorsairKeyboardKeyId keyId in Enum.GetValues(typeof(CorsairKeyboardKeyId)))
|
||||
this._keys.Add(keyId, new CorsairKey(keyId, this.GetLed((int)keyId)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Devices.Keyboard.Enums;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard.Enums
|
||||
{
|
||||
public enum CorsairKeyboardKeyId
|
||||
{
|
||||
Escape = 1,
|
||||
F1 = 2,
|
||||
F2 = 3,
|
||||
F3 = 4,
|
||||
F4 = 5,
|
||||
F5 = 6,
|
||||
F6 = 7,
|
||||
F7 = 8,
|
||||
F8 = 9,
|
||||
F9 = 10,
|
||||
F10 = 11,
|
||||
F11 = 12,
|
||||
GraveAccentAndTilde = 13,
|
||||
D1 = 14,
|
||||
D2 = 15,
|
||||
D3 = 16,
|
||||
D4 = 17,
|
||||
D5 = 18,
|
||||
D6 = 19,
|
||||
D7 = 20,
|
||||
D8 = 21,
|
||||
D9 = 22,
|
||||
D0 = 23,
|
||||
MinusAndUnderscore = 24,
|
||||
Tab = 25,
|
||||
Q = 26,
|
||||
W = 27,
|
||||
E = 28,
|
||||
R = 29,
|
||||
T = 30,
|
||||
Y = 31,
|
||||
U = 32,
|
||||
I = 33,
|
||||
O = 34,
|
||||
P = 35,
|
||||
BracketLeft = 36,
|
||||
CapsLock = 37,
|
||||
A = 38,
|
||||
S = 39,
|
||||
D = 40,
|
||||
F = 41,
|
||||
G = 42,
|
||||
H = 43,
|
||||
J = 44,
|
||||
K = 45,
|
||||
L = 46,
|
||||
SemicolonAndColon = 47,
|
||||
ApostropheAndDoubleQuote = 48,
|
||||
LeftShift = 49,
|
||||
NonUsBackslash = 50,
|
||||
Z = 51,
|
||||
X = 52,
|
||||
C = 53,
|
||||
V = 54,
|
||||
B = 55,
|
||||
N = 56,
|
||||
M = 57,
|
||||
CommaAndLessThan = 58,
|
||||
PeriodAndBiggerThan = 59,
|
||||
SlashAndQuestionMark = 60,
|
||||
LeftCtrl = 61,
|
||||
LeftGui = 62,
|
||||
LeftAlt = 63,
|
||||
Lang2 = 64,
|
||||
Space = 65,
|
||||
Lang1 = 66,
|
||||
International2 = 67,
|
||||
RightAlt = 68,
|
||||
RightGui = 69,
|
||||
Application = 70,
|
||||
LedProgramming = 71,
|
||||
Brightness = 72,
|
||||
F12 = 73,
|
||||
PrintScreen = 74,
|
||||
ScrollLock = 75,
|
||||
PauseBreak = 76,
|
||||
Insert = 77,
|
||||
Home = 78,
|
||||
PageUp = 79,
|
||||
BracketRight = 80,
|
||||
Backslash = 81,
|
||||
NonUsTilde = 82,
|
||||
Enter = 83,
|
||||
International1 = 84,
|
||||
EqualsAndPlus = 85,
|
||||
International3 = 86,
|
||||
Backspace = 87,
|
||||
Delete = 88,
|
||||
End = 89,
|
||||
PageDown = 90,
|
||||
RightShift = 91,
|
||||
RightCtrl = 92,
|
||||
UpArrow = 93,
|
||||
LeftArrow = 94,
|
||||
DownArrow = 95,
|
||||
RightArrow = 96,
|
||||
WinLock = 97,
|
||||
Mute = 98,
|
||||
Stop = 99,
|
||||
ScanPreviousTrack = 100,
|
||||
PlayPause = 101,
|
||||
ScanNextTrack = 102,
|
||||
NumLock = 103,
|
||||
KeypadSlash = 104,
|
||||
KeypadAsterisk = 105,
|
||||
KeypadMinus = 106,
|
||||
KeypadPlus = 107,
|
||||
KeypadEnter = 108,
|
||||
Keypad7 = 109,
|
||||
Keypad8 = 110,
|
||||
Keypad9 = 111,
|
||||
KeypadComma = 112,
|
||||
Keypad4 = 113,
|
||||
Keypad5 = 114,
|
||||
Keypad6 = 115,
|
||||
Keypad1 = 116,
|
||||
Keypad2 = 117,
|
||||
Keypad3 = 118,
|
||||
Keypad0 = 119,
|
||||
KeypadPeriodAndDelete = 120,
|
||||
G1 = 121,
|
||||
G2 = 122,
|
||||
G3 = 123,
|
||||
G4 = 124,
|
||||
G5 = 125,
|
||||
G6 = 126,
|
||||
G7 = 127,
|
||||
G8 = 128,
|
||||
G9 = 129,
|
||||
G10 = 130,
|
||||
VolumeUp = 131,
|
||||
VolumeDown = 132,
|
||||
MR = 133,
|
||||
M1 = 134,
|
||||
M2 = 135,
|
||||
M3 = 136,
|
||||
G11 = 137,
|
||||
G12 = 138,
|
||||
G13 = 139,
|
||||
G14 = 140,
|
||||
G15 = 141,
|
||||
G16 = 142,
|
||||
G17 = 143,
|
||||
G18 = 144,
|
||||
International5 = 145,
|
||||
International4 = 146,
|
||||
Fn = 147,
|
||||
CLK_Logo = 154
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available logical layouts for keyboards.
|
||||
/// </summary>
|
||||
public enum CorsairLogicalKeyboardLayout
|
||||
{
|
||||
US_Int = 1,
|
||||
NA = 2,
|
||||
EU = 3,
|
||||
UK = 4,
|
||||
BE = 5,
|
||||
BR = 6,
|
||||
CH = 7,
|
||||
CN = 8,
|
||||
DE = 9,
|
||||
ES = 10,
|
||||
FR = 11,
|
||||
IT = 12,
|
||||
ND = 13,
|
||||
RU = 14,
|
||||
JP = 15,
|
||||
KR = 16,
|
||||
TW = 17,
|
||||
MEX = 18
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available physical layouts for keyboards.
|
||||
/// </summary>
|
||||
public enum CorsairPhysicalKeyboardLayout
|
||||
{
|
||||
/// <summary>
|
||||
/// US-Keyboard
|
||||
/// </summary>
|
||||
US = 1,
|
||||
|
||||
/// <summary>
|
||||
/// UK-Keyboard
|
||||
/// </summary>
|
||||
UK = 2,
|
||||
|
||||
/// <summary>
|
||||
/// BR-Keyboard
|
||||
/// </summary>
|
||||
BR = 3,
|
||||
|
||||
/// <summary>
|
||||
/// JP-Keyboard
|
||||
/// </summary>
|
||||
JP = 4,
|
||||
|
||||
/// <summary>
|
||||
/// KR-Keyboard
|
||||
/// </summary>
|
||||
KR = 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using CUE.NET.Devices.Generic;
|
||||
|
||||
namespace CUE.NET.Devices.Mouse
|
||||
{
|
||||
//TODO DarthAffe 18.09.2015: Implement
|
||||
public class CorsairMouse : AbstractCueDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public CorsairMouseDeviceInfo MouseDeviceInfo { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairMouse(CorsairMouseDeviceInfo info)
|
||||
: base(info)
|
||||
{
|
||||
this.MouseDeviceInfo = info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Devices.Mouse.Enums;
|
||||
using CUE.NET.Native;
|
||||
|
||||
namespace CUE.NET.Devices.Mouse
|
||||
{
|
||||
public class CorsairMouseDeviceInfo : GenericDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// Physical layout of the mouse.
|
||||
/// </summary>
|
||||
public CorsairPhysicalMouseLayout PhysicalLayout { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Internal constructor of managed CorsairDeviceInfo.
|
||||
/// </summary>
|
||||
/// <param name="nativeInfo">The native CorsairDeviceInfo-struct</param>
|
||||
internal CorsairMouseDeviceInfo(_CorsairDeviceInfo nativeInfo)
|
||||
: base(nativeInfo)
|
||||
{
|
||||
this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CUE.NET.Devices.Mouse.Enums
|
||||
{
|
||||
public enum CorsairMouseLedId
|
||||
{
|
||||
B1 = 148,
|
||||
B2 = 149,
|
||||
B3 = 150,
|
||||
B4 = 151
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CUE.NET.Devices.Mouse.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available physical layouts for mice.
|
||||
/// </summary>
|
||||
public enum CorsairPhysicalMouseLayout
|
||||
{
|
||||
/// <summary>
|
||||
/// Zone1-Mouse
|
||||
/// </summary>
|
||||
Zones1 = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Zone2-Mouse
|
||||
/// </summary>
|
||||
Zones2 = 7,
|
||||
|
||||
/// <summary>
|
||||
/// Zone3-Mouse
|
||||
/// </summary>
|
||||
Zones3 = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Zone4-Mouse
|
||||
/// </summary>
|
||||
Zones4 = 9
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user