add support for Roccat Magma Mini

This commit is contained in:
Mola19 2023-12-23 01:37:35 +01:00 committed by Adam Honse
parent 9ff2b1f379
commit 6b4442ce39
4 changed files with 12 additions and 3 deletions

View file

@ -112,6 +112,7 @@ void RGBController_RoccatVulcanKeyboard::SetupZones()
keyboard_ptr = &RoccatVulcanTKLLayouts;
break;
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
keyboard_ptr = &RoccatMagmaLayouts;
break;
default:

View file

@ -23,6 +23,7 @@
#define ROCCAT_VULCAN_120_AIMO_PID 0x3098
#define ROCCAT_VULCAN_TKL_PID 0x2FEE
#define ROCCAT_MAGMA_PID 0x3124
#define ROCCAT_MAGMA_MINI_PID 0x69A0
#define ROCCAT_HORDE_AIMO_PID 0x303E
#define ROCCAT_BURST_CORE_PID 0x2DE6
#define ROCCAT_BURST_PRO_PID 0x2DE1
@ -75,8 +76,8 @@ void DetectRoccatVulcanKeyboardControllers(hid_device_info* info, const std::str
std::string dev_ctrl_path;
std::string dev_led_path;
int dev_led_page = (info->product_id == ROCCAT_MAGMA_PID) ? 0xFF00 : 0x0001;
int dev_ctrl_page = (info->product_id == ROCCAT_MAGMA_PID) ? 0xFF01 : 0x000B;
int dev_led_page = (info->product_id == ROCCAT_MAGMA_PID || info->product_id == ROCCAT_MAGMA_MINI_PID) ? 0xFF00 : 0x0001;
int dev_ctrl_page = (info->product_id == ROCCAT_MAGMA_PID || info->product_id == ROCCAT_MAGMA_MINI_PID) ? 0xFF01 : 0x000B;
while(info_temp)
{
@ -210,6 +211,7 @@ REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo 16K", DetectRoccatMouseCon
REGISTER_HID_DETECTOR_IP ("Roccat Vulcan 120-Series Aimo", DetectRoccatVulcanKeyboardControllers, ROCCAT_VID, ROCCAT_VULCAN_120_AIMO_PID, 1, 11);
REGISTER_HID_DETECTOR_IP ("Roccat Vulcan TKL", DetectRoccatVulcanKeyboardControllers, ROCCAT_VID, ROCCAT_VULCAN_TKL_PID, 1, 11);
REGISTER_HID_DETECTOR_IP ("Roccat Magma", DetectRoccatVulcanKeyboardControllers, ROCCAT_VID, ROCCAT_MAGMA_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IP ("Roccat Magma Mini", DetectRoccatVulcanKeyboardControllers, ROCCAT_VID, ROCCAT_MAGMA_MINI_PID, 1, 0xFF01);
REGISTER_HID_DETECTOR_IPU("Roccat Horde Aimo", DetectRoccatHordeAimoKeyboardControllers, ROCCAT_VID, ROCCAT_HORDE_AIMO_PID, 1, 0x0B, 0 );
REGISTER_HID_DETECTOR_IPU("Roccat Burst Core", DetectRoccatBurstCoreControllers, ROCCAT_VID, ROCCAT_BURST_CORE_PID, 3, 0xFF01, 1 );
REGISTER_HID_DETECTOR_IPU("Roccat Burst Pro", DetectRoccatBurstProControllers, ROCCAT_VID, ROCCAT_BURST_PRO_PID, 3, 0xFF01, 1 );

View file

@ -62,6 +62,7 @@ device_info RoccatVulcanKeyboardController::InitDeviceInfo()
switch(device_pid)
{
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
packet_length = 9;
report_id = 0x09;
break;
@ -81,7 +82,7 @@ device_info RoccatVulcanKeyboardController::InitDeviceInfo()
dev_info.version = version;
if(device_pid == ROCCAT_MAGMA_PID)
if(device_pid == ROCCAT_MAGMA_PID || device_pid == ROCCAT_MAGMA_MINI_PID)
{
/*---------------------------------------------------------*\
| This device doesn't need a layout, |
@ -112,6 +113,7 @@ void RoccatVulcanKeyboardController::EnableDirect(bool on_off_switch)
switch(device_pid)
{
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
buf = new uint8_t[5] { 0x0E, 0x05, on_off_switch, 0x00, 0x00 };
hid_send_feature_report(dev_ctrl, buf, 5);
break;
@ -131,6 +133,7 @@ void RoccatVulcanKeyboardController::SendColors(std::vector<led_color> colors)
switch(device_pid)
{
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
packet_length = 64;
column_length = 5;
break;
@ -204,6 +207,7 @@ void RoccatVulcanKeyboardController::SendMode(unsigned int mode, unsigned int sp
switch(device_pid)
{
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
protocol_version = 2;
packet_length = 26;
column_length = 5;
@ -288,6 +292,7 @@ void RoccatVulcanKeyboardController::WaitUntilReady()
switch(device_pid)
{
case ROCCAT_MAGMA_PID:
case ROCCAT_MAGMA_MINI_PID:
packet_length = 4;
break;
default:

View file

@ -20,6 +20,7 @@ enum
ROCCAT_VULCAN_120_AIMO_PID = 0x3098,
ROCCAT_VULCAN_TKL_PID = 0x2FEE,
ROCCAT_MAGMA_PID = 0x3124,
ROCCAT_MAGMA_MINI_PID = 0x69A0,
};
enum