Skip to content

Commit 4b9fa42

Browse files
Mola19CalcProgrammer1
authored andcommitted
Add support for Roccat Vulcan 12X Aimo keyboards
Commit amended for code style by Adam Honse <[email protected]>
1 parent 61310c3 commit 4b9fa42

6 files changed

+411
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
/*-----------------------------------------*\
2+
| RGBController_RoccatVulcanAimo.cpp |
3+
| |
4+
| Generic RGB Interface for OpenRGB |
5+
| |
6+
| |
7+
| Mola19 17/12/2021 |
8+
\*-----------------------------------------*/
9+
10+
#include "RGBController_RoccatVulcanAimo.h"
11+
#include <vector>
12+
13+
#define NA 0xFFFFFFFF
14+
15+
static unsigned int matrix_map[6][22] =
16+
{ { 0, NA, 11, 17, 23, 28, NA, 48, 53, 59, 65, 78, 84, 85, 86, 99, 103, 108, NA, NA, NA, NA },
17+
{ 1, 6, 12, 18, 24, 29, 33, 49, 54, 60, 66, 72, 79, 87, NA, 100, 104, 109, 113, 119, 124, 129 },
18+
{ 2, NA, 7, 13, 19, 25, 30, 34, 50, 55, 61, 67, 73, 80, NA, 101, 105, 110, 114, 120, 125, 130 },
19+
{ 3, NA, 8, 14, 20, 26, 31, 35, 51, 56, 62, 68, 74, 96, 88, NA, NA, NA, 115, 121, 126, NA },
20+
{ 4, NA, 9, 15, 21, 27, 32, 36, 52, 57, 63, 69, 75, 82, NA, NA, 106, NA, 116, 122, 127, 131 },
21+
{ 5, 10, 16, NA, NA, NA, 37, NA, NA, NA, NA, 70, 76, 83, 89, 102, 107, 111, 117, NA, 128, NA } };
22+
23+
static const unsigned int zone_size = 132;
24+
25+
static const char *led_names[] =
26+
{
27+
"Key: Escape",
28+
"Key: ^",
29+
"Key: Tab",
30+
"Key: Caps Lock",
31+
"Key: Left Shift",
32+
"Key: Left Control",
33+
"Key: 1",
34+
"Key: Q",
35+
"Key: A",
36+
"Key: <",
37+
"Key: Left Windows",
38+
"Key: F1",
39+
"Key: 2",
40+
"Key: W",
41+
"Key: S",
42+
"Key: Y",
43+
"Key: Left Alt",
44+
"Key: F2",
45+
"Key: 3",
46+
"Key: E",
47+
"Key: D",
48+
"Key: X",
49+
"Unused",
50+
"Key: F3",
51+
"Key: 4",
52+
"Key: R",
53+
"Key: F",
54+
"Key: C",
55+
"Key: F4",
56+
"Key: 5",
57+
"Key: T",
58+
"Key: G",
59+
"Key: V",
60+
"Key: 6",
61+
"Key: Z",
62+
"Key: H",
63+
"Key: B",
64+
"Key: Space",
65+
"Unused",
66+
"Unused",
67+
"Unused",
68+
"Unused",
69+
"Unused",
70+
"Unused",
71+
"Unused",
72+
"Unused",
73+
"Unused",
74+
"Unused",
75+
"Key: F5",
76+
"Key: 7",
77+
"Key: U",
78+
"Key: J",
79+
"Key: N",
80+
"Key: F6",
81+
"Key: 8",
82+
"Key: I",
83+
"Key: K",
84+
"Key: M",
85+
"Unused",
86+
"Key: F7",
87+
"Key: 9",
88+
"Key: O",
89+
"Key: L",
90+
"Key: ,",
91+
"Unused",
92+
"Key: F8",
93+
"Key: 0",
94+
"Key: P",
95+
"Key: Ö",
96+
"Key: .",
97+
"Key: Right Alt",
98+
"Unused",
99+
"Key: ß",
100+
"Key: Ü",
101+
"Key: Ä",
102+
"Key: -",
103+
"Key: Right Fn",
104+
"Unused",
105+
"Key: F9",
106+
"Key: ´",
107+
"Key: +",
108+
"Unused",
109+
"Key: Right Shift",
110+
"Key: Menu",
111+
"Key: F10",
112+
"Key: F11",
113+
"Key: F12",
114+
"Key: Backspace",
115+
"Key: Enter",
116+
"Key: Right Control",
117+
"Unused",
118+
"Unused",
119+
"Unused",
120+
"Unused",
121+
"Unused",
122+
"Unused",
123+
"Key: #",
124+
"Unused",
125+
"Unused",
126+
"Key: Print Screen",
127+
"Key: Insert",
128+
"Key: Delete",
129+
"Key: Left Arrow",
130+
"Key: Scroll Lock",
131+
"Key: Home",
132+
"Key: End",
133+
"Key: Up Arrow",
134+
"Key: Down Arrow",
135+
"Key: Pause/Break",
136+
"Key: Page Up",
137+
"Key: Page Down",
138+
"Key: Right Arrow",
139+
"Unused",
140+
"Key: Num Lock",
141+
"Key: Number Pad 7",
142+
"Key: Number Pad 4",
143+
"Key: Number Pad 1",
144+
"Key: Number Pad 0",
145+
"Unused",
146+
"Key: Number Pad /",
147+
"Key: Number Pad 8",
148+
"Key: Number Pad 5",
149+
"Key: Number Pad 2",
150+
"Unused",
151+
"Key: Number Pad *",
152+
"Key: Number Pad 9",
153+
"Key: Number Pad 6",
154+
"Key: Number Pad 3",
155+
"Key: Number Pad ,",
156+
"Key: Number Pad -",
157+
"Key: Number Pad +",
158+
"Key: Number Pad Enter",
159+
};
160+
161+
RGBController_RoccatVulcanAimo::RGBController_RoccatVulcanAimo(RoccatVulcanAimoController* controller_ptr)
162+
{
163+
controller = controller_ptr;
164+
165+
name = "Roccat Vulcan 120 Aimo";
166+
vendor = "Roccat";
167+
type = DEVICE_TYPE_KEYBOARD;
168+
description = "Roccat Vulcan Aimo Keyboard";
169+
location = controller->GetLocation();
170+
serial = controller->GetSerial();
171+
172+
mode Direct;
173+
Direct.name = "Direct";
174+
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
175+
Direct.color_mode = MODE_COLORS_PER_LED;
176+
modes.push_back(Direct);
177+
178+
SetupZones();
179+
}
180+
181+
RGBController_RoccatVulcanAimo::~RGBController_RoccatVulcanAimo()
182+
{
183+
delete controller;
184+
}
185+
186+
void RGBController_RoccatVulcanAimo::SetupZones()
187+
{
188+
/*---------------------------------------------------------*\
189+
| Set up zones and leds per zone |
190+
\*---------------------------------------------------------*/
191+
zone new_zone;
192+
new_zone.name = "Keyboard";
193+
new_zone.type = ZONE_TYPE_MATRIX;
194+
new_zone.leds_min = zone_size;
195+
new_zone.leds_max = zone_size;
196+
new_zone.leds_count = zone_size;
197+
new_zone.matrix_map = new matrix_map_type;
198+
new_zone.matrix_map->height = 6;
199+
new_zone.matrix_map->width = 22;
200+
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
201+
zones.push_back(new_zone);
202+
203+
for(unsigned int led_idx = 0; led_idx < zone_size; led_idx++)
204+
{
205+
led new_led;
206+
new_led.name = led_names[led_idx];
207+
leds.push_back(new_led);
208+
}
209+
210+
SetupColors();
211+
}
212+
213+
void RGBController_RoccatVulcanAimo::ResizeZone(int /*zone*/, int /*new_size*/)
214+
{
215+
/*---------------------------------------------------------*\
216+
| This device does not support resizing zones |
217+
\*---------------------------------------------------------*/
218+
}
219+
220+
void RGBController_RoccatVulcanAimo::DeviceUpdateLEDs()
221+
{
222+
controller->SendColors(colors);
223+
}
224+
225+
void RGBController_RoccatVulcanAimo::UpdateZoneLEDs(int /*zone_idx*/)
226+
{
227+
DeviceUpdateLEDs();
228+
}
229+
230+
void RGBController_RoccatVulcanAimo::UpdateSingleLED(int /*led_idx*/)
231+
{
232+
DeviceUpdateLEDs();
233+
}
234+
235+
void RGBController_RoccatVulcanAimo::SetCustomMode()
236+
{
237+
active_mode = 0;
238+
}
239+
240+
void RGBController_RoccatVulcanAimo::DeviceUpdateMode()
241+
{
242+
/*---------------------------------------------------------*\
243+
| Changing modes is currently not implemented |
244+
\*---------------------------------------------------------*/
245+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*-----------------------------------------*\
2+
| RGBController_RoccatVulcanAimo.h |
3+
| |
4+
| Generic RGB Interface for Roccat Vulcan |
5+
| Aimo controller |
6+
| |
7+
| Mola19 17/12/2021 |
8+
\*-----------------------------------------*/
9+
10+
#pragma once
11+
#include "RGBController.h"
12+
#include "RoccatVulcanAimoController.h"
13+
14+
class RGBController_RoccatVulcanAimo : public RGBController
15+
{
16+
public:
17+
RGBController_RoccatVulcanAimo(RoccatVulcanAimoController* controller_ptr);
18+
~RGBController_RoccatVulcanAimo();
19+
20+
void SetupZones();
21+
22+
void ResizeZone(int zone, int new_size);
23+
24+
void DeviceUpdateLEDs();
25+
void UpdateZoneLEDs(int zone);
26+
void UpdateSingleLED(int led);
27+
28+
void SetCustomMode();
29+
void DeviceUpdateMode();
30+
31+
private:
32+
RoccatVulcanAimoController* controller;
33+
};

Controllers/RoccatController/RoccatControllerDetect.cpp

+23-6
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,40 @@
88

99
#include "Detector.h"
1010
#include "RoccatKoneAimoController.h"
11+
#include "RoccatVulcanAimoController.h"
1112
#include "RGBController.h"
1213
#include "RGBController_RoccatKoneAimo.h"
14+
#include "RGBController_RoccatVulcanAimo.h"
1315
#include <hidapi/hidapi.h>
1416

1517
#define ROCCAT_VID 0x1E7D
1618

17-
void DetectRoccatControllers(hid_device_info* info, const std::string& name)
19+
void DetectRoccatMouseControllers(hid_device_info* info, const std::string& name)
1820
{
1921
hid_device* dev = hid_open_path(info->path);
20-
if (dev)
22+
23+
if(dev)
2124
{
22-
RoccatKoneAimoController * controller = new RoccatKoneAimoController(dev, info->path);
25+
RoccatKoneAimoController * controller = new RoccatKoneAimoController(dev, info->path);
2326
RGBController_RoccatKoneAimo * rgb_controller = new RGBController_RoccatKoneAimo(controller);
2427
rgb_controller->name = name;
2528
ResourceManager::get()->RegisterRGBController(rgb_controller);
2629
}
27-
} /* DetectRoccatControllers() */
30+
}
31+
32+
void DetectRoccatKeyboardControllers(hid_device_info* info, const std::string& name)
33+
{
34+
hid_device* dev = hid_open_path(info->path);
35+
36+
if(dev)
37+
{
38+
RoccatVulcanAimoController * controller = new RoccatVulcanAimoController(dev, info->path);
39+
RGBController_RoccatVulcanAimo * rgb_controller = new RGBController_RoccatVulcanAimo(controller);
40+
rgb_controller->name = name;
41+
ResourceManager::get()->RegisterRGBController(rgb_controller);
42+
}
43+
}
2844

29-
REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo 16K", DetectRoccatControllers, ROCCAT_VID, 0x2E2C, 0, 0x0B, 0);
30-
REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo", DetectRoccatControllers, ROCCAT_VID, 0x2E27, 0, 0x0B, 0);
45+
REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo 16K", DetectRoccatMouseControllers, ROCCAT_VID, 0x2E2C, 0, 0x0B, 0);
46+
REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo", DetectRoccatMouseControllers, ROCCAT_VID, 0x2E27, 0, 0x0B, 0);
47+
REGISTER_HID_DETECTOR_IP ("Roccat Vulcan 120 Aimo", DetectRoccatKeyboardControllers, ROCCAT_VID, 0x3098, 3, 1);

0 commit comments

Comments
 (0)