Skip to content

Commit 298d80e

Browse files
diogotr7CalcProgrammer1
authored andcommitted
Add support for Wooting devices with firmware v2.12 and above
1 parent b6ad5e9 commit 298d80e

11 files changed

Lines changed: 955 additions & 482 deletions

Controllers/WootingKeyboardController/RGBController_WootingKeyboard.cpp

Lines changed: 652 additions & 296 deletions
Large diffs are not rendered by default.

Controllers/WootingKeyboardController/RGBController_WootingKeyboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| |
44
| RGBController for Wooting keyboard |
55
| |
6-
| Diogo Trindade (diogotr7) 04 Mar 2021 |
6+
| Diogo Trindade (diogotr7) 25 Dec 2025 |
77
| |
88
| This file is part of the OpenRGB project |
99
| SPDX-License-Identifier: GPL-2.0-or-later |

Controllers/WootingKeyboardController/WootingKeyboardController.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,20 @@ std::string WootingKeyboardController::GetSerial()
5656
return(StringUtils::wstring_to_string(serial_string));
5757
}
5858

59-
uint8_t WootingKeyboardController::GetWootingType()
59+
WOOTING_DEVICE_TYPE WootingKeyboardController::GetWootingType()
6060
{
6161
return wooting_type;
6262
}
6363

64-
bool WootingKeyboardController::wooting_usb_send_feature(uint8_t commandId, uint8_t parameter0, uint8_t parameter1, uint8_t parameter2, uint8_t parameter3)
64+
void WootingKeyboardController::SendInitialize()
6565
{
66-
/*---------------------------------------------------------*\
67-
| Prevent sending unnecessary data to the Wootings if the |
68-
| index exceedes it's capabilities |
69-
\*---------------------------------------------------------*/
70-
if ((commandId == WOOTING_SINGLE_COLOR_COMMAND && parameter0 > key_code_limit)
71-
|| (commandId == WOOTING_SINGLE_RESET_COMMAND && parameter3 > key_code_limit))
72-
{
73-
/*-----------------------------------------------------*\
74-
| This is not a USB error so let's return true. |
75-
| wooting_rgb_direct_set_key would also behave |
76-
| differently otherwise. |
77-
\*-----------------------------------------------------*/
78-
return true;
79-
}
66+
wooting_usb_send_feature(WOOTING_COLOR_INIT_COMMAND, 0,0,0,0);
8067

68+
std::this_thread::sleep_for(std::chrono::milliseconds(50));
69+
}
70+
71+
bool WootingKeyboardController::wooting_usb_send_feature(uint8_t commandId, uint8_t parameter0, uint8_t parameter1, uint8_t parameter2, uint8_t parameter3)
72+
{
8173
uint8_t feature_buffer[WOOTING_COMMAND_SIZE] = { 0, 0xD0, 0xDA };
8274

8375
/*---------------------------------------------------------*\

Controllers/WootingKeyboardController/WootingKeyboardController.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Driver for Wooting keyboard |
55
| |
66
| Chris M (Dr_No) 09 Jul 2021 |
7+
| Diogo Trindade (diogotr7) 25 Dec 2025 |
78
| |
89
| This file is part of the OpenRGB project |
910
| SPDX-License-Identifier: GPL-2.0-or-later |
@@ -17,20 +18,20 @@
1718
#include "LogManager.h"
1819

1920
#define WOOTING_COMMAND_SIZE 8
20-
#define WOOTING_REPORT_SIZE 129
2121
#define WOOTING_RAW_COLORS_REPORT 11
2222
#define WOOTING_SINGLE_COLOR_COMMAND 30
2323
#define WOOTING_SINGLE_RESET_COMMAND 31
2424
#define WOOTING_RESET_ALL_COMMAND 32
2525
#define WOOTING_COLOR_INIT_COMMAND 33
26-
#define WOOTING_ONE_KEY_CODE_LIMIT 95
27-
#define WOOTING_TWO_KEY_CODE_LIMIT 116
28-
#define RGB_RAW_BUFFER_SIZE 96
26+
2927

3028
#define WOOTING_RGB_ROWS 6
3129
#define WOOTING_RGB_COLUMNS 21
30+
3231
#define WOOTING_ONE_RGB_COLUMNS 17
3332
#define WOOTING_TWO_RGB_COLUMNS 21
33+
#define WOOTING_60_RGB_COLUMNS 14
34+
#define WOOTING_3PAD_RGB_COLUMNS 7
3435

3536
/*---------------------------------------------------------*\
3637
| Placeholder for compilation. Redefined by each subclass |
@@ -41,7 +42,9 @@ enum WOOTING_DEVICE_TYPE
4142
{
4243
WOOTING_KB_TKL = 0,
4344
WOOTING_KB_FULL = 1,
44-
WOOTING_80HE = 2
45+
WOOTING_KB_60PER = 2,
46+
WOOTING_KB_3PAD = 3,
47+
WOOTING_KB_80PER = 4,
4548
};
4649

4750
enum RGB_PARTS
@@ -64,21 +67,17 @@ class WootingKeyboardController
6467
std::string vendor;
6568
std::string description;
6669
std::string location;
67-
uint8_t wooting_type;
68-
uint8_t key_code_limit;
70+
WOOTING_DEVICE_TYPE wooting_type;
6971

7072
std::string GetName();
7173
std::string GetVendor();
7274
std::string GetDescription();
7375
std::string GetLocation();
7476
std::string GetSerial();
75-
uint8_t GetWootingType();
77+
WOOTING_DEVICE_TYPE GetWootingType();
7678
bool wooting_usb_send_feature(uint8_t command, uint8_t param0,
7779
uint8_t param1, uint8_t param2, uint8_t param3);
7880

7981
virtual void SendDirect(RGBColor* colors, uint8_t color_count) = 0;
80-
81-
private:
82-
virtual void SendInitialize() = 0;
83-
virtual bool wooting_usb_send_buffer(RGB_PARTS part_number, uint8_t* rgb_buffer) = 0;
82+
virtual void SendInitialize();
8483
};

0 commit comments

Comments
 (0)