diff --git a/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp b/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp index e537321a..02102a46 100644 --- a/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp +++ b/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp @@ -13,160 +13,14 @@ #define NA 0xFFFFFFFF -static unsigned int matrix_map[6][22] = - { { 0, NA, 11, 17, 23, 28, NA, 48, 53, 59, 65, 78, 84, 85, 86, 99, 103, 108, NA, NA, NA, NA }, - { 1, 6, 12, 18, 24, 29, 33, 49, 54, 60, 66, 72, 79, 87, NA, 100, 104, 109, 113, 119, 124, 129 }, - { 2, NA, 7, 13, 19, 25, 30, 34, 50, 55, 61, 67, 73, 80, NA, 101, 105, 110, 114, 120, 125, 130 }, - { 3, NA, 8, 14, 20, 26, 31, 35, 51, 56, 62, 68, 74, 96, 88, NA, NA, NA, 115, 121, 126, NA }, - { 4, NA, 9, 15, 21, 27, 32, 36, 52, 57, 63, 69, 75, 82, NA, NA, 106, NA, 116, 122, 127, 131 }, - { 5, 10, 16, NA, NA, NA, 37, NA, NA, NA, NA, 70, 76, 83, 89, 102, 107, 111, 117, NA, 128, NA } }; - -static const unsigned int zone_size = 132; - -static const char *led_names[] = -{ - KEY_EN_ESCAPE, - "Key: ^", - KEY_EN_TAB, - KEY_EN_CAPS_LOCK, - KEY_EN_LEFT_SHIFT, - KEY_EN_LEFT_CONTROL, - KEY_EN_1, - KEY_EN_Q, - KEY_EN_A, - "Key: <", - KEY_EN_LEFT_WINDOWS, - KEY_EN_F1, - KEY_EN_2, - KEY_EN_W, - KEY_EN_S, - KEY_EN_Y, - KEY_EN_LEFT_ALT, - KEY_EN_F2, - KEY_EN_3, - KEY_EN_E, - KEY_EN_D, - KEY_EN_X, - KEY_EN_UNUSED, - KEY_EN_F3, - KEY_EN_4, - KEY_EN_R, - KEY_EN_F, - KEY_EN_C, - KEY_EN_F4, - KEY_EN_5, - KEY_EN_T, - KEY_EN_G, - KEY_EN_V, - KEY_EN_6, - KEY_EN_Z, - KEY_EN_H, - KEY_EN_B, - KEY_EN_SPACE, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_F5, - KEY_EN_7, - KEY_EN_U, - KEY_EN_J, - KEY_EN_N, - KEY_EN_F6, - KEY_EN_8, - KEY_EN_I, - KEY_EN_K, - KEY_EN_M, - KEY_EN_UNUSED, - KEY_EN_F7, - KEY_EN_9, - KEY_EN_O, - KEY_EN_L, - KEY_EN_COMMA, - KEY_EN_UNUSED, - KEY_EN_F8, - KEY_EN_0, - KEY_EN_P, - "Key: Ö", - KEY_EN_PERIOD, - KEY_EN_RIGHT_ALT, - KEY_EN_UNUSED, - "Key: ß", - "Key: Ü", - "Key: Ä", - KEY_EN_MINUS, - KEY_EN_RIGHT_FUNCTION, - KEY_EN_UNUSED, - KEY_EN_F9, - "Key: ´", - "Key: +", - KEY_EN_UNUSED, - KEY_EN_RIGHT_SHIFT, - KEY_EN_MENU, - KEY_EN_F10, - KEY_EN_F11, - KEY_EN_F12, - KEY_EN_BACKSPACE, - KEY_EN_ANSI_ENTER, - KEY_EN_RIGHT_CONTROL, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_POUND, - KEY_EN_UNUSED, - KEY_EN_UNUSED, - KEY_EN_PRINT_SCREEN, - KEY_EN_INSERT, - KEY_EN_DELETE, - KEY_EN_LEFT_ARROW, - KEY_EN_SCROLL_LOCK, - KEY_EN_HOME, - KEY_EN_END, - KEY_EN_UP_ARROW, - KEY_EN_DOWN_ARROW, - KEY_EN_PAUSE_BREAK, - KEY_EN_PAGE_UP, - KEY_EN_PAGE_DOWN, - KEY_EN_RIGHT_ARROW, - KEY_EN_UNUSED, - KEY_EN_NUMPAD_LOCK, - KEY_EN_NUMPAD_7, - KEY_EN_NUMPAD_4, - KEY_EN_NUMPAD_1, - KEY_EN_NUMPAD_0, - KEY_EN_UNUSED, - KEY_EN_NUMPAD_DIVIDE, - KEY_EN_NUMPAD_8, - KEY_EN_NUMPAD_5, - KEY_EN_NUMPAD_2, - KEY_EN_UNUSED, - KEY_EN_NUMPAD_TIMES, - KEY_EN_NUMPAD_9, - KEY_EN_NUMPAD_6, - KEY_EN_NUMPAD_3, - "Key: Number Pad ,", - KEY_EN_NUMPAD_MINUS, - KEY_EN_NUMPAD_PLUS, - KEY_EN_NUMPAD_ENTER, -}; - /**------------------------------------------------------------------*\ @name Roccat Vulcan Aimo @category Keyboard @type USB - @save :x: + @save :robot: @direct :white_check_mark: - @effects :x: - @detectors DetectRoccatKeyboardControllers + @effects :white_check_mark: + @detectors DetectRoccatVulcanAimoControllers @comment \*-------------------------------------------------------------------*/ @@ -174,11 +28,13 @@ RGBController_RoccatVulcanAimo::RGBController_RoccatVulcanAimo(RoccatVulcanAimoC { controller = controller_ptr; - name = "Roccat Vulcan 120 Aimo"; + controller->InitDeviceInfo(); + + name = "Roccat Vulcan 120-Series Aimo"; vendor = "Roccat"; type = DEVICE_TYPE_KEYBOARD; description = "Roccat Vulcan Aimo Keyboard"; - version = controller->GetVersion(); + version = controller->GetDeviceInfo().version; location = controller->GetLocation(); serial = controller->GetSerial(); @@ -222,29 +78,42 @@ RGBController_RoccatVulcanAimo::~RGBController_RoccatVulcanAimo() void RGBController_RoccatVulcanAimo::SetupZones() { - /*---------------------------------------------------------*\ - | Set up zones and leds per zone | - \*---------------------------------------------------------*/ - zone new_zone; - new_zone.name = ZONE_EN_KEYBOARD; - new_zone.type = ZONE_TYPE_MATRIX; - new_zone.leds_min = zone_size; - new_zone.leds_max = zone_size; - new_zone.leds_count = zone_size; - new_zone.matrix_map = new matrix_map_type; - new_zone.matrix_map->height = 6; - new_zone.matrix_map->width = 22; - new_zone.matrix_map->map = (unsigned int *)&matrix_map; - zones.push_back(new_zone); + unsigned char layout = controller->GetDeviceInfo().layout_variant; - for(unsigned int led_idx = 0; led_idx < zone_size; led_idx++) + if(RoccatVulcanLayouts.find(layout) == RoccatVulcanLayouts.end()) + { + /*---------------------------------------------------------*\ + | If Layout not found, take uk or us | + \*---------------------------------------------------------*/ + layout = controller->GetDeviceInfo().layout_type == 1 ? ROCCAT_VULCAN_LAYOUT_UK : ROCCAT_VULCAN_LAYOUT_US; + } + + zone keyboard_zone; + keyboard_zone.name = "Keyboard"; + keyboard_zone.type = ZONE_TYPE_MATRIX; + keyboard_zone.leds_min = RoccatVulcanLayouts[layout].size; + keyboard_zone.leds_max = RoccatVulcanLayouts[layout].size; + keyboard_zone.leds_count = RoccatVulcanLayouts[layout].size; + keyboard_zone.matrix_map = new matrix_map_type; + keyboard_zone.matrix_map->height = RoccatVulcanLayouts[layout].rows; + keyboard_zone.matrix_map->width = RoccatVulcanLayouts[layout].cols; + keyboard_zone.matrix_map->map = RoccatVulcanLayouts[layout].matrix_map; + zones.push_back(keyboard_zone); + + for(unsigned int led_id = 0; led_id < RoccatVulcanLayouts[layout].size; led_id++) { led new_led; - new_led.name = led_names[led_idx]; + new_led.name = RoccatVulcanLayouts[layout].led_names[led_id].name; + new_led.value = RoccatVulcanLayouts[layout].led_names[led_id].id; leds.push_back(new_led); } SetupColors(); + + /*---------------------------------------------------------*\ + | sends the init packet for the default mode (direct) | + \*---------------------------------------------------------*/ + DeviceUpdateMode(); } void RGBController_RoccatVulcanAimo::ResizeZone(int /*zone*/, int /*new_size*/) @@ -258,7 +127,14 @@ void RGBController_RoccatVulcanAimo::DeviceUpdateLEDs() { if (modes[active_mode].value == ROCCAT_VULCAN_MODE_DIRECT) { - controller->SendColors(colors); + std::vector led_color_list = {}; + + for(int i = 0; i < colors.size(); i++) + { + led_color_list.push_back({ leds[i].value, colors[i] }); + } + + controller->SendColors(led_color_list); } else { @@ -278,5 +154,15 @@ void RGBController_RoccatVulcanAimo::UpdateSingleLED(int /*led_idx*/) void RGBController_RoccatVulcanAimo::DeviceUpdateMode() { - controller->SendMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, colors); + std::vector led_color_list = {}; + + if(modes[active_mode].value == ROCCAT_VULCAN_MODE_STATIC) + { + for(int i = 0; i < colors.size(); i++) + { + led_color_list.push_back({ leds[i].value, colors[i] }); + } + } + + controller->SendMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, led_color_list); } diff --git a/Controllers/RoccatController/RoccatControllerDetect.cpp b/Controllers/RoccatController/RoccatControllerDetect.cpp index a137a79c..c9fa6a8d 100644 --- a/Controllers/RoccatController/RoccatControllerDetect.cpp +++ b/Controllers/RoccatController/RoccatControllerDetect.cpp @@ -40,24 +40,24 @@ void DetectRoccatMouseControllers(hid_device_info* info, const std::string& name } } -/*---------------------------------------------------------------------------*\ -| Tracks the paths used in DetectRoccatKeyboardControllers so multiple Roccat | -| devices can be detected without all controlling the same device. | -\*---------------------------------------------------------------------------*/ +/*-----------------------------------------------------------------------------*\ +| Tracks the paths used in DetectRoccatVulcanAimoControllers so multiple Roccat | +| devices can be detected without all controlling the same device. | +\*-----------------------------------------------------------------------------*/ static std::unordered_set used_paths; /*--------------------------------------------------------------------------------*\ | Removes all entries in used_paths so device discovery does not skip any of them. | \*--------------------------------------------------------------------------------*/ -void ResetRoccatKeyboardControllersPaths() +void ResetRoccatVulcanAimoControllersPaths() { used_paths.clear(); } -void DetectRoccatKeyboardControllers(hid_device_info* info, const std::string& name) +void DetectRoccatVulcanAimoControllers(hid_device_info* info, const std::string& name) { /*-------------------------------------------------------------------------------------------------*\ - | Create a local copy of the HID enumerations for the Roccat Keyboard VID/PID and iterate | + | Create a local copy of the HID enumerations for the Roccat Vulcan Aimo VID/PID and iterate | | through it. This prevents detection from failing if interface 1 comes before interface 0 in the | | main info list. | \*-------------------------------------------------------------------------------------------------*/ @@ -73,10 +73,10 @@ void DetectRoccatKeyboardControllers(hid_device_info* info, const std::string& n while(info_temp) { - /*---------------------------------------------------------------------------------*\ - | Check for paths used on an already registered Roccat Keyboard controller to avoid | - | registering multiple controllers that refer to the same physical hardware. | - \*---------------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------------------*\ + | Check for paths used on an already registered Roccat Vulcan Aimo controller to avoid | + | registering multiple controllers that refer to the same physical hardware. | + \*------------------------------------------------------------------------------------*/ if(info_temp->vendor_id == info->vendor_id && info_temp->product_id == info->product_id && used_paths.find(info_temp->path) == used_paths.end() ) @@ -157,10 +157,11 @@ void DetectRoccatBurstProControllers(hid_device_info* info, const std::string& n } } +REGISTER_PRE_DETECTION_HOOK(ResetRoccatVulcanAimoControllersPaths); + REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo", DetectRoccatMouseControllers, ROCCAT_VID, ROCCAT_KONE_AIMO_PID, 0, 0x0B, 0 ); REGISTER_HID_DETECTOR_IPU("Roccat Kone Aimo 16K", DetectRoccatMouseControllers, ROCCAT_VID, ROCCAT_KONE_AIMO_16K_PID, 0, 0x0B, 0 ); -REGISTER_HID_DETECTOR_IP ("Roccat Vulcan 120 Aimo", DetectRoccatKeyboardControllers, ROCCAT_VID, ROCCAT_VULCAN_120_AIMO_PID, 1, 11); -REGISTER_DYNAMIC_DETECTOR("Roccat Vulcan 120 Aimo Setup", ResetRoccatKeyboardControllersPaths); +REGISTER_HID_DETECTOR_IP ("Roccat Vulcan 120-Series Aimo", DetectRoccatVulcanAimoControllers, ROCCAT_VID, ROCCAT_VULCAN_120_AIMO_PID, 1, 11); 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); diff --git a/Controllers/RoccatController/RoccatVulcanAimoController.cpp b/Controllers/RoccatController/RoccatVulcanAimoController.cpp index 01403f36..4716643e 100644 --- a/Controllers/RoccatController/RoccatVulcanAimoController.cpp +++ b/Controllers/RoccatController/RoccatVulcanAimoController.cpp @@ -47,36 +47,56 @@ std::string RoccatVulcanAimoController::GetLocation() return("HID: " + location); } -std::string RoccatVulcanAimoController::GetVersion() + +device_info RoccatVulcanAimoController::InitDeviceInfo() { - unsigned char usb_buf[8] = { 0x0f }; + unsigned char usb_buf[8] = { 0x0F }; hid_get_feature_report(dev_ctrl, usb_buf, 8); - return std::to_string((int) floor(usb_buf[2] / 100)) + "." + std::to_string(usb_buf[2] % 100); + dev_info.version = std::to_string((int) floor(usb_buf[2] / 100)) + "." + std::to_string(usb_buf[2] % 100); + + dev_info.layout_type = usb_buf[6]; + dev_info.layout_variant = usb_buf[7]; + + return dev_info; } -void RoccatVulcanAimoController::SendColors(std::vector colors) +device_info RoccatVulcanAimoController::GetDeviceInfo() +{ + return dev_info; +} + + +void RoccatVulcanAimoController::SendColors(std::vector colors) { unsigned char bufs[7][65]; + for(int p = 0; p < 7; p++) + { + memset(bufs[p], 0x00, 65); + } + bufs[0][1] = 0xA1; bufs[0][2] = 0x01; bufs[0][3] = 0x01; bufs[0][4] = 0xB4; - for(int z = 0; z < 11; z++) + for(int i = 0; i < colors.size(); i++) { - for(int l = 0; l < 12; l++) - { - int placeR = (z * 36) + 4 + l + 0; - bufs[placeR / 64][placeR % 64 + 1] = RGBGetRValue(colors[z * 12 + l]); + int coloumn = floor(colors[i].value / 12); + int row = colors[i].value % 12; - int placeG = (z * 36) + 4 + l + 12; - bufs[placeG / 64][placeG % 64 + 1] = RGBGetGValue(colors[z * 12 + l]); + int offset = coloumn * 36 + row + 4; - int placeB = (z * 36) + 4 + l + 24; - bufs[placeB / 64][placeB % 64 + 1] = RGBGetBValue(colors[z * 12 + l]); - } + bufs[offset / 64][offset % 64 + 1] = RGBGetRValue(colors[i].color); + + offset += 12; + + bufs[offset / 64][offset % 64 + 1] = RGBGetGValue(colors[i].color); + + offset += 12; + + bufs[offset / 64][offset % 64 + 1] = RGBGetBValue(colors[i].color); } for(int p = 0; p < 7; p++) @@ -85,7 +105,7 @@ void RoccatVulcanAimoController::SendColors(std::vector colors) } } -void RoccatVulcanAimoController::SendMode(unsigned int mode, unsigned int speed, unsigned int brightness, std::vector colors) +void RoccatVulcanAimoController::SendMode(unsigned int mode, unsigned int speed, unsigned int brightness, std::vector colors) { if(speed == 0) speed = 1; if(brightness == 0) brightness = 1; @@ -94,8 +114,8 @@ void RoccatVulcanAimoController::SendMode(unsigned int mode, unsigned int speed, memset(buf, 0x00, 443); - buf[0] = 0x0d; - buf[1] = 0xbb; + buf[0] = 0x0D; + buf[1] = 0xBB; buf[2] = 0x01; buf[3] = 0x00; buf[4] = mode; @@ -106,26 +126,30 @@ void RoccatVulcanAimoController::SendMode(unsigned int mode, unsigned int speed, if(mode == ROCCAT_VULCAN_MODE_STATIC) { - for(int z = 0; z < 11; z++) + + for(int i = 0; i < colors.size(); i++) { - for(int l = 0; l < 12; l++) - { - int placeR = (z * 36) + 8 + l + 0; - buf[placeR + 1] = RGBGetRValue(colors[z * 12 + l]); + int coloumn = floor(colors[i].value / 12); + int row = colors[i].value % 12; - int placeG = (z * 36) + 8 + l + 12; - buf[placeG + 1] = RGBGetGValue(colors[z * 12 + l]); + int offset = coloumn * 36 + row + 9; - int placeB = (z * 36) + 8 + l + 24; - buf[placeB + 1] = RGBGetBValue(colors[z * 12 + l]); - } + buf[offset] = RGBGetRValue(colors[i].color); + + offset += 12; + + buf[offset] = RGBGetGValue(colors[i].color); + + offset += 12; + + buf[offset] = RGBGetBValue(colors[i].color); } } unsigned short total = 0; for(int i = 0; i < 441; i++) total += buf[i]; - buf[441] = total & 0xff; + buf[441] = total & 0xFF; buf[442] = total >> 8; hid_send_feature_report(dev_ctrl, buf, 443); diff --git a/Controllers/RoccatController/RoccatVulcanAimoController.h b/Controllers/RoccatController/RoccatVulcanAimoController.h index cfc810d9..964b63c8 100644 --- a/Controllers/RoccatController/RoccatVulcanAimoController.h +++ b/Controllers/RoccatController/RoccatVulcanAimoController.h @@ -10,6 +10,7 @@ #pragma once #include "RGBController.h" +#include "RoccatVulcanAimoLayouts.h" #include #include @@ -21,6 +22,19 @@ enum ROCCAT_VULCAN_MODE_WAVE = 0x0A, }; +struct device_info +{ + std::string version; + int layout_type; + int layout_variant; +}; + +struct led_color +{ + unsigned int value; + RGBColor color; +}; + class RoccatVulcanAimoController { public: @@ -29,13 +43,15 @@ public: std::string GetSerial(); std::string GetLocation(); - std::string GetVersion(); + device_info InitDeviceInfo(); + device_info GetDeviceInfo(); - void SendColors(std::vector colors); - void SendMode(unsigned int mode, unsigned int speed, unsigned int brightness, std::vector colors); + void SendColors(std::vector colors); + void SendMode(unsigned int mode, unsigned int speed, unsigned int brightness, std::vector colors); private: std::string location; hid_device* dev_ctrl; hid_device* dev_led; + device_info dev_info; }; diff --git a/Controllers/RoccatController/RoccatVulcanAimoLayouts.h b/Controllers/RoccatController/RoccatVulcanAimoLayouts.h new file mode 100644 index 00000000..5f9deb92 --- /dev/null +++ b/Controllers/RoccatController/RoccatVulcanAimoLayouts.h @@ -0,0 +1,335 @@ +/*-----------------------------------------*\ +| RoccatVulcanAimoLayouts.h | +| | +| Keyboard Layouts for Roccat Vulcan Aimo | +| USB RGB lighting controller | +| | +| Mola19 09/29/2022 | +\*-----------------------------------------*/ + +#include "RGBControllerKeyNames.h" +#include +#include +#include "RGBController.h" + +#pragma once + +enum +{ + ROCCAT_VULCAN_LAYOUT_US = 6, + ROCCAT_VULCAN_LAYOUT_DE = 7, + ROCCAT_VULCAN_LAYOUT_UK = 0xFF, // this is a placeholder, since the id isn't known +}; + +#define NA 0xFFFFFFFF + +struct led_value +{ + const char* name; + unsigned char id; +}; + +struct layout_info +{ + unsigned int* matrix_map; + int size; + int rows; + int cols; + std::vector led_names; +}; + +static unsigned int ROCCAT_VULCAN_LAYOUT_KEYS_104[6][24] = { + { 0, NA, 8, 14, 19, 24, NA, 34, 39, 44, 49, 55, 61, 66, 70, NA, 74, 78, 83, NA, NA, NA, NA, NA }, + { 1, 6, 9, 15, 20, 25, 29, 35, 40, 45, 50, 56, 62, 67, NA, NA, 75, 79, 84, NA, 87, 92, 96, 101 }, + { 2, NA, 10, 16, 21, 26, 30, 36, 41, 46, 51, 57, 63, 68, 71, NA, 76, 80, 85, NA, 88, 93, 97, 102 }, + { 3, NA, 11, 17, 22, 27, 31, 37, 42, 47, 52, 58, 64, NA, 72, NA, NA, NA, NA, NA, 89, 94, 98, NA }, + { 4, NA, 12, 18, 23, 28, 32, 38, 43, 48, 53, 59, NA, 69, NA, NA, NA, 81, NA, NA, 90, 95, 99, 103 }, + { 5, 7, 13, NA, NA, NA, 33, NA, NA, NA, 54, 60, 65, NA, 73, NA, 77, 82, 86, NA, 91, NA, 100, NA } +}; + + +static unsigned int ROCCAT_VULCAN_LAYOUT_KEYS_105[6][24] = { + { 0, NA, 9, 15, 20, 25, NA, 35, 40, 45, 50, 56, 62, 67, 72, NA, 75, 79, 84, NA, NA, NA, NA, NA }, + { 1, 6, 10, 16, 21, 26, 30, 36, 41, 46, 51, 57, 63, 68, NA, NA, 76, 80, 85, NA, 88, 93, 97, 102 }, + { 2, NA, 11, 17, 22, 27, 31, 37, 42, 47, 52, 58, 64, 69, NA, NA, 77, 81, 86, NA, 89, 94, 98, 103 }, + { 3, NA, 12, 18, 23, 28, 32, 38, 43, 48, 53, 59, 65, 70, 73, NA, NA, NA, NA, NA, 90, 95, 99, NA }, + { 4, 7, 13, 19, 24, 29, 33, 39, 44, 49, 54, 60, NA, 71, NA, NA, NA, 82, NA, NA, 91, 96, 100, 104 }, + { 5, 8, 14, NA, NA, NA, 34, NA, NA, NA, 55, 61, 66, NA, 74, NA, 78, 83, 87, NA, 92, NA, 101, NA } +}; + +static std::map RoccatVulcanLayouts = +{ + { + ROCCAT_VULCAN_LAYOUT_UK, + { + *ROCCAT_VULCAN_LAYOUT_KEYS_105, + 105, + 6, + 24, + { + { KEY_EN_ESCAPE, 0x00 }, + { KEY_EN_BACK_TICK, 0x01 }, + { KEY_EN_TAB, 0x02 }, + { KEY_EN_CAPS_LOCK, 0x03 }, + { KEY_EN_LEFT_SHIFT, 0x04 }, + { KEY_EN_LEFT_CONTROL, 0x05 }, + + { KEY_EN_1, 0x06 }, + { KEY_EN_ISO_BACK_SLASH, 0x09 }, + { KEY_EN_LEFT_WINDOWS, 0x0A }, + + { KEY_EN_F1, 0x0B }, + { KEY_EN_2, 0x0C }, + { KEY_EN_Q, 0x07 }, + { KEY_EN_A, 0x08 }, + { KEY_EN_Z, 0x0F }, + { KEY_EN_LEFT_ALT, 0x10 }, + + { KEY_EN_F2, 0x11 }, + { KEY_EN_3, 0x12 }, + { KEY_EN_W, 0x0D }, + { KEY_EN_S, 0x0E }, + { KEY_EN_X, 0x15 }, + + { KEY_EN_F3, 0x17 }, + { KEY_EN_4, 0x18 }, + { KEY_EN_E, 0x13 }, + { KEY_EN_D, 0x14 }, + { KEY_EN_C, 0x1B }, + + { KEY_EN_F4, 0x1C }, + { KEY_EN_5, 0x1D }, + { KEY_EN_R, 0x19 }, + { KEY_EN_F, 0x1A }, + { KEY_EN_V, 0x20 }, + + { KEY_EN_6, 0x21 }, + { KEY_EN_T, 0x1E }, + { KEY_EN_G, 0x1F }, + { KEY_EN_B, 0x24 }, + { KEY_EN_SPACE, 0x25 }, + + { KEY_EN_F5, 0x30 }, + { KEY_EN_7, 0x31 }, + { KEY_EN_Y, 0x22 }, + { KEY_EN_H, 0x23 }, + { KEY_EN_N, 0x34 }, + + { KEY_EN_F6, 0x35 }, + { KEY_EN_8, 0x36 }, + { KEY_EN_U, 0x32 }, + { KEY_EN_J, 0x33 }, + { KEY_EN_M, 0x39 }, + + { KEY_EN_F7, 0x3B }, + { KEY_EN_9, 0x3C }, + { KEY_EN_I, 0x37 }, + { KEY_EN_K, 0x38 }, + { KEY_EN_COMMA, 0x3F }, + + { KEY_EN_F8, 0x41 }, + { KEY_EN_0, 0x42 }, + { KEY_EN_O, 0x3D }, + { KEY_EN_L, 0x3E }, + { KEY_EN_PERIOD, 0x45 }, + { KEY_EN_RIGHT_ALT, 0x46 }, + + { KEY_EN_F9, 0x4E }, + { KEY_EN_MINUS, 0x48 }, + { KEY_EN_P, 0x43 }, + { KEY_EN_SEMICOLON, 0x44 }, + { KEY_EN_FORWARD_SLASH, 0x4B }, + { KEY_EN_RIGHT_FUNCTION, 0x4C }, + + { KEY_EN_F10, 0x54 }, + { KEY_EN_EQUALS, 0x4F }, + { KEY_EN_LEFT_BRACKET, 0x49 }, + { KEY_EN_QUOTE, 0x4A }, + { KEY_EN_MENU, 0x53 }, + + { KEY_EN_F11, 0x55 }, + { KEY_EN_BACKSPACE, 0x57 }, + { KEY_EN_RIGHT_BRACKET, 0x50 }, + { KEY_EN_POUND, 0x60 }, + { KEY_EN_RIGHT_SHIFT, 0x52 }, + + { KEY_EN_F12, 0x56 }, + { KEY_EN_ISO_ENTER, 0x58 }, + { KEY_EN_RIGHT_CONTROL, 0x59 }, + + { KEY_EN_PRINT_SCREEN, 0x63 }, + { KEY_EN_INSERT, 0x64 }, + { KEY_EN_DELETE, 0x65 }, + { KEY_EN_LEFT_ARROW, 0x66 }, + + { KEY_EN_SCROLL_LOCK, 0x67 }, + { KEY_EN_HOME, 0x68 }, + { KEY_EN_END, 0x69 }, + { KEY_EN_UP_ARROW, 0x6A }, + { KEY_EN_DOWN_ARROW, 0x6B }, + + { KEY_EN_PAUSE_BREAK, 0x6C }, + { KEY_EN_PAGE_UP, 0x6D }, + { KEY_EN_PAGE_DOWN, 0x6E }, + { KEY_EN_RIGHT_ARROW, 0x6F }, + + { KEY_EN_NUMPAD_LOCK, 0x71 }, + { KEY_EN_NUMPAD_7, 0x72 }, + { KEY_EN_NUMPAD_4, 0x73 }, + { KEY_EN_NUMPAD_1, 0x74 }, + { KEY_EN_NUMPAD_0, 0x75 }, + + { KEY_EN_NUMPAD_DIVIDE, 0x77 }, + { KEY_EN_NUMPAD_8, 0x78 }, + { KEY_EN_NUMPAD_5, 0x79 }, + { KEY_EN_NUMPAD_2, 0x7A }, + + { KEY_EN_NUMPAD_TIMES, 0x7C }, + { KEY_EN_NUMPAD_9, 0x7D }, + { KEY_EN_NUMPAD_6, 0x7E }, + { KEY_EN_NUMPAD_3, 0x7F }, + + { KEY_EN_NUMPAD_PERIOD, 0x80 }, + { KEY_EN_NUMPAD_MINUS, 0x81 }, + { KEY_EN_NUMPAD_PLUS, 0x82 }, + { KEY_EN_NUMPAD_ENTER, 0x83 } + } + } + }, + { + ROCCAT_VULCAN_LAYOUT_US, + { + *ROCCAT_VULCAN_LAYOUT_KEYS_104, + 104, + 6, + 24, + { + { KEY_EN_ESCAPE, 0x00 }, + { KEY_EN_BACK_TICK, 0x01 }, + { KEY_EN_TAB, 0x02 }, + { KEY_EN_CAPS_LOCK, 0x03 }, + { KEY_EN_LEFT_SHIFT, 0x04 }, + { KEY_EN_LEFT_CONTROL, 0x05 }, + + { KEY_EN_1, 0x06 }, + { KEY_EN_LEFT_WINDOWS, 0x0A }, + + { KEY_EN_F1, 0x0B }, + { KEY_EN_2, 0x0C }, + { KEY_EN_Q, 0x07 }, + { KEY_EN_A, 0x08 }, + { KEY_EN_Z, 0x0F }, + { KEY_EN_LEFT_ALT, 0x10 }, + + { KEY_EN_F2, 0x11 }, + { KEY_EN_3, 0x12 }, + { KEY_EN_W, 0x0D }, + { KEY_EN_S, 0x0E }, + { KEY_EN_X, 0x15 }, + + { KEY_EN_F3, 0x17 }, + { KEY_EN_4, 0x18 }, + { KEY_EN_E, 0x13 }, + { KEY_EN_D, 0x14 }, + { KEY_EN_C, 0x1B }, + + { KEY_EN_F4, 0x1C }, + { KEY_EN_5, 0x1D }, + { KEY_EN_R, 0x19 }, + { KEY_EN_F, 0x1A }, + { KEY_EN_V, 0x20 }, + + { KEY_EN_6, 0x21 }, + { KEY_EN_T, 0x1E }, + { KEY_EN_G, 0x1F }, + { KEY_EN_B, 0x24 }, + { KEY_EN_SPACE, 0x25 }, + + { KEY_EN_F5, 0x30 }, + { KEY_EN_7, 0x31 }, + { KEY_EN_Y, 0x22 }, + { KEY_EN_H, 0x23 }, + { KEY_EN_N, 0x34 }, + + { KEY_EN_F6, 0x35 }, + { KEY_EN_8, 0x36 }, + { KEY_EN_U, 0x32 }, + { KEY_EN_J, 0x33 }, + { KEY_EN_M, 0x39 }, + + { KEY_EN_F7, 0x3B }, + { KEY_EN_9, 0x3C }, + { KEY_EN_I, 0x37 }, + { KEY_EN_K, 0x38 }, + { KEY_EN_COMMA, 0x3F }, + + { KEY_EN_F8, 0x41 }, + { KEY_EN_0, 0x42 }, + { KEY_EN_O, 0x3D }, + { KEY_EN_L, 0x3E }, + { KEY_EN_PERIOD, 0x45 }, + { KEY_EN_RIGHT_ALT, 0x46 }, + + { KEY_EN_F9, 0x4E }, + { KEY_EN_MINUS, 0x48 }, + { KEY_EN_P, 0x43 }, + { KEY_EN_SEMICOLON, 0x44 }, + { KEY_EN_FORWARD_SLASH, 0x4B }, + { KEY_EN_RIGHT_FUNCTION, 0x4C }, + + { KEY_EN_F10, 0x54 }, + { KEY_EN_EQUALS, 0x4F }, + { KEY_EN_LEFT_BRACKET, 0x49 }, + { KEY_EN_QUOTE, 0x4A }, + { KEY_EN_MENU, 0x53 }, + + { KEY_EN_F11, 0x55 }, + { KEY_EN_BACKSPACE, 0x57 }, + { KEY_EN_RIGHT_BRACKET, 0x50 }, + { KEY_EN_RIGHT_SHIFT, 0x52 }, + + { KEY_EN_F12, 0x56 }, + { KEY_EN_ANSI_BACK_SLASH, 0x57 }, + { KEY_EN_ANSI_ENTER, 0x58 }, + { KEY_EN_RIGHT_CONTROL, 0x59 }, + + { KEY_EN_PRINT_SCREEN, 0x63 }, + { KEY_EN_INSERT, 0x64 }, + { KEY_EN_DELETE, 0x65 }, + { KEY_EN_LEFT_ARROW, 0x66 }, + + { KEY_EN_SCROLL_LOCK, 0x67 }, + { KEY_EN_HOME, 0x68 }, + { KEY_EN_END, 0x69 }, + { KEY_EN_UP_ARROW, 0x6A }, + { KEY_EN_DOWN_ARROW, 0x6B }, + + { KEY_EN_PAUSE_BREAK, 0x6C }, + { KEY_EN_PAGE_UP, 0x6D }, + { KEY_EN_PAGE_DOWN, 0x6E }, + { KEY_EN_RIGHT_ARROW, 0x6F }, + + { KEY_EN_NUMPAD_LOCK, 0x71 }, + { KEY_EN_NUMPAD_7, 0x72 }, + { KEY_EN_NUMPAD_4, 0x73 }, + { KEY_EN_NUMPAD_1, 0x74 }, + { KEY_EN_NUMPAD_0, 0x75 }, + + { KEY_EN_NUMPAD_DIVIDE, 0x77 }, + { KEY_EN_NUMPAD_8, 0x78 }, + { KEY_EN_NUMPAD_5, 0x79 }, + { KEY_EN_NUMPAD_2, 0x7A }, + + { KEY_EN_NUMPAD_TIMES, 0x7C }, + { KEY_EN_NUMPAD_9, 0x7D }, + { KEY_EN_NUMPAD_6, 0x7E }, + { KEY_EN_NUMPAD_3, 0x7F }, + + { KEY_EN_NUMPAD_PERIOD, 0x80 }, + { KEY_EN_NUMPAD_MINUS, 0x81 }, + { KEY_EN_NUMPAD_PLUS, 0x82 }, + { KEY_EN_NUMPAD_ENTER, 0x83 } + } + } + }, +}; diff --git a/OpenRGB.pro b/OpenRGB.pro index 480d682d..02afe505 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -561,6 +561,7 @@ HEADERS += Controllers/RoccatController/RoccatHordeAimoController.h \ Controllers/RoccatController/RoccatKoneAimoController.h \ Controllers/RoccatController/RoccatVulcanAimoController.h \ + Controllers/RoccatController/RoccatVulcanAimoLayouts.h \ Controllers/SapphireGPUController/SapphireNitroGlowV1Controller.h \ Controllers/SapphireGPUController/SapphireNitroGlowV3Controller.h \ Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV1.h \