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:
Robert committed 2021-03-06 22:55:10 +01:00
1 parent d14f272ba9
commit 8ff4c0b243
5 files changed
+2260 -15

No files matched your search

@@ -22,8 +22,13 @@ namespace RGB.NET.Devices.CoolerMaster.Native
/// </summary>
internal static void Reload()
{
UnloadCMSDK();
LoadCMSDK();
if (_dllHandle != IntPtr.Zero)
{
foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes)))
EnableLedControl(false, index);
}
else
LoadCMSDK();
}
private static void LoadCMSDK()
@@ -47,15 +52,6 @@ namespace RGB.NET.Devices.CoolerMaster.Native
_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")]
private static extern IntPtr LoadLibrary(string dllToLoad);