Skip to content

Commit ba186cf

Browse files
Add new controller for Razer Kraken V4 and Razer Kraken Kitty V3 Pro
1 parent 692ca00 commit ba186cf

7 files changed

Lines changed: 775 additions & 0 deletions

File tree

Controllers/RazerController/RazerControllerDetect.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
#include "Detector.h"
1515
#include "RazerController.h"
1616
#include "RazerKrakenController.h"
17+
#include "RazerKrakenV4Controller.h"
1718
#include "RazerHanboController.h"
1819
#include "RazerDevices.h"
1920
#include "ResourceManager.h"
2021
#include "RGBController_Razer.h"
2122
#include "RGBController_RazerAddressable.h"
2223
#include "RGBController_RazerKraken.h"
24+
#include "RGBController_RazerKrakenV4.h"
2325
#include "RGBController_RazerHanbo.h"
2426

2527
/******************************************************************************************\
@@ -153,6 +155,27 @@ void DetectRazerKrakenControllers(hid_device_info* info, const std::string& name
153155
}
154156
} /* DetectRazerKrakenControllers() */
155157

158+
/******************************************************************************************\
159+
* *
160+
* DetectRazerKrakenV4Controllers *
161+
* *
162+
* Tests the USB address to see if a Razer Kraken V4 controller exists there. *
163+
* *
164+
\******************************************************************************************/
165+
166+
void DetectRazerKrakenV4Controllers(hid_device_info* info, const std::string& name)
167+
{
168+
hid_device* dev = hid_open_path(info->path);
169+
170+
if(dev)
171+
{
172+
RazerKrakenV4Controller* controller = new RazerKrakenV4Controller(dev, info->path, info->product_id, name);
173+
174+
RGBController_RazerKrakenV4* rgb_controller = new RGBController_RazerKrakenV4(controller);
175+
ResourceManager::get()->RegisterRGBController(rgb_controller);
176+
}
177+
} /* DetectRazerKrakenV4Controllers() */
178+
156179
/******************************************************************************************\
157180
* *
158181
* DetectRazerHanboController *
@@ -342,6 +365,10 @@ REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Edition", Det
342365
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Black Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_BLACK_EDITION_PID, 0x01, 0x01, 0x03);
343366
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Black Edition V2", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_KITTY_BLACK_EDITION_V2_PID, 0x03, 0x0C, 0x01);
344367
REGISTER_HID_DETECTOR_IPU("Razer Kraken Ultimate", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_ULTIMATE_PID, 0x03, 0x0C, 0x01);
368+
REGISTER_HID_DETECTOR_IPU("Razer Kraken V4 (Wired)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_V4_WIRED_PID, 0x05, 0xFF14, 0x01);
369+
REGISTER_HID_DETECTOR_IPU("Razer Kraken V4 (Wireless)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_V4_WIRELESS_PID, 0x05, 0xFF14, 0x01);
370+
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty V3 Pro (Wired)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_KITTY_V3_PRO_WIRED_PID, 0x05, 0xFF14, 0x01);
371+
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty V3 Pro (Wireless)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_KITTY_V3_PRO_WIRELESS_PID, 0x05, 0xFF14, 0x01);
345372
REGISTER_HID_DETECTOR_I( "Razer Tiamat 7.1 V2", DetectRazerControllers, RAZER_VID, RAZER_TIAMAT_71_V2_PID, 0x00 );
346373

347374
/*-----------------------------------------------------------------------------------------------------*\

Controllers/RazerController/RazerDevices.cpp

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7701,6 +7701,170 @@ static const razer_device kraken_kitty_black_v2_device =
77017701
NULL
77027702
};
77037703

7704+
/*-------------------------------------------------------------*\
7705+
| Razer Kraken V4 Wired 1532:056B |
7706+
| |
7707+
| Zone "Headset" |
7708+
| Matrix |
7709+
| 9 LED |
7710+
\*-------------------------------------------------------------*/
7711+
static const razer_zone kraken_v4_wired_zone =
7712+
{
7713+
"Headset",
7714+
ZONE_TYPE_LINEAR,
7715+
1,
7716+
9
7717+
};
7718+
7719+
static const razer_device kraken_v4_wired_device =
7720+
{
7721+
"Razer Kraken V4 (Wired)",
7722+
RAZER_KRAKEN_V4_WIRED_PID,
7723+
DEVICE_TYPE_HEADSET,
7724+
RAZER_MATRIX_TYPE_EXTENDED,
7725+
0x60,
7726+
1,
7727+
9,
7728+
{
7729+
&kraken_v4_wired_zone,
7730+
NULL,
7731+
NULL,
7732+
NULL,
7733+
NULL,
7734+
NULL
7735+
},
7736+
NULL
7737+
};
7738+
7739+
/*-------------------------------------------------------------*\
7740+
| Razer Kraken V4 Wireless 1532:056C |
7741+
| |
7742+
| Zone "Headset" |
7743+
| Matrix |
7744+
| 9 LED |
7745+
\*-------------------------------------------------------------*/
7746+
static const razer_zone kraken_v4_wireless_zone =
7747+
{
7748+
"Headset",
7749+
ZONE_TYPE_LINEAR,
7750+
1,
7751+
9
7752+
};
7753+
7754+
static const razer_device kraken_v4_wireless_device =
7755+
{
7756+
"Razer Kraken V4 (Wireless)",
7757+
RAZER_KRAKEN_V4_WIRELESS_PID,
7758+
DEVICE_TYPE_HEADSET,
7759+
RAZER_MATRIX_TYPE_EXTENDED,
7760+
0x60,
7761+
1,
7762+
9,
7763+
{
7764+
&kraken_v4_wireless_zone,
7765+
NULL,
7766+
NULL,
7767+
NULL,
7768+
NULL,
7769+
NULL
7770+
},
7771+
NULL
7772+
};
7773+
7774+
/*-------------------------------------------------------------*\
7775+
| Razer Kraken Kitty V3 Pro Wired 1532:0587 |
7776+
| |
7777+
| Zone "Headset" |
7778+
| Linear |
7779+
| 9 LED |
7780+
| |
7781+
| Zone "Ears" |
7782+
| Single |
7783+
| 1 LED |
7784+
\*-------------------------------------------------------------*/
7785+
static const razer_zone kraken_kitty_v3_pro_wired_headset_zone =
7786+
{
7787+
"Headset",
7788+
ZONE_TYPE_LINEAR,
7789+
1,
7790+
9
7791+
};
7792+
7793+
static const razer_zone kraken_kitty_v3_pro_wired_ears_zone =
7794+
{
7795+
"Ears",
7796+
ZONE_TYPE_SINGLE,
7797+
1,
7798+
1
7799+
};
7800+
7801+
static const razer_device kraken_kitty_v3_pro_wired_device =
7802+
{
7803+
"Razer Kraken Kitty V3 Pro (Wired)",
7804+
RAZER_KRAKEN_KITTY_V3_PRO_WIRED_PID,
7805+
DEVICE_TYPE_HEADSET,
7806+
RAZER_MATRIX_TYPE_EXTENDED,
7807+
0x60,
7808+
1,
7809+
10,
7810+
{
7811+
&kraken_kitty_v3_pro_wired_headset_zone,
7812+
&kraken_kitty_v3_pro_wired_ears_zone,
7813+
NULL,
7814+
NULL,
7815+
NULL,
7816+
NULL
7817+
},
7818+
NULL
7819+
};
7820+
7821+
/*-------------------------------------------------------------*\
7822+
| Razer Kraken Kitty V3 Pro Wireless 1532:0588 |
7823+
| |
7824+
| Zone "Headset" |
7825+
| Linear |
7826+
| 9 LED |
7827+
| |
7828+
| Zone "Ears" |
7829+
| Single |
7830+
| 1 LED |
7831+
\*-------------------------------------------------------------*/
7832+
static const razer_zone kraken_kitty_v3_pro_wireless_headset_zone =
7833+
{
7834+
"Headset",
7835+
ZONE_TYPE_LINEAR,
7836+
1,
7837+
9
7838+
};
7839+
7840+
static const razer_zone kraken_kitty_v3_pro_wireless_ears_zone =
7841+
{
7842+
"Ears",
7843+
ZONE_TYPE_SINGLE,
7844+
1,
7845+
1
7846+
};
7847+
7848+
static const razer_device kraken_kitty_v3_pro_wireless_device =
7849+
{
7850+
"Razer Kraken Kitty V3 Pro (Wireless)",
7851+
RAZER_KRAKEN_KITTY_V3_PRO_WIRELESS_PID,
7852+
DEVICE_TYPE_HEADSET,
7853+
RAZER_MATRIX_TYPE_EXTENDED,
7854+
0x60,
7855+
1,
7856+
10,
7857+
{
7858+
&kraken_kitty_v3_pro_wireless_headset_zone,
7859+
&kraken_kitty_v3_pro_wireless_ears_zone,
7860+
NULL,
7861+
NULL,
7862+
NULL,
7863+
NULL
7864+
},
7865+
NULL
7866+
};
7867+
77047868
/*-------------------------------------------------------------*\
77057869
| Razer Tiamat 7.1 V2 |
77067870
| |
@@ -8877,6 +9041,10 @@ const razer_device* razer_device_list[] =
88779041
&kraken_ultimate_device,
88789042
&kraken_kitty_device,
88799043
&kraken_kitty_black_v2_device,
9044+
&kraken_v4_wired_device,
9045+
&kraken_v4_wireless_device,
9046+
&kraken_kitty_v3_pro_wired_device,
9047+
&kraken_kitty_v3_pro_wireless_device,
88809048
&tiamat_71_v2_device,
88819049
/*-----------------------------------------------------------------*\
88829050
| OTHER |

Controllers/RazerController/RazerDevices.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@
224224
#define RAZER_KRAKEN_ULTIMATE_PID 0x0527
225225
#define RAZER_KRAKEN_V2_PID 0x0510
226226
#define RAZER_KRAKEN_KITTY_BLACK_EDITION_V2_PID 0x0560
227+
#define RAZER_KRAKEN_V4_WIRED_PID 0x056B
228+
#define RAZER_KRAKEN_V4_WIRELESS_PID 0x056C
229+
#define RAZER_KRAKEN_KITTY_V3_PRO_WIRED_PID 0x0587
230+
#define RAZER_KRAKEN_KITTY_V3_PRO_WIRELESS_PID 0x0588
227231
#define RAZER_TIAMAT_71_V2_PID 0x0F03
228232

229233
/*-----------------------------------------------------*\
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*---------------------------------------------------------*\
2+
| RGBController_RazerKrakenV4.cpp |
3+
| |
4+
| RGBController for Razer 64-byte devices |
5+
| |
6+
| Adam Honse (CalcProgrammer1) 21 Oct 2025 |
7+
| |
8+
| This file is part of the OpenRGB project |
9+
| SPDX-License-Identifier: GPL-2.0-or-later |
10+
\*---------------------------------------------------------*/
11+
12+
#include "RGBController_RazerKrakenV4.h"
13+
#include "RazerDevices.h"
14+
15+
RGBController_RazerKrakenV4::RGBController_RazerKrakenV4(RazerKrakenV4Controller* controller_ptr)
16+
{
17+
controller = controller_ptr;
18+
19+
name = controller->GetName();
20+
vendor = "Razer";
21+
type = controller->GetDeviceType();
22+
description = "Razer Device";
23+
location = controller->GetDeviceLocation();
24+
version = controller->GetFirmwareString();
25+
serial = controller->GetSerialString();
26+
uint8_t max_brightness = controller->GetMaxBrightness();
27+
28+
mode Direct;
29+
Direct.name = "Direct";
30+
Direct.value = RAZER_KRAKEN_V4_MODE_DIRECT;
31+
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
32+
Direct.color_mode = MODE_COLORS_PER_LED;
33+
modes.push_back(Direct);
34+
35+
mode Wave;
36+
Wave.name = "Wave";
37+
Wave.value = RAZER_KRAKEN_V4_MODE_WAVE;
38+
Wave.flags = MODE_FLAG_HAS_BRIGHTNESS;
39+
Wave.direction = MODE_DIRECTION_RIGHT;
40+
Wave.color_mode = MODE_COLORS_NONE;
41+
Wave.brightness_min = 0;
42+
Wave.brightness_max = max_brightness;
43+
Wave.brightness = max_brightness;
44+
modes.push_back(Wave);
45+
46+
SetupZones();
47+
}
48+
49+
RGBController_RazerKrakenV4::~RGBController_RazerKrakenV4()
50+
{
51+
delete controller;
52+
}
53+
54+
void RGBController_RazerKrakenV4::SetupZones()
55+
{
56+
unsigned int device_index = controller->GetDeviceIndex();
57+
58+
/*-----------------------------------------------------*\
59+
| Fill in zone information based on device table |
60+
| Kraken V4 devices are assumed to only have one row |
61+
\*-----------------------------------------------------*/
62+
for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
63+
{
64+
if(device_list[device_index]->zones[zone_id] != NULL)
65+
{
66+
zone new_zone;
67+
68+
new_zone.name = device_list[device_index]->zones[zone_id]->name;
69+
new_zone.type = device_list[device_index]->zones[zone_id]->type;
70+
71+
new_zone.leds_count = device_list[device_index]->zones[zone_id]->cols;
72+
new_zone.leds_min = new_zone.leds_count;
73+
new_zone.leds_max = new_zone.leds_count;
74+
new_zone.matrix_map = NULL;
75+
76+
zones.push_back(new_zone);
77+
78+
for(unsigned int col_id = 0; col_id < device_list[device_index]->zones[zone_id]->cols; col_id++)
79+
{
80+
led* new_led = new led();
81+
82+
new_led->name = device_list[device_index]->zones[zone_id]->name;
83+
84+
if(zones[zone_id].leds_count > 1)
85+
{
86+
new_led->name.append(" LED ");
87+
new_led->name.append(std::to_string(col_id + 1));
88+
}
89+
90+
leds.push_back(*new_led);
91+
}
92+
}
93+
}
94+
95+
SetupColors();
96+
}
97+
98+
void RGBController_RazerKrakenV4::ResizeZone(int /*zone*/, int /*new_size*/)
99+
{
100+
101+
}
102+
103+
void RGBController_RazerKrakenV4::DeviceUpdateLEDs()
104+
{
105+
if(modes[active_mode].value == RAZER_KRAKEN_V4_MODE_DIRECT)
106+
{
107+
controller->SetDirect(&colors[0]);
108+
}
109+
}
110+
111+
void RGBController_RazerKrakenV4::UpdateZoneLEDs(int /*zone*/)
112+
{
113+
DeviceUpdateLEDs();
114+
}
115+
116+
void RGBController_RazerKrakenV4::UpdateSingleLED(int /*led*/)
117+
{
118+
DeviceUpdateLEDs();
119+
}
120+
121+
void RGBController_RazerKrakenV4::DeviceUpdateMode()
122+
{
123+
switch(modes[active_mode].value)
124+
{
125+
case RAZER_KRAKEN_V4_MODE_WAVE:
126+
controller->SetModeWave();
127+
controller->SetBrightness(modes[active_mode].brightness);
128+
break;
129+
}
130+
}

0 commit comments

Comments
 (0)