mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
CoolerMaster - Added missing SDK-supported keyboards
CoolerMaster - Added mappings for every SDK-supported keyboard CoolerMaster - Fixed enabling/disabling the provider at runtime Core - Added Keyboard.Function LED ID
This commit is contained in:
parent
d14f272ba9
commit
8ff4c0b243
@ -95,6 +95,7 @@ namespace RGB.NET.Core
|
|||||||
Keyboard_International3 = 0x00000052,
|
Keyboard_International3 = 0x00000052,
|
||||||
Keyboard_International5 = 0x00000053,
|
Keyboard_International5 = 0x00000053,
|
||||||
Keyboard_International4 = 0x00000054,
|
Keyboard_International4 = 0x00000054,
|
||||||
|
Keyboard_Function = 0x00000055,
|
||||||
|
|
||||||
Keyboard_PrintScreen = 0x00001001,
|
Keyboard_PrintScreen = 0x00001001,
|
||||||
Keyboard_ScrollLock = 0x000001002,
|
Keyboard_ScrollLock = 0x000001002,
|
||||||
|
|||||||
@ -91,6 +91,15 @@ namespace RGB.NET.Devices.CoolerMaster
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
base.Dispose();
|
||||||
|
|
||||||
|
try { _CoolerMasterSDK.Reload(); }
|
||||||
|
catch { /* Unlucky.. */ }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,6 +81,22 @@ namespace RGB.NET.Devices.CoolerMaster
|
|||||||
[DeviceType(RGBDeviceType.Keyboard)]
|
[DeviceType(RGBDeviceType.Keyboard)]
|
||||||
MK850 = 16,
|
MK850 = 16,
|
||||||
|
|
||||||
|
[Description("SK630")]
|
||||||
|
[DeviceType(RGBDeviceType.Keyboard)]
|
||||||
|
SK630 = 17,
|
||||||
|
|
||||||
|
[Description("SK650")]
|
||||||
|
[DeviceType(RGBDeviceType.Keyboard)]
|
||||||
|
SK650 = 18,
|
||||||
|
|
||||||
|
[Description("SK621")]
|
||||||
|
[DeviceType(RGBDeviceType.Keyboard)]
|
||||||
|
SK621 = 19,
|
||||||
|
|
||||||
|
[Description("MK730")]
|
||||||
|
[DeviceType(RGBDeviceType.Keyboard)]
|
||||||
|
MK730 = 20,
|
||||||
|
|
||||||
[DeviceType(RGBDeviceType.None)]
|
[DeviceType(RGBDeviceType.None)]
|
||||||
Default = 0xFFFF
|
Default = 0xFFFF
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -22,8 +22,13 @@ namespace RGB.NET.Devices.CoolerMaster.Native
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static void Reload()
|
internal static void Reload()
|
||||||
{
|
{
|
||||||
UnloadCMSDK();
|
if (_dllHandle != IntPtr.Zero)
|
||||||
LoadCMSDK();
|
{
|
||||||
|
foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes)))
|
||||||
|
EnableLedControl(false, index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LoadCMSDK();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void LoadCMSDK()
|
private static void LoadCMSDK()
|
||||||
@ -47,15 +52,6 @@ namespace RGB.NET.Devices.CoolerMaster.Native
|
|||||||
_setAllLedColorPointer = (SetAllLedColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetAllLedColor"), typeof(SetAllLedColorPointer));
|
_setAllLedColorPointer = (SetAllLedColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetAllLedColor"), typeof(SetAllLedColorPointer));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void UnloadCMSDK()
|
|
||||||
{
|
|
||||||
if (_dllHandle == IntPtr.Zero) return;
|
|
||||||
|
|
||||||
// ReSharper disable once EmptyEmbeddedStatement - DarthAffe 20.02.2016: We might need to reduce the internal reference counter more than once to set the library free
|
|
||||||
while (FreeLibrary(_dllHandle)) ;
|
|
||||||
_dllHandle = IntPtr.Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("kernel32.dll")]
|
[DllImport("kernel32.dll")]
|
||||||
private static extern IntPtr LoadLibrary(string dllToLoad);
|
private static extern IntPtr LoadLibrary(string dllToLoad);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user