From 9acf8fc37f46a82a93247f7ca5b5e116869ed6e7 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Tue, 8 Sep 2020 21:47:39 +0100 Subject: [PATCH 1/2] Fixed Wooting One Mode key mapping --- .../Keyboard/WootingKeyboardLedMappings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardLedMappings.cs b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardLedMappings.cs index 2f032f6..dc9fa15 100644 --- a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardLedMappings.cs +++ b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardLedMappings.cs @@ -32,7 +32,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard { LedId.Keyboard_F12, (0,13) }, { LedId.Keyboard_PrintScreen, (0,14) }, { LedId.Keyboard_PauseBreak, (0,15) }, - { LedId.Keyboard_Custom1, (0,20) }, + { LedId.Keyboard_Custom1, (0,16) }, { LedId.Keyboard_GraveAccentAndTilde, (1,0) }, { LedId.Keyboard_1, (1,1) }, @@ -128,7 +128,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard { LedId.Keyboard_F12, (0,13) }, { LedId.Keyboard_PrintScreen, (0,14) }, { LedId.Keyboard_PauseBreak, (0,15) }, - { LedId.Keyboard_Custom1, (0,20) }, + { LedId.Keyboard_Custom1, (0,16) }, { LedId.Keyboard_GraveAccentAndTilde, (1,0) }, { LedId.Keyboard_1, (1,1) }, From 2e6ff339e0fa27f1cbb50247e33e9c30e514b9ad Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Thu, 10 Sep 2020 16:25:35 +0100 Subject: [PATCH 2/2] Updated wooting SDK functions to v1.2.0 https://github.com/WootingKb/wooting-rgb-sdk/releases/tag/v1.2.0 --- RGB.NET.Devices.Wooting/Native/_WootingSDK.cs | 8 +++++++- RGB.NET.Devices.Wooting/WootingDeviceProvider.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RGB.NET.Devices.Wooting/Native/_WootingSDK.cs b/RGB.NET.Devices.Wooting/Native/_WootingSDK.cs index a9dee8e..1bb7dd9 100644 --- a/RGB.NET.Devices.Wooting/Native/_WootingSDK.cs +++ b/RGB.NET.Devices.Wooting/Native/_WootingSDK.cs @@ -46,7 +46,8 @@ namespace RGB.NET.Devices.Wooting.Native _getDeviceInfoPointer = (GetDeviceInfoPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_device_info"), typeof(GetDeviceInfoPointer)); _keyboardConnectedPointer = (KeyboardConnectedPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_kbd_connected"), typeof(KeyboardConnectedPointer)); - _resetPointer = (ResetPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_reset"), typeof(ResetPointer)); + _resetPointer = (ResetPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_reset_rgb"), typeof(ResetPointer)); + _closePointer = (ClosePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_close"), typeof(ClosePointer)); _arrayUpdateKeyboardPointer = (ArrayUpdateKeyboardPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_array_update_keyboard"), typeof(ArrayUpdateKeyboardPointer)); _arraySetSinglePointer = (ArraySetSinglePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_array_set_single"), typeof(ArraySetSinglePointer)); } @@ -81,6 +82,7 @@ namespace RGB.NET.Devices.Wooting.Native private static GetDeviceInfoPointer _getDeviceInfoPointer; private static KeyboardConnectedPointer _keyboardConnectedPointer; private static ResetPointer _resetPointer; + private static ClosePointer _closePointer; private static ArrayUpdateKeyboardPointer _arrayUpdateKeyboardPointer; private static ArraySetSinglePointer _arraySetSinglePointer; @@ -97,6 +99,9 @@ namespace RGB.NET.Devices.Wooting.Native [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool ResetPointer(); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate bool ClosePointer(); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool ArrayUpdateKeyboardPointer(); @@ -108,6 +113,7 @@ namespace RGB.NET.Devices.Wooting.Native internal static IntPtr GetDeviceInfo() => _getDeviceInfoPointer(); internal static bool KeyboardConnected() => _keyboardConnectedPointer(); internal static bool Reset() => _resetPointer(); + internal static bool Close() => _closePointer(); internal static bool ArrayUpdateKeyboard() => _arrayUpdateKeyboardPointer(); internal static bool ArraySetSingle(byte row, byte column, byte red, byte green, byte blue) => _arraySetSinglePointer(row, column, red, green, blue); diff --git a/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs b/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs index 638949a..9b83452 100644 --- a/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs +++ b/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs @@ -146,7 +146,7 @@ namespace RGB.NET.Devices.Wooting try { UpdateTrigger?.Dispose(); } catch { /* at least we tried */ } - try { _WootingSDK.Reset(); } + try { _WootingSDK.Close(); } catch { /* Unlucky.. */ } try { _WootingSDK.UnloadWootingSDK(); }