diff --git a/Controllers/RazerController/RGBController_Razer.cpp b/Controllers/RazerController/RGBController_Razer.cpp new file mode 100644 index 00000000..8c629c4a --- /dev/null +++ b/Controllers/RazerController/RGBController_Razer.cpp @@ -0,0 +1,226 @@ +#include "RGBController_Razer.h" +#include "RazerDevices.h" + +RGBController_Razer::RGBController_Razer(RazerController* controller_ptr) +{ + controller = controller_ptr; + + name = controller->GetName(); + vendor = "Razer"; + type = controller->GetDeviceType(); + description = "Razer Device"; + location = controller->GetDeviceLocation(); + version = controller->GetFirmwareString(); + serial = controller->GetSerialString(); + + mode Direct; + Direct.name = "Direct"; + Direct.value = RAZER_MODE_DIRECT; + Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR; + Direct.color_mode = MODE_COLORS_PER_LED; + modes.push_back(Direct); + + mode Off; + Off.name = "Off"; + Off.value = RAZER_MODE_OFF; + Off.flags = 0; + Off.color_mode = MODE_COLORS_NONE; + modes.push_back(Off); + + mode Static; + Static.name = "Static"; + Static.value = RAZER_MODE_STATIC; + Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR; + Static.color_mode = MODE_COLORS_MODE_SPECIFIC; + Static.colors_min = 1; + Static.colors_max = 1; + Static.colors.resize(1); + modes.push_back(Static); + + // Breathing disabled, not yet implemented + //mode Breathing; + //Breathing.name = "Breathing"; + //Breathing.value = RAZER_MODE_BREATHING; + //Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR; + //Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC; + //Breathing.colors_min = 1; + //Breathing.colors_max = 2; + //Breathing.colors.resize(1); + //modes.push_back(Breathing); + + mode SpectrumCycle; + SpectrumCycle.name = "Spectrum Cycle"; + SpectrumCycle.value = RAZER_MODE_SPECTRUM_CYCLE; + SpectrumCycle.flags = 0; + SpectrumCycle.color_mode = MODE_COLORS_NONE; + modes.push_back(SpectrumCycle); + + // Wave disabled until proper detection + //mode Wave; + //Wave.name = "Wave"; + //Wave.value = RAZER_MODE_WAVE; + //Wave.flags = 0; + //Wave.color_mode = MODE_COLORS_NONE; + //modes.push_back(Wave); + + // Reactive disabled, not yet implemented + //mode Reactive; + //Reactive.name = "Reactive"; + //Reactive.value = RAZER_MODE_REACTIVE; + //Reactive.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR; + //Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC; + //Reactive.colors_min = 1; + //Reactive.colors_max = 1; + //Reactive.colors.resize(1); + //modes.push_back(Reactive); + + SetupZones(); +} + +RGBController_Razer::~RGBController_Razer() +{ + +} + +void RGBController_Razer::SetupZones() +{ + unsigned int device_index = controller->GetDeviceIndex(); + + /*---------------------------------------------------------*\ + | Fill in zone information based on device table | + \*---------------------------------------------------------*/ + for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++) + { + if(device_list[device_index]->zones[zone_id] != NULL) + { + zone new_zone; + + new_zone.name = device_list[device_index]->zones[zone_id]->name; + new_zone.type = device_list[device_index]->zones[zone_id]->type; + + new_zone.leds_count = device_list[device_index]->zones[zone_id]->rows * device_list[device_index]->zones[zone_id]->cols; + new_zone.leds_min = new_zone.leds_count; + new_zone.leds_max = new_zone.leds_count; + + if(new_zone.type == ZONE_TYPE_MATRIX) + { + matrix_map_type * new_map = new matrix_map_type; + new_zone.matrix_map = new_map; + + new_map->height = device_list[device_index]->zones[zone_id]->rows; + new_map->width = device_list[device_index]->zones[zone_id]->cols; + + new_map->map = new unsigned int[new_map->height * new_map->width]; + + for(unsigned int y = 0; y < new_map->height; y++) + { + for(unsigned int x = 0; x < new_map->width; x++) + { + new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x; + } + } + } + else + { + new_zone.matrix_map = NULL; + } + + zones.push_back(new_zone); + } + } + + for(unsigned int zone_id = 0; zone_id < zones.size(); zone_id++) + { + for (unsigned int row_id = 0; row_id < device_list[device_index]->zones[zone_id]->rows; row_id++) + { + for (unsigned int col_id = 0; col_id < device_list[device_index]->zones[zone_id]->cols; col_id++) + { + led* new_led = new led(); + + new_led->name = device_list[device_index]->zones[zone_id]->name; + + if(zones[zone_id].leds_count > 1) + { + new_led->name.append(" LED "); + new_led->name.append(std::to_string(col_id + 1)); + } + + if(device_list[device_index]->keymap != NULL) + { + for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++) + { + if(zone_id == device_list[device_index]->keymap[i].zone && + row_id == device_list[device_index]->keymap[i].row && + col_id == device_list[device_index]->keymap[i].col) + { + new_led->name = device_list[device_index]->keymap[i].name; + } + } + } + + leds.push_back(*new_led); + } + } + } + + SetupColors(); +} + +void RGBController_Razer::ResizeZone(int /*zone*/, int /*new_size*/) +{ + /*---------------------------------------------------------*\ + | This device does not support resizing zones | + \*---------------------------------------------------------*/ +} + +void RGBController_Razer::DeviceUpdateLEDs() +{ + controller->SetLEDs(&colors[0]); +} + +void RGBController_Razer::UpdateZoneLEDs(int zone) +{ + DeviceUpdateLEDs(); +} + +void RGBController_Razer::UpdateSingleLED(int led) +{ + DeviceUpdateLEDs(); +} + +void RGBController_Razer::SetCustomMode() +{ + active_mode = 0; +} + +void RGBController_Razer::DeviceUpdateMode() +{ + switch(modes[active_mode].value) + { + case RAZER_MODE_OFF: + controller->SetModeOff(); + break; + + case RAZER_MODE_STATIC: + if(modes[active_mode].colors.size() == 1) + { + unsigned char red = RGBGetRValue(modes[active_mode].colors[0]); + unsigned char grn = RGBGetGValue(modes[active_mode].colors[0]); + unsigned char blu = RGBGetBValue(modes[active_mode].colors[0]); + + controller->SetModeStatic(red, grn, blu); + } + break; + + case RAZER_MODE_BREATHING: + break; + + case RAZER_MODE_SPECTRUM_CYCLE: + controller->SetModeSpectrumCycle(); + break; + + case RAZER_MODE_WAVE: + controller->SetModeWave(); + break; + } +} diff --git a/Controllers/RazerController/RGBController_Razer.h b/Controllers/RazerController/RGBController_Razer.h new file mode 100644 index 00000000..75af1aa6 --- /dev/null +++ b/Controllers/RazerController/RGBController_Razer.h @@ -0,0 +1,43 @@ +/*-----------------------------------------*\ +| RGBController_Razer.h | +| | +| Generic RGB Interface for Razer devices | +| | +| Adam Honse (CalcProgrammer1) 1/22/2021 | +\*-----------------------------------------*/ + +#pragma once +#include "RGBController.h" +#include "RazerController.h" + +enum +{ + RAZER_MODE_DIRECT, + RAZER_MODE_OFF, + RAZER_MODE_STATIC, + RAZER_MODE_BREATHING, + RAZER_MODE_SPECTRUM_CYCLE, + RAZER_MODE_WAVE, + RAZER_MODE_REACTIVE, +}; + +class RGBController_Razer : public RGBController +{ +public: + RGBController_Razer(RazerController* controller_ptr); + ~RGBController_Razer(); + + void SetupZones(); + + void ResizeZone(int zone, int new_size); + + void DeviceUpdateLEDs(); + void UpdateZoneLEDs(int zone); + void UpdateSingleLED(int led); + + void SetCustomMode(); + void DeviceUpdateMode(); + +private: + RazerController* controller; +}; diff --git a/Controllers/RazerController/RazerController.cpp b/Controllers/RazerController/RazerController.cpp new file mode 100644 index 00000000..bbe1ad77 --- /dev/null +++ b/Controllers/RazerController/RazerController.cpp @@ -0,0 +1,1064 @@ +/*-----------------------------------------*\ +| RazerController.cpp | +| | +| Driver for Razer devices | +| | +| Adam Honse (CalcProgrammer1) 1/22/2021 | +\*-----------------------------------------*/ + +#include "RazerController.h" +#include "RazerDevices.h" + +#include + +using namespace std::chrono_literals; + +RazerController::RazerController(hid_device* dev_handle, const char* path, unsigned short pid, std::string dev_name) +{ + dev = dev_handle; + dev_pid = pid; + location = path; + name = dev_name; + device_index = 0; + + /*-----------------------------------------------------------------*\ + | Loop through all known devices to look for a name match | + \*-----------------------------------------------------------------*/ + for (unsigned int i = 0; i < RAZER_NUM_DEVICES; i++) + { + if (device_list[i]->pid == dev_pid) + { + /*---------------------------------------------------------*\ + | Set device ID | + \*---------------------------------------------------------*/ + device_index = i; + } + } + + /*-----------------------------------------------------------------*\ + | Set report index | + \*-----------------------------------------------------------------*/ + report_index = 1; + response_index = 1; + + /*-----------------------------------------------------------------*\ + | Determine transaction ID for device | + \*-----------------------------------------------------------------*/ + switch(dev_pid) + { + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_TARTARUS_CHROMA_PID: + case RAZER_TARTARUS_V2_PID: + + case RAZER_DEATHADDER_CHROMA_PID: + case RAZER_MAMBA_ELITE_PID: + case RAZER_NAGA_EPIC_CHROMA_PID: + + case RAZER_BASE_STATION_V2_CHROMA_PID: + case RAZER_KRAKEN_KITTY_EDITION_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + dev_transaction_id = 0x1F; + break; + + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + default: + dev_transaction_id = 0x3F; + break; + } + + /*-----------------------------------------------------------------*\ + | Determine LED ID for device | + \*-----------------------------------------------------------------*/ + switch(dev_pid) + { + case RAZER_TARTARUS_V2_PID: + case RAZER_MAMBA_ELITE_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + dev_led_id = RAZER_LED_ID_ZERO; + break; + + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_BLACKWIDOW_ESSENTIAL_PID: + case RAZER_BLACKWIDOW_LITE_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_CYNOSA_LITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_ORNATA_CHROMA_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + default: + dev_led_id = RAZER_LED_ID_BACKLIGHT; + break; + } + + /*-----------------------------------------------------------------*\ + | Initialize to full brightness | + \*-----------------------------------------------------------------*/ + razer_set_brightness(255); +} + +RazerController::~RazerController() +{ + +} + +std::string RazerController::GetName() +{ + return(name); +} + +unsigned int RazerController::GetDeviceIndex() +{ + return(device_index); +} + +device_type RazerController::GetDeviceType() +{ + return(device_list[device_index]->type); +} + +std::string RazerController::GetDeviceLocation() +{ + return("HID: " + location); +} + +std::string RazerController::GetFirmwareString() +{ + return(razer_get_firmware()); +} + +std::string RazerController::GetSerialString() +{ + return(razer_get_serial()); +} + +void RazerController::SetLEDs(RGBColor* colors) +{ + /*---------------------------------------------------------*\ + | Get the matrix layout information from the device list | + \*---------------------------------------------------------*/ + unsigned int matrix_cols = device_list[device_index]->cols; + unsigned int matrix_rows = device_list[device_index]->rows; + + /*---------------------------------------------------------*\ + | Create an output array large enough to hold RGB data for | + | a single row | + \*---------------------------------------------------------*/ + unsigned char* output_array = new unsigned char[matrix_cols * 3]; + + /*---------------------------------------------------------*\ + | Send one row of the custom frame at a time | + \*---------------------------------------------------------*/ + for (unsigned int row = 0; row < matrix_rows; row++) + { + unsigned int row_offset = (row * matrix_cols); + + /*-----------------------------------------------------*\ + | Fill the output array with RGB data | + \*-----------------------------------------------------*/ + for(unsigned int col = 0; col < matrix_cols; col++) + { + unsigned int color_idx = col + row_offset; + output_array[(col * 3) + 0] = (char)RGBGetRValue(colors[color_idx]); + output_array[(col * 3) + 1] = (char)RGBGetGValue(colors[color_idx]); + output_array[(col * 3) + 2] = (char)RGBGetBValue(colors[color_idx]); + } + + /*-----------------------------------------------------*\ + | Send the output array to the device | + \*-----------------------------------------------------*/ + std::this_thread::sleep_for(1ms); + + razer_set_custom_frame(row, 0, matrix_cols - 1, output_array); + } + + std::this_thread::sleep_for(1ms); + + /*---------------------------------------------------------*\ + | Set custom mode to apply frame | + \*---------------------------------------------------------*/ + razer_set_mode_custom(); + + /*---------------------------------------------------------*\ + | Delete the output array | + \*---------------------------------------------------------*/ + delete[] output_array; +} + +void RazerController::SetModeOff() +{ + razer_set_mode_none(); +} + +void RazerController::SetModeSpectrumCycle() +{ + razer_set_mode_spectrum_cycle(); +} + +void RazerController::SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu) +{ + razer_set_mode_static(red, grn, blu); +} + +void RazerController::SetModeWave() +{ + razer_set_mode_wave(); +} + +/*-------------------------------------------------------------------------------------------------*\ +| Private packet sending functions. | +\*-------------------------------------------------------------------------------------------------*/ + +unsigned char RazerController::razer_calculate_crc(razer_report* report) +{ + /*---------------------------------------------------------*\ + | The second to last byte of report is a simple checksum | + | Just xor all bytes up with overflow and you are done | + \*---------------------------------------------------------*/ + unsigned char crc = 0; + unsigned char* report_ptr = (unsigned char*)report; + + /*---------------------------------------------------------*\ + | The start and end checks here have been modified compared | + | to the original OpenRazer version. This is due to adding | + | the report ID field to the razer_report structure for | + | compatibility with HIDAPI. | + \*---------------------------------------------------------*/ + for(unsigned int i = 3; i < 89; i++) + { + crc ^= report_ptr[i]; + } + + return crc; +} + +/*---------------------------------------------------------------------------------*\ +| Basic report and response creation functions | +\*---------------------------------------------------------------------------------*/ + +razer_report RazerController::razer_create_report(unsigned char command_class, unsigned char command_id, unsigned char data_size) +{ + razer_report new_report; + + /*---------------------------------------------------------*\ + | Zero out the new report | + \*---------------------------------------------------------*/ + memset(&new_report, 0, sizeof(razer_report)); + + /*---------------------------------------------------------*\ + | Fill in the new report with the given parameters | + \*---------------------------------------------------------*/ + new_report.report_id = report_index; + new_report.status = 0x00; + new_report.transaction_id.id = dev_transaction_id; + new_report.remaining_packets = 0x00; + new_report.protocol_type = 0x00; + new_report.command_class = command_class; + new_report.command_id.id = command_id; + new_report.data_size = data_size; + + return new_report; +} + +razer_report RazerController::razer_create_response() +{ + razer_report new_report; + + /*---------------------------------------------------------*\ + | Zero out the new report | + \*---------------------------------------------------------*/ + memset(&new_report, 0, sizeof(razer_report)); + + /*---------------------------------------------------------*\ + | Fill in the new report with the given parameters | + \*---------------------------------------------------------*/ + new_report.report_id = response_index; + new_report.status = 0x00; + new_report.transaction_id.id = dev_transaction_id; + new_report.remaining_packets = 0x00; + new_report.protocol_type = 0x00; + new_report.command_class = 0x00; + new_report.command_id.id = 0x00; + new_report.data_size = 0x00; + + return new_report; +} + +/*---------------------------------------------------------------------------------*\ +| Command report creation functions | +\*---------------------------------------------------------------------------------*/ + +razer_report RazerController::razer_create_brightness_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char brightness) +{ + razer_report report = razer_create_report(0x0F, 0x04, 0x03); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = brightness; + + return report; +} + +razer_report RazerController::razer_create_brightness_standard_report(unsigned char variable_storage, unsigned char led_id, unsigned char brightness) +{ + razer_report report = razer_create_report(0x03, 0x03, 0x03); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = brightness; + + return report; +} + +razer_report RazerController::razer_create_custom_frame_linear_report(unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data) +{ + razer_report report = razer_create_report(0x03, 0x0C, 0x32); + size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3); + + report.arguments[0] = start_col; + report.arguments[1] = stop_col; + + /*---------------------------------------------------------*\ + | Copy in the RGB data | + \*---------------------------------------------------------*/ + memcpy(&report.arguments[2], rgb_data, row_length); + + return report; +} + +razer_report RazerController::razer_create_custom_frame_extended_matrix_report(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data) +{ + const size_t row_length = (size_t)(((stop_col + 1) - start_col) * 3); + const size_t packet_length = row_length + 5; + + razer_report report = razer_create_report(0x0F, 0x03, packet_length); + + report.arguments[2] = row_index; + report.arguments[3] = start_col; + report.arguments[4] = stop_col; + + /*---------------------------------------------------------*\ + | Copy in the RGB data | + \*---------------------------------------------------------*/ + memcpy(&report.arguments[5], rgb_data, row_length); + + return report; +} + +razer_report RazerController::razer_create_custom_frame_standard_matrix_report(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data) +{ + const size_t row_length = (size_t)(((stop_col + 1) - start_col) * 3); + const size_t packet_length = row_length + 4; + + razer_report report = razer_create_report(0x03, 0x0B, packet_length); + + report.arguments[0] = 0xFF; + report.arguments[1] = row_index; + report.arguments[2] = start_col; + report.arguments[3] = stop_col; + + /*---------------------------------------------------------*\ + | Copy in the RGB data | + \*---------------------------------------------------------*/ + memcpy(&report.arguments[4], rgb_data, row_length); + + return report; +} + +razer_report RazerController::razer_create_mode_custom_extended_matrix_report() +{ + struct razer_report report = razer_create_report(0x0F, 0x02, 0x0C); + + report.arguments[0] = 0x00; + report.arguments[1] = 0x00; + report.arguments[2] = 0x08; + + return report; +} + +razer_report RazerController::razer_create_mode_custom_standard_matrix_report(unsigned char variable_storage) +{ + razer_report report = razer_create_report(0x03, 0x0A, 0x02); + + report.arguments[0] = 0x05; + report.arguments[1] = variable_storage; + + return report; +} + +razer_report RazerController::razer_create_mode_none_extended_matrix_report(unsigned char variable_storage, unsigned char led_id) +{ + struct razer_report report = razer_create_report(0x0F, 0x02, 06); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = 0x00; + + return report; +} + +razer_report RazerController::razer_create_mode_none_standard_matrix_report(unsigned char variable_storage, unsigned char led_id) +{ + struct razer_report report = razer_create_report(0x03, 0x0A, 0x01); + + report.arguments[0] = 0x00; + + return report; +} + +razer_report RazerController::razer_create_mode_spectrum_cycle_extended_matrix_report(unsigned char variable_storage, unsigned char led_id) +{ + razer_report report = razer_create_report(0x0F, 0x02, 0x06); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = 0x03; + + return report; +} + +razer_report RazerController::razer_create_mode_spectrum_cycle_standard_matrix_report(unsigned char variable_storage, unsigned char led_id) +{ + razer_report report = razer_create_report(0x03, 0x0A, 0x01); + + report.arguments[0] = 0x04; + + return report; +} + +razer_report RazerController::razer_create_mode_static_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char red, unsigned char grn, unsigned char blu) +{ + razer_report report = razer_create_report(0x0F, 0x02, 0x09); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = 0x01; + + report.arguments[5] = 0x01; + report.arguments[6] = red; + report.arguments[7] = grn; + report.arguments[8] = blu; + + return report; +} + +razer_report RazerController::razer_create_mode_static_standard_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char red, unsigned char grn, unsigned char blu) +{ + razer_report report = razer_create_report(0x03, 0x0A, 0x04); + + report.arguments[0] = 0x06; + report.arguments[1] = red; + report.arguments[2] = grn; + report.arguments[3] = blu; + + return report; +} + +razer_report RazerController::razer_create_mode_wave_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char direction) +{ + razer_report report = razer_create_report(0x0F, 0x02, 0x06); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = 0x04; + + report.arguments[3] = direction; + report.arguments[4] = 0x28; + + return report; +} + +razer_report RazerController::razer_create_mode_wave_standard_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char direction) +{ + razer_report report = razer_create_report(0x03, 0x0A, 0x02); + + report.arguments[0] = 0x01; + report.arguments[1] = direction; + + return report; +} + +razer_report RazerController::razer_create_set_led_rgb_report(unsigned char variable_storage, unsigned char led_id, unsigned char* rgb_data) +{ + razer_report report = razer_create_report(0x03, 0x01, 0x05); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + report.arguments[2] = rgb_data[0]; + report.arguments[3] = rgb_data[1]; + report.arguments[4] = rgb_data[2]; + + return report; +} + +razer_report RazerController::razer_create_set_led_effect_report(unsigned char variable_storage, unsigned char led_id, unsigned char effect) +{ + razer_report report = razer_create_report(0x03, 0x02, 0x03); + + report.arguments[0] = variable_storage; + report.arguments[1] = led_id; + + if(effect > 5) + { + report.arguments[2] = 5; + } + else + { + report.arguments[2] = effect; + } + + return report; +} + +/*---------------------------------------------------------------------------------*\ +| Get functions (request information from device) | +\*---------------------------------------------------------------------------------*/ + +std::string RazerController::razer_get_firmware() +{ + std::string firmware_string = ""; + struct razer_report report = razer_create_report(0x00, RAZER_COMMAND_ID_GET_FIRMWARE_VERSION, 0x02); + struct razer_report response_report = razer_create_response(); + + std::this_thread::sleep_for(1ms); + razer_usb_send(&report); + std::this_thread::sleep_for(1ms); + razer_usb_receive(&response_report); + + firmware_string = "v" + std::to_string(response_report.arguments[0]) + "." + std::to_string(response_report.arguments[1]); + + return firmware_string; +} + +std::string RazerController::razer_get_serial() +{ + char serial_string[64] = ""; + struct razer_report report = razer_create_report(0x00, RAZER_COMMAND_ID_GET_SERIAL_STRING, 0x16); + struct razer_report response_report = razer_create_response(); + + std::this_thread::sleep_for(1ms); + razer_usb_send(&report); + std::this_thread::sleep_for(1ms); + razer_usb_receive(&response_report); + + strncpy(&serial_string[0], (const char*)&response_report.arguments[0], 22); + serial_string[22] = '\0'; + + std::string ret_string = serial_string; + return ret_string; +} + +/*---------------------------------------------------------------------------------*\ +| Set functions (send information to device) | +\*---------------------------------------------------------------------------------*/ + +void RazerController::razer_set_brightness(unsigned char brightness) +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_TARTARUS_V2_PID: + case RAZER_MAMBA_ELITE_PID: + case RAZER_BLACKWIDOW_LITE_PID: + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_BLACKWIDOW_ESSENTIAL_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_CYNOSA_LITE_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + report = razer_create_brightness_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, brightness); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report and LED| + | ID Backlight | + \*-------------------------------------------------*/ + default: + report = razer_create_brightness_standard_report(RAZER_STORAGE_NO_SAVE, dev_led_id, brightness); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_custom_frame(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data) +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_DEATHADDER_ELITE_PID: + case RAZER_LANCEHEAD_WIRED_PID: + case RAZER_LANCEHEAD_WIRELESS_PID: + case RAZER_LANCEHEAD_TE_WIRED_PID: + case RAZER_LANCEHEAD_WIRELESS_RECEIVER_PID: + case RAZER_LANCEHEAD_WIRELESS_WIRED_PID: + case RAZER_MAMBA_WIRELESS_RECEIVER_PID: + case RAZER_MAMBA_WIRELESS_WIRED_PID: + case RAZER_BASILISK_PID: + case RAZER_DEATHADDER_V2_PID: + case RAZER_DEATHADDER_V2_PRO_WIRED_PID: + case RAZER_DEATHADDER_V2_PRO_WIRELESS_PID: + case RAZER_DEATHADDER_V2_MINI_PID: + case RAZER_VIPER_PID: + case RAZER_VIPER_MINI_PID: + case RAZER_VIPER_ULTIMATE_WIRED_PID: + case RAZER_VIPER_ULTIMATE_WIRELESS_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_MAMBA_ELITE_PID: + case RAZER_KRAKEN_KITTY_EDITION_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + report = razer_create_custom_frame_extended_matrix_report(row_index, start_col, stop_col, rgb_data); + break; + + /*-------------------------------------------------*\ + | These devices use a linear report | + \*-------------------------------------------------*/ + case RAZER_DEATHSTALKER_CHROMA_PID: + case RAZER_MAMBA_TE_WIRED_PID: + case RAZER_DIAMONDBACK_CHROMA_PID: + case RAZER_FIREFLY_PID: + case RAZER_CHROMA_MUG_PID: + case RAZER_NAGA_CHROMA_PID: + case RAZER_MAMBA_WIRED_PID: + case RAZER_MAMBA_WIRELESS_PID: + report = razer_create_custom_frame_linear_report(start_col, stop_col, rgb_data); + break; + + /*-------------------------------------------------*\ + | These devices use individual LED effect reports | + | and transaction ID 0x1F | + \*-------------------------------------------------*/ + case RAZER_TARTARUS_CHROMA_PID: + report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, rgb_data); + break; + + case RAZER_DEATHADDER_CHROMA_PID: + report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data); + + razer_usb_send(&report); + + report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, &rgb_data[3]); + break; + + case RAZER_NAGA_EPIC_CHROMA_PID: + report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, rgb_data); + + razer_usb_send(&report); + + report = razer_create_set_led_rgb_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, &rgb_data[3]); + break; + + /*-------------------------------------------------*\ + | The Orbweaver Chroma has an unusual matrix layout | + | and the following code allows it to present as a | + | 5x5 matrix. The hardware layout is: | + | | + | XX XX XX XX XX XX XX | + | XX 01 02 03 04 05 XX | + | XX 06 07 08 09 10 XX | + | XX 11 12 13 14 15 XX | + | XX 16 XX 17 18 19 20 | + | | + | It uses a standard matrix report and transaction | + | ID 0x3F | + \*-------------------------------------------------*/ + case RAZER_ORBWEAVER_CHROMA_PID: + if(row_index != 3) + { + report = razer_create_custom_frame_standard_matrix_report(row_index + 1, start_col + 1, stop_col + 1, rgb_data); + } + else + { + unsigned char rgb_data_adj[6*3]; + + memcpy(&rgb_data_adj[0], &rgb_data[0], 3); + memcpy(&rgb_data_adj[6], &rgb_data[3], 3*4); + + report = razer_create_custom_frame_standard_matrix_report(row_index + 1, start_col + 1, stop_col + 2, rgb_data_adj); + } + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_BLADE_STEALTH_PID: + case RAZER_BLADE_STEALTH_LATE_2016_PID: + case RAZER_BLADE_STEALTH_MID_2017_PID: + case RAZER_BLADE_STEALTH_LATE_2017_PID: + case RAZER_BLADE_STEALTH_2019_PID: + case RAZER_BLADE_QHD_PID: + case RAZER_BLADE_PRO_LATE_2016_PID: + case RAZER_BLADE_2018_PID: + case RAZER_BLADE_2018_MERCURY_PID: + case RAZER_BLADE_2018_BASE_PID: + case RAZER_BLADE_2019_ADV_PID: + case RAZER_BLADE_MID_2019_MERCURY_PID: + case RAZER_BLADE_STUDIO_EDITION_2019_PID: + case RAZER_BLADE_PRO_2017_PID: + case RAZER_BLADE_PRO_2017_FULLHD_PID: + case RAZER_BLADE_PRO_LATE_2019_PID: + case RAZER_BLADE_15_ADV_2020_PID: + case RAZER_CORE_PID: + case RAZER_BLADE_LATE_2016_PID: + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_NAGA_HEX_V2_PID: + report = razer_create_custom_frame_standard_matrix_report(row_index, start_col, stop_col, rgb_data); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_mode_custom() +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_DEATHADDER_ELITE_PID: + case RAZER_LANCEHEAD_WIRED_PID: + case RAZER_LANCEHEAD_WIRELESS_PID: + case RAZER_LANCEHEAD_TE_WIRED_PID: + case RAZER_LANCEHEAD_WIRELESS_RECEIVER_PID: + case RAZER_LANCEHEAD_WIRELESS_WIRED_PID: + case RAZER_MAMBA_WIRELESS_RECEIVER_PID: + case RAZER_MAMBA_WIRELESS_WIRED_PID: + case RAZER_BASILISK_PID: + case RAZER_DEATHADDER_V2_PID: + case RAZER_DEATHADDER_V2_PRO_WIRED_PID: + case RAZER_DEATHADDER_V2_PRO_WIRELESS_PID: + case RAZER_DEATHADDER_V2_MINI_PID: + case RAZER_VIPER_PID: + case RAZER_VIPER_MINI_PID: + case RAZER_VIPER_ULTIMATE_WIRED_PID: + case RAZER_VIPER_ULTIMATE_WIRELESS_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_MAMBA_ELITE_PID: + case RAZER_KRAKEN_KITTY_EDITION_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + report = razer_create_mode_custom_extended_matrix_report(); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report and | + | transaction ID 0x80 | + \*-------------------------------------------------*/ + case RAZER_MAMBA_WIRELESS_PID: + report = razer_create_mode_custom_standard_matrix_report(RAZER_STORAGE_NO_SAVE); + break; + + /*-------------------------------------------------*\ + | These devices use individual LED effect reports | + | and transaction ID 0x1F | + \*-------------------------------------------------*/ + case RAZER_TARTARUS_CHROMA_PID: + report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0); + break; + + case RAZER_DEATHADDER_CHROMA_PID: + report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0); + + razer_usb_send(&report); + + report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_LOGO, 0); + break; + + case RAZER_NAGA_EPIC_CHROMA_PID: + report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_SCROLL_WHEEL, 0); + + razer_usb_send(&report); + + report = razer_create_set_led_effect_report(RAZER_STORAGE_NO_SAVE, RAZER_LED_ID_BACKLIGHT, 0); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_FIREFLY_PID: + case RAZER_CORE_PID: + case RAZER_CHROMA_MUG_PID: + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_ORBWEAVER_CHROMA_PID: + case RAZER_NAGA_HEX_V2_PID: + case RAZER_NAGA_CHROMA_PID: + default: + report = razer_create_mode_custom_standard_matrix_report(RAZER_STORAGE_NO_SAVE); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_mode_none() +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_BLACKWIDOW_LITE_PID: + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_BLACKWIDOW_ESSENTIAL_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_CYNOSA_LITE_PID: + case RAZER_NAGA_HEX_V2_PID: + case RAZER_NAGA_CHROMA_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_FIREFLY_V2_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + case RAZER_KRAKEN_KITTY_EDITION_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + report = razer_create_mode_none_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_FIREFLY_PID: + case RAZER_CORE_PID: + case RAZER_CHROMA_MUG_PID: + default: + report = razer_create_mode_none_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_mode_spectrum_cycle() +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_CYNOSA_LITE_PID: + case RAZER_NAGA_HEX_V2_PID: + case RAZER_NAGA_CHROMA_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_FIREFLY_V2_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + report = razer_create_mode_spectrum_cycle_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_FIREFLY_PID: + case RAZER_CORE_PID: + case RAZER_CHROMA_MUG_PID: + default: + report = razer_create_mode_spectrum_cycle_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu) +{ + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_CYNOSA_LITE_PID: + case RAZER_NAGA_HEX_V2_PID: + case RAZER_NAGA_CHROMA_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_FIREFLY_V2_PID: + case RAZER_GOLIATHUS_CHROMA_PID: + case RAZER_GOLIATHUS_CHROMA_EXTENDED_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + report = razer_create_mode_static_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_FIREFLY_PID: + case RAZER_CORE_PID: + case RAZER_CHROMA_MUG_PID: + default: + report = razer_create_mode_static_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, red, grn, blu); + break; + } + + razer_usb_send(&report); +} + +void RazerController::razer_set_mode_wave() +{ + unsigned char direction = 0x01; + + razer_report report; + + switch(dev_pid) + { + /*-------------------------------------------------*\ + | These devices use an extended matrix report | + \*-------------------------------------------------*/ + case RAZER_ORNATA_CHROMA_PID: + case RAZER_HUNTSMAN_ELITE_PID: + case RAZER_HUNTSMAN_TE_PID: + case RAZER_BLACKWIDOW_2019_PID: + case RAZER_HUNTSMAN_PID: + case RAZER_BLACKWIDOW_ESSENTIAL_PID: + case RAZER_CYNOSA_CHROMA_PID: + case RAZER_TARTARUS_V2_PID: + case RAZER_BLACKWIDOW_ELITE_PID: + case RAZER_CYNOSA_V2_PID: + case RAZER_ORNATA_CHROMA_V2_PID: + case RAZER_FIREFLY_HYPERFLUX_PID: + case RAZER_FIREFLY_V2_PID: + case RAZER_CHROMA_HDK_PID: + case RAZER_CHROMA_BASE_PID: + case RAZER_NOMMO_PRO_PID: + case RAZER_NOMMO_CHROMA_PID: + case RAZER_MOUSE_BUNGEE_V3_CHROMA_PID: + case RAZER_BASE_STATION_V2_CHROMA_PID: + report = razer_create_mode_wave_extended_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction); + break; + + /*-------------------------------------------------*\ + | These devices use a standard matrix report | + \*-------------------------------------------------*/ + case RAZER_BLACKWIDOW_CHROMA_V2_PID: + case RAZER_FIREFLY_PID: + case RAZER_CORE_PID: + case RAZER_CHROMA_MUG_PID: + default: + report = razer_create_mode_wave_standard_matrix_report(RAZER_STORAGE_NO_SAVE, dev_led_id, direction); + break; + } + + razer_usb_send(&report); +} + +/*---------------------------------------------------------------------------------*\ +| USB transfer functions | +\*---------------------------------------------------------------------------------*/ + +int RazerController::razer_usb_receive(razer_report* report) +{ + return hid_get_feature_report(dev, (unsigned char*)report, sizeof(*report)); +} + +int RazerController::razer_usb_send(razer_report* report) +{ + report->crc = razer_calculate_crc(report); + + return hid_send_feature_report(dev, (unsigned char*)report, sizeof(*report)); +} diff --git a/Controllers/RazerController/RazerController.h b/Controllers/RazerController/RazerController.h new file mode 100644 index 00000000..2514117f --- /dev/null +++ b/Controllers/RazerController/RazerController.h @@ -0,0 +1,209 @@ +/*-----------------------------------------*\ +| RazerController.h | +| | +| Definitions and types for Razer devices | +| | +| Adam Honse (CalcProgrammer1) 1/22/2021 | +\*-----------------------------------------*/ + +#include "RGBController.h" + +#include +#include + +#pragma once + +/*---------------------------------------------------------*\ +| Struct packing macro for GCC and MSVC | +\*---------------------------------------------------------*/ +#ifdef __GNUC__ +#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) +#endif + +#ifdef _MSC_VER +#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop)) +#endif + +/*---------------------------------------------------------*\ +| Razer Command IDs | +\*---------------------------------------------------------*/ +enum +{ + /*-----------------------------------------------------*\ + | Set Commands | + \*-----------------------------------------------------*/ + RAZER_COMMAND_ID_SET_LED_STATE = 0x00, + RAZER_COMMAND_ID_SET_DEVICE_MODE = 0x04, + + /*-----------------------------------------------------*\ + | Get Commands | + \*-----------------------------------------------------*/ + RAZER_COMMAND_ID_GET_LED_STATE = 0x80, + RAZER_COMMAND_ID_GET_FIRMWARE_VERSION = 0x81, + RAZER_COMMAND_ID_GET_SERIAL_STRING = 0x82, + RAZER_COMMAND_ID_GET_DEVICE_MODE = 0x84, +}; + +/*---------------------------------------------------------*\ +| Razer Storage Flags | +\*---------------------------------------------------------*/ +enum +{ + RAZER_STORAGE_NO_SAVE = 0x00, + RAZER_STORAGE_SAVE = 0x01, +}; + +/*---------------------------------------------------------*\ +| Razer LED IDs | +\*---------------------------------------------------------*/ +enum +{ + RAZER_LED_ID_ZERO = 0x00, + RAZER_LED_ID_SCROLL_WHEEL = 0x01, + RAZER_LED_ID_BATTERY = 0x03, + RAZER_LED_ID_LOGO = 0x04, + RAZER_LED_ID_BACKLIGHT = 0x05, + RAZER_LED_ID_MACRO = 0x07, + RAZER_LED_ID_GAME = 0x08, + RAZER_LED_ID_PROFILE_RED = 0x0C, + RAZER_LED_ID_PROFILE_GREEN = 0x0D, + RAZER_LED_ID_PROFILE_BLUE = 0x0E, + RAZER_LED_ID_RIGHT_SIDE = 0x10, + RAZER_LED_ID_LEFT_SIDE = 0x11, +}; + +/*---------------------------------------------------------*\ +| Razer Report Type (taken from OpenRazer) | +\*---------------------------------------------------------*/ +struct razer_rgb +{ + unsigned char r,g,b; +}; + +union transaction_id_union +{ + unsigned char id; + struct transaction_parts + { + unsigned char device : 3; + unsigned char id : 5; + } parts; +}; + +union command_id_union +{ + unsigned char id; + struct command_id_parts + { + unsigned char direction : 1; + unsigned char id : 7; + } parts; +}; + +PACK(typedef struct razer_report +{ + unsigned char report_id; + unsigned char status; + union transaction_id_union transaction_id; + unsigned short remaining_packets; + unsigned char protocol_type; + unsigned char data_size; + unsigned char command_class; + union command_id_union command_id; + unsigned char arguments[80]; + unsigned char crc; + unsigned char reserved; +};) + +class RazerController +{ +public: + RazerController(hid_device* dev_handle, const char* path, unsigned short pid, std::string dev_name); + ~RazerController(); + + unsigned int GetDeviceIndex(); + device_type GetDeviceType(); + std::string GetDeviceLocation(); + std::string GetFirmwareString(); + std::string GetName(); + std::string GetSerialString(); + + void SetLEDs(RGBColor* colors); + + void SetModeOff(); + void SetModeSpectrumCycle(); + void SetModeStatic(unsigned char red, unsigned char grn, unsigned char blu); + void SetModeWave(); + +private: + hid_device* dev; + unsigned short dev_pid; + + /*---------------------------------------------------------*\ + | Device-specific protocol settings | + \*---------------------------------------------------------*/ + unsigned char dev_transaction_id; + unsigned char dev_led_id; + + /*---------------------------------------------------------*\ + | Device information strings | + \*---------------------------------------------------------*/ + std::string firmware_version; + std::string location; + std::string name; + device_type type; + + /*---------------------------------------------------------*\ + | Index of device in Razer device list | + \*---------------------------------------------------------*/ + unsigned int device_index; + + /*---------------------------------------------------------*\ + | HID report index for request and response | + \*---------------------------------------------------------*/ + unsigned char report_index; + unsigned char response_index; + + /*---------------------------------------------------------*\ + | Private functions based on OpenRazer | + \*---------------------------------------------------------*/ + unsigned char razer_calculate_crc(razer_report* report); + razer_report razer_create_report(unsigned char command_class, unsigned char command_id, unsigned char data_size); + razer_report razer_create_response(); + + razer_report razer_create_brightness_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char brightness); + razer_report razer_create_brightness_standard_report(unsigned char variable_storage, unsigned char led_id, unsigned char brightness); + razer_report razer_create_custom_frame_linear_report(unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data); + razer_report razer_create_custom_frame_extended_matrix_report(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data); + razer_report razer_create_custom_frame_standard_matrix_report(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data); + razer_report razer_create_mode_custom_extended_matrix_report(); + razer_report razer_create_mode_custom_standard_matrix_report(unsigned char variable_storage); + razer_report razer_create_mode_none_extended_matrix_report(unsigned char variable_storage, unsigned char led_id); + razer_report razer_create_mode_none_standard_matrix_report(unsigned char variable_storage, unsigned char led_id); + razer_report razer_create_mode_spectrum_cycle_extended_matrix_report(unsigned char variable_storage, unsigned char led_id); + razer_report razer_create_mode_spectrum_cycle_standard_matrix_report(unsigned char variable_storage, unsigned char led_id); + razer_report razer_create_mode_static_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char red, unsigned char grn, unsigned char blu); + razer_report razer_create_mode_static_standard_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char red, unsigned char grn, unsigned char blu); + razer_report razer_create_mode_wave_extended_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char direction); + razer_report razer_create_mode_wave_standard_matrix_report(unsigned char variable_storage, unsigned char led_id, unsigned char direction); + razer_report razer_create_set_led_effect_report(unsigned char variable_storage, unsigned char led_id, unsigned char effect); + razer_report razer_create_set_led_rgb_report(unsigned char variable_storage, unsigned char led_id, unsigned char* rgb_data); + + std::string razer_get_firmware(); + std::string razer_get_serial(); + + void razer_set_brightness(unsigned char brightness); + void razer_set_custom_frame(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char* rgb_data); + + void razer_set_mode_breathing(); + void razer_set_mode_custom(); + void razer_set_mode_none(); + void razer_set_mode_spectrum_cycle(); + void razer_set_mode_static(unsigned char red, unsigned char grn, unsigned char blu); + void razer_set_mode_wave(); + + int razer_usb_receive(razer_report* report); + int razer_usb_send(razer_report* report); + + +}; diff --git a/Controllers/RazerController/RazerControllerDetect.cpp b/Controllers/RazerController/RazerControllerDetect.cpp new file mode 100644 index 00000000..48c6dea3 --- /dev/null +++ b/Controllers/RazerController/RazerControllerDetect.cpp @@ -0,0 +1,134 @@ +#include "Detector.h" +#include "RazerController.h" +#include "RazerDevices.h" +#include "ResourceManager.h" +#include "RGBController.h" +#include "RGBController_Razer.h" +#include + +static bool openrazer_checked = false; +static bool openrazer_enabled = false; + +/******************************************************************************************\ +* * +* DetectRazerControllers * +* * +* Tests the USB address to see if a Razer controller exists there. * +* * +\******************************************************************************************/ + +void DetectRazerControllers(hid_device_info* info, const std::string& name) +{ + hid_device* dev = hid_open_path(info->path); + + /*-------------------------------------------------*\ + | If the OpenRazer/OpenRazer-Win32 controller is | + | enabled, don't use this controller. | + \*-------------------------------------------------*/ + if(!openrazer_checked) + { + /*-------------------------------------------------*\ + | Open device disable list and read in disabled | + | device strings | + \*-------------------------------------------------*/ + json detector_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Detectors"); + + /*-------------------------------------------------*\ + | Check for OpenRazer and OpenRazer-Win32 enable | + \*-------------------------------------------------*/ + if(detector_settings.contains("detectors")) + { + if(detector_settings["detectors"].contains("OpenRazer")) + { + if(detector_settings["detectors"]["OpenRazer"] == true) + { + openrazer_enabled = true; + } + } + if(detector_settings["detectors"].contains("OpenRazer-Win32")) + { + if(detector_settings["detectors"]["OpenRazer-Win32"] == true) + { + openrazer_enabled = true; + } + } + } + + /*-------------------------------------------------*\ + | Set OpenRazer checked flag to prevent having to do| + | the settings lookup multiple times | + \*-------------------------------------------------*/ + openrazer_checked = true; + } + + if(openrazer_enabled) + { + return; + } + + if(dev) + { + RazerController* controller = new RazerController(dev, info->path, info->product_id, name); + + RGBController_Razer* rgb_controller = new RGBController_Razer(controller); + ResourceManager::get()->RegisterRGBController(rgb_controller); + } +} /* DetectRazerControllers() */ + +/*-----------------------------------------------------------------------------------------------------*\ +| Keyboards | +\*-----------------------------------------------------------------------------------------------------*/ +REGISTER_HID_DETECTOR_PU("Razer Blackwidow Chroma", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blackwidow Chroma V2", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_CHROMA_V2_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blackwidow Chroma Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_CHROMA_TE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blackwidow Overwatch", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_OVERWATCH_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blackwidow X Chroma", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_X_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blackwidow X Chroma Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_BLACKWIDOW_X_CHROMA_TE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Cynosa Chroma", DetectRazerControllers, RAZER_VID, RAZER_CYNOSA_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Cynosa Chroma V2", DetectRazerControllers, RAZER_VID, RAZER_CYNOSA_V2_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Deathstalker Chroma", DetectRazerControllers, RAZER_VID, RAZER_DEATHSTALKER_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Huntsman", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Huntsman Elite", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_ELITE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Huntsman Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_HUNTSMAN_TE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Ornata Chroma", DetectRazerControllers, RAZER_VID, RAZER_ORNATA_CHROMA_PID, 1, 2); + +/*-----------------------------------------------------------------------------------------------------*\ +| Keypads | +\*-----------------------------------------------------------------------------------------------------*/ +REGISTER_HID_DETECTOR_PU("Razer Orbweaver Chroma", DetectRazerControllers, RAZER_VID, RAZER_ORBWEAVER_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Tartarus Chroma", DetectRazerControllers, RAZER_VID, RAZER_TARTARUS_CHROMA_PID, 1, 2); + +/*-----------------------------------------------------------------------------------------------------*\ +| Laptops | +\*-----------------------------------------------------------------------------------------------------*/ +REGISTER_HID_DETECTOR_PU("Razer Blade Pro", DetectRazerControllers, RAZER_VID, RAZER_BLADE_PRO_LATE_2016_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blade Pro (2017)", DetectRazerControllers, RAZER_VID, RAZER_BLADE_PRO_2017_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Blade Stealth", DetectRazerControllers, RAZER_VID, RAZER_BLADE_STEALTH_PID, 1, 2); + +/*-----------------------------------------------------------------------------------------------------*\ +| Mice | +\*-----------------------------------------------------------------------------------------------------*/ +REGISTER_HID_DETECTOR_PU("Razer Deathadder Chroma", DetectRazerControllers, RAZER_VID, RAZER_DEATHADDER_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Deathadder V2", DetectRazerControllers, RAZER_VID, RAZER_DEATHADDER_V2_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Diamondback", DetectRazerControllers, RAZER_VID, RAZER_DIAMONDBACK_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Mamba Elite", DetectRazerControllers, RAZER_VID, RAZER_MAMBA_ELITE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Mamba Tournament Edition", DetectRazerControllers, RAZER_VID, RAZER_MAMBA_TE_WIRED_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Naga Chroma", DetectRazerControllers, RAZER_VID, RAZER_NAGA_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Naga Epic Chroma", DetectRazerControllers, RAZER_VID, RAZER_NAGA_EPIC_CHROMA_PID, 1, 2); + +/*-----------------------------------------------------------------------------------------------------*\ +| Accessories | +\*-----------------------------------------------------------------------------------------------------*/ +REGISTER_HID_DETECTOR_PU("Razer Base Station Chroma", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_BASE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Base Station V2 Chroma", DetectRazerControllers, RAZER_VID, RAZER_BASE_STATION_V2_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Chroma HDK", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_HDK_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Chroma Mug Holder", DetectRazerControllers, RAZER_VID, RAZER_CHROMA_MUG_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Core", DetectRazerControllers, RAZER_VID, RAZER_CORE_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Firefly", DetectRazerControllers, RAZER_VID, RAZER_FIREFLY_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Firefly Hyperflux", DetectRazerControllers, RAZER_VID, RAZER_FIREFLY_HYPERFLUX_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Goliathus", DetectRazerControllers, RAZER_VID, RAZER_GOLIATHUS_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Goliathus Extended", DetectRazerControllers, RAZER_VID, RAZER_GOLIATHUS_CHROMA_EXTENDED_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Kraken Kitty Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_EDITION_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Mouse Bungee V3 Chroma", DetectRazerControllers, RAZER_VID, RAZER_MOUSE_BUNGEE_V3_CHROMA_PID, 1, 2); +REGISTER_HID_DETECTOR_PU("Razer Nommo Chroma", DetectRazerControllers, RAZER_VID, RAZER_NOMMO_CHROMA_PID, 1, 3); +REGISTER_HID_DETECTOR_PU("Razer Nommo Pro", DetectRazerControllers, RAZER_VID, RAZER_NOMMO_PRO_PID, 1, 3); diff --git a/Controllers/RazerController/RazerDevices.h b/Controllers/RazerController/RazerDevices.h new file mode 100644 index 00000000..19d54889 --- /dev/null +++ b/Controllers/RazerController/RazerDevices.h @@ -0,0 +1,4904 @@ +#define RAZER_MAX_ZONES 6 + +#include +#include "RGBController.h" + +/*-----------------------------------------------------*\ +| Razer vendor ID | +\*-----------------------------------------------------*/ +#define RAZER_VID 0x1532 + +/*-----------------------------------------------------*\ +| Keyboard product IDs | +| List taken from OpenRazer | +| Non-RGB keyboards were omitted from this list | +\*-----------------------------------------------------*/ +#define RAZER_BLACKWIDOW_CHROMA_PID 0x0203 +#define RAZER_DEATHSTALKER_CHROMA_PID 0x0204 +#define RAZER_BLADE_STEALTH_PID 0x0205 +#define RAZER_ORBWEAVER_CHROMA_PID 0x0207 +#define RAZER_TARTARUS_CHROMA_PID 0x0208 +#define RAZER_BLACKWIDOW_CHROMA_TE_PID 0x0209 +#define RAZER_BLADE_QHD_PID 0x020F +#define RAZER_BLADE_PRO_LATE_2016_PID 0x0210 +#define RAZER_BLACKWIDOW_OVERWATCH_PID 0x0211 +#define RAZER_BLACKWIDOW_X_CHROMA_PID 0x0216 +#define RAZER_BLACKWIDOW_X_CHROMA_TE_PID 0x021A +#define RAZER_ORNATA_CHROMA_PID 0x021E +#define RAZER_BLADE_STEALTH_LATE_2016_PID 0x0220 +#define RAZER_BLACKWIDOW_CHROMA_V2_PID 0x0221 +#define RAZER_BLADE_LATE_2016_PID 0x0224 +#define RAZER_BLADE_PRO_2017_PID 0x0225 +#define RAZER_HUNTSMAN_ELITE_PID 0x0226 +#define RAZER_HUNTSMAN_PID 0x0227 +#define RAZER_BLACKWIDOW_ELITE_PID 0x0228 +#define RAZER_CYNOSA_CHROMA_PID 0x022A +#define RAZER_TARTARUS_V2_PID 0x022B +#define RAZER_BLADE_STEALTH_MID_2017_PID 0x022D +#define RAZER_BLADE_PRO_2017_FULLHD_PID 0x022F +#define RAZER_BLADE_STEALTH_LATE_2017_PID 0x0232 +#define RAZER_BLADE_2018_PID 0x0233 +#define RAZER_BLADE_PRO_2019_PID 0x0234 +#define RAZER_BLACKWIDOW_LITE_PID 0x0235 +#define RAZER_BLACKWIDOW_ESSENTIAL_PID 0x0237 +#define RAZER_BLADE_STEALTH_2019_PID 0x0239 +#define RAZER_BLADE_2019_ADV_PID 0x023A +#define RAZER_BLADE_2018_BASE_PID 0x023B +#define RAZER_CYNOSA_LITE_PID 0x023F +#define RAZER_BLADE_2018_MERCURY_PID 0x0240 +#define RAZER_BLACKWIDOW_2019_PID 0x0241 +#define RAZER_HUNTSMAN_TE_PID 0x0243 +#define RAZER_BLADE_MID_2019_MERCURY_PID 0x0245 +#define RAZER_BLADE_2019_BASE_PID 0x0246 +#define RAZER_BLADE_STEALTH_LATE_2019_PID 0x024A +#define RAZER_BLADE_PRO_LATE_2019_PID 0x024C +#define RAZER_BLADE_STUDIO_EDITION_2019_PID 0x024D +#define RAZER_BLADE_STEALTH_EARLY_2020_PID 0x0252 +#define RAZER_BLADE_15_ADV_2020_PID 0x0253 +#define RAZER_BLADE_EARLY_2020_BASE_PID 0x0255 +#define RAZER_BLADE_STEALTH_LATE_2020_PID 0x0259 +#define RAZER_ORNATA_CHROMA_V2_PID 0x025D +#define RAZER_CYNOSA_V2_PID 0x025E + +/*-----------------------------------------------------*\ +| Mouse product IDs | +| List taken from OpenRazer | +\*-----------------------------------------------------*/ +#define RAZER_OROCHI_2011_PID 0x0013 +#define RAZER_DEATHADDER_3_5G_PID 0x0016 +#define RAZER_ABYSSUS_1800_PID 0x0020 +#define RAZER_MAMBA_2012_WIRED_PID 0x0024 +#define RAZER_MAMBA_2012_WIRELESS_PID 0x0025 +#define RAZER_NAGA_2012_PID 0x002E +#define RAZER_IMPERATOR_PID 0x002F +#define RAZER_OUROBOROS_PID 0x0032 +#define RAZER_TAIPAN_PID 0x0034 +#define RAZER_NAGA_HEX_RED_PID 0x0036 +#define RAZER_DEATHADDER_2013_PID 0x0037 +#define RAZER_DEATHADDER_1800_PID 0x0038 +#define RAZER_OROCHI_2013_PID 0x0039 +#define RAZER_NAGA_2014_PID 0x0040 +#define RAZER_NAGA_HEX_PID 0x0041 +#define RAZER_ABYSSUS_PID 0x0042 +#define RAZER_DEATHADDER_CHROMA_PID 0x0043 +#define RAZER_MAMBA_WIRED_PID 0x0044 +#define RAZER_MAMBA_WIRELESS_PID 0x0045 +#define RAZER_MAMBA_TE_WIRED_PID 0x0046 +#define RAZER_OROCHI_CHROMA_PID 0x0048 +#define RAZER_DIAMONDBACK_CHROMA_PID 0x004C +#define RAZER_DEATHADDER_2000_PID 0x004F +#define RAZER_NAGA_HEX_V2_PID 0x0050 +#define RAZER_NAGA_CHROMA_PID 0x0053 +#define RAZER_DEATHADDER_3500_PID 0x0054 +#define RAZER_LANCEHEAD_WIRED_PID 0x0059 +#define RAZER_LANCEHEAD_WIRELESS_PID 0x005A +#define RAZER_ABYSSUS_V2_PID 0x005B +#define RAZER_DEATHADDER_ELITE_PID 0x005C +#define RAZER_ABYSSUS_2000_PID 0x005E +#define RAZER_LANCEHEAD_TE_WIRED_PID 0x0060 +#define RAZER_ATHERIS_RECEIVER_PID 0x0062 +#define RAZER_BASILISK_PID 0x0064 +#define RAZER_NAGA_TRINITY_PID 0x0067 +#define RAZER_ABYSSUS_ELITE_DVA_EDITION_PID 0x006A +#define RAZER_ABYSSUS_ESSENTIAL_PID 0x006B +#define RAZER_MAMBA_ELITE_PID 0x006C +#define RAZER_DEATHADDER_ESSENTIAL_PID 0x006E +#define RAZER_LANCEHEAD_WIRELESS_RECEIVER_PID 0x006F +#define RAZER_LANCEHEAD_WIRELESS_WIRED_PID 0x0070 +#define RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION_PID 0x0071 +#define RAZER_MAMBA_WIRELESS_RECEIVER_PID 0x0072 +#define RAZER_MAMBA_WIRELESS_WIRED_PID 0x0073 +#define RAZER_VIPER_PID 0x0078 +#define RAZER_VIPER_ULTIMATE_WIRED_PID 0x007A +#define RAZER_VIPER_ULTIMATE_WIRELESS_PID 0x007B +#define RAZER_DEATHADDER_V2_PRO_WIRED_PID 0x007C +#define RAZER_DEATHADDER_V2_PRO_WIRELESS_PID 0x007D +#define RAZER_BASILISK_X_HYPERSPEED_PID 0x0083 +#define RAZER_DEATHADDER_V2_PID 0x0084 +#define RAZER_VIPER_MINI_PID 0x008A +#define RAZER_DEATHADDER_V2_MINI_PID 0x008C +#define RAZER_NAGA_EPIC_CHROMA_PID 0x003E +#define RAZER_NAGA_EPIC_CHROMA_DOCK_PID 0x003F + +/*-----------------------------------------------------*\ +| Headset product IDs | +\*-----------------------------------------------------*/ +#define RAZER_KRAKEN_CLASSIC_PID 0x0501 +#define RAZER_KRAKEN_PID 0x0504 +#define RAZER_KRAKEN_CLASSIC_ALT_PID 0x0506 +#define RAZER_KRAKEN_V2_PID 0x0510 +#define RAZER_KRAKEN_ULTIMATE_PID 0x0527 +#define RAZER_KRAKEN_KITTY_EDITION_PID 0x0F19 +#define RAZER_TIAMAT_71_V2_PID 0x0F03 + +/*-----------------------------------------------------*\ +| Accessory product IDs | +| List taken from OpenRazer | +\*-----------------------------------------------------*/ +#define RAZER_FIREFLY_HYPERFLUX_PID 0x0068 +#define RAZER_CORE_PID 0x0215 +#define RAZER_NOMMO_CHROMA_PID 0x0517 +#define RAZER_NOMMO_PRO_PID 0x0518 +#define RAZER_FIREFLY_PID 0x0C00 +#define RAZER_GOLIATHUS_CHROMA_PID 0x0C01 +#define RAZER_GOLIATHUS_CHROMA_EXTENDED_PID 0x0C02 +#define RAZER_FIREFLY_V2_PID 0x0C04 +#define RAZER_CHROMA_MUG_PID 0x0F07 +#define RAZER_CHROMA_BASE_PID 0x0F08 +#define RAZER_CHROMA_HDK_PID 0x0F09 +#define RAZER_MOUSE_BUNGEE_V3_CHROMA_PID 0x0F1D +#define RAZER_BASE_STATION_V2_CHROMA_PID 0x0F20 + +typedef struct +{ + std::string name; + unsigned int type; + unsigned int rows; + unsigned int cols; +} razer_zone; + +typedef struct +{ + unsigned int zone; + unsigned int row; + unsigned int col; + const char* name; +} razer_key; + +typedef struct +{ + std::string name; + unsigned short pid; + device_type type; + bool matrix_type; + unsigned int rows; + unsigned int cols; + const razer_zone* zones[RAZER_MAX_ZONES]; + const razer_key* keymap; + unsigned int keymap_size; +} razer_device; + +/*-------------------------------------------------------------------------*\ +| KEYMAPS | +\*-------------------------------------------------------------------------*/ +#define BLACKWIDOW_CHROMA_KEYMAP_SIZE (sizeof(blackwidow_chroma_keymap) / sizeof(blackwidow_chroma_keymap[0])) + +static const razer_key blackwidow_chroma_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 0, 20, "Logo" }, + { 0, 1, 0, "Key: M1" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 0, "Key: M2" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 0, "Key: M3" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 0, "Key: M4" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 0, "Key: M5" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +#define BLACKWIDOW_CHROMA_TE_KEYMAP_SIZE (sizeof(blackwidow_chroma_te_keymap) / sizeof(blackwidow_chroma_te_keymap[0])) + +static const razer_key blackwidow_chroma_te_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 0, 20, "Logo" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, +}; + +#define BLADE_PRO_2017_KEYMAP_SIZE (sizeof(blade_pro_2017_keymap) / sizeof(blade_pro_2017_keymap[0])) + +static const razer_key blade_pro_2017_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 2, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Insert" }, + { 0, 0, 17, "Key: Delete" }, + { 0, 0, 19, "Key: Media Previous" }, + { 0, 0, 20, "Key: Media Next" }, + { 0, 0, 21, "Key: Media Volume" }, + { 0, 0, 23, "Key: Media Play/Pause" }, + { 0, 0, 24, "Key: Media Mute" }, + { 0, 1, 2, "Key: `" }, + { 0, 1, 3, "Key: 1" }, + { 0, 1, 4, "Key: 2" }, + { 0, 1, 5, "Key: 3" }, + { 0, 1, 6, "Key: 4" }, + { 0, 1, 7, "Key: 5" }, + { 0, 1, 8, "Key: 6" }, + { 0, 1, 9, "Key: 7" }, + { 0, 1, 10, "Key: 8" }, + { 0, 1, 11, "Key: 9" }, + { 0, 1, 12, "Key: 0" }, + { 0, 1, 13, "Key: -" }, + { 0, 1, 14, "Key: =" }, + { 0, 1, 15, "Key: Backspace" }, + { 0, 2, 2, "Key: Tab" }, + { 0, 2, 4, "Key: Q" }, + { 0, 2, 5, "Key: W" }, + { 0, 2, 6, "Key: E" }, + { 0, 2, 7, "Key: R" }, + { 0, 2, 8, "Key: T" }, + { 0, 2, 9, "Key: Y" }, + { 0, 2, 10, "Key: U" }, + { 0, 2, 11, "Key: I" }, + { 0, 2, 12, "Key: O" }, + { 0, 2, 13, "Key: P" }, + { 0, 2, 14, "Key: [" }, + { 0, 2, 15, "Key: ]" }, + { 0, 2, 17, "Key: \\ (ANSI)" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 4, "Key: A" }, + { 0, 3, 5, "Key: S" }, + { 0, 3, 6, "Key: D" }, + { 0, 3, 7, "Key: F" }, + { 0, 3, 8, "Key: G" }, + { 0, 3, 9, "Key: H" }, + { 0, 3, 10, "Key: J" }, + { 0, 3, 11, "Key: K" }, + { 0, 3, 12, "Key: L" }, + { 0, 3, 13, "Key: ;" }, + { 0, 3, 14, "Key: '" }, + { 0, 3, 18, "Key: Enter" }, + { 0, 4, 0, "Key: Left Shift" }, + { 0, 4, 4, "Key: Z" }, + { 0, 4, 5, "Key: X" }, + { 0, 4, 6, "Key: C" }, + { 0, 4, 7, "Key: V" }, + { 0, 4, 8, "Key: B" }, + { 0, 4, 9, "Key: N" }, + { 0, 4, 10, "Key: M" }, + { 0, 4, 11, "Key: ," }, + { 0, 4, 12, "Key: ." }, + { 0, 4, 13, "Key: /" }, + { 0, 4, 14, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Right Shift" }, + { 0, 5, 0, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Fn" }, + { 0, 5, 3, "Key: Left Windows" }, + { 0, 5, 5, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 10, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Control" }, + { 0, 5, 13, "Key: Left Arrow" }, + { 0, 5, 14, "Key: Down Arrow" }, + { 0, 5, 15, "Key: Right Arrow" }, + { 0, 5, 16, "Key: Right Fn" }, +}; + +#define BLADE_STEALTH_KEYMAP_SIZE (sizeof(blade_stealth_keymap) / sizeof(blade_stealth_keymap[0])) + +static const razer_key blade_stealth_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 2, "Key: F1" }, + { 0, 0, 3, "Key: F2" }, + { 0, 0, 4, "Key: F3" }, + { 0, 0, 5, "Key: F4" }, + { 0, 0, 6, "Key: F5" }, + { 0, 0, 7, "Key: F6" }, + { 0, 0, 8, "Key: F7" }, + { 0, 0, 9, "Key: F8" }, + { 0, 0, 10, "Key: F9" }, + { 0, 0, 11, "Key: F10" }, + { 0, 0, 12, "Key: F11" }, + { 0, 0, 13, "Key: F12" }, + { 0, 0, 14, "Key: Insert" }, + { 0, 0, 15, "Key: Delete" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Backspace" }, + { 0, 2, 0, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: \\ (ANSI)" }, + { 0, 3, 0, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 15, "Key: Enter" }, + { 0, 4, 0, "Key: Left Shift" }, + { 0, 4, 2, "Key: Z" }, + { 0, 4, 3, "Key: X" }, + { 0, 4, 4, "Key: C" }, + { 0, 4, 5, "Key: V" }, + { 0, 4, 6, "Key: B" }, + { 0, 4, 7, "Key: N" }, + { 0, 4, 8, "Key: M" }, + { 0, 4, 9, "Key: ," }, + { 0, 4, 10, "Key: ." }, + { 0, 4, 11, "Key: /" }, + { 0, 4, 12, "Key: Right Shift" }, + { 0, 4, 13, "Key: Right Shift" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 5, 0, "Key: Left Control" }, + { 0, 5, 1, "Key: Left Fn" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 5, "Key: Space" }, + { 0, 5, 6, "Key: Space" }, + { 0, 5, 8, "Key: Space" }, + { 0, 5, 9, "Key: Right Alt" }, + { 0, 5, 10, "Key: Right Fn" }, + { 0, 5, 11, "Key: Right Control" }, + { 0, 5, 12, "Key: Left Arrow" }, + { 0, 5, 13, "Key: Up Arrow" }, + { 0, 5, 14, "Key: Right Arrow" }, + { 0, 5, 15, "Key: Down Arrow" }, +}; + +#define CYNOSA_CHROMA_KEYMAP_SIZE (sizeof(cynosa_chroma_keymap) / sizeof(cynosa_chroma_keymap[0])) + +static const razer_key cynosa_chroma_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 0, 20, "Logo" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +#define HUNTSMAN_ELITE_KEYMAP_SIZE (sizeof(huntsman_elite_keymap) / sizeof(huntsman_elite_keymap[0])) + +static const razer_key huntsman_elite_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 0, 18, "Key: Media Previous" }, + { 0, 0, 19, "Key: Media Play/Pause" }, + { 0, 0, 20, "Key: Media Next" }, + { 0, 0, 21, "Key: Media Mute" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +#define HUNTSMAN_KEYMAP_SIZE (sizeof(huntsman_keymap) / sizeof(huntsman_keymap[0])) + +static const razer_key huntsman_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +#define HUNTSMAN_TE_KEYMAP_SIZE (sizeof(huntsman_te_keymap) / sizeof(huntsman_te_keymap[0])) + +static const razer_key huntsman_te_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, +}; + +#define BLACKWIDOW_ELITE_KEYMAP_SIZE (sizeof(blackwidow_elite_keymap) / sizeof(blackwidow_elite_keymap[0])) + +static const razer_key blackwidow_elite_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 0, 18, "Key: Media Previous" }, + { 0, 0, 19, "Key: Media Play/Pause" }, + { 0, 0, 20, "Key: Media Next" }, + { 0, 0, 21, "Key: Media Mute" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 6, "Key: Space" }, + { 0, 5, 10, "Key: Right Alt" }, + { 0, 5, 11, "Logo" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +#define BLACKWIDOW_2019_KEYMAP_SIZE (sizeof(blackwidow_2019_keymap) / sizeof(blackwidow_2019_keymap[0])) + +static const razer_key blackwidow_2019_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 6, "Key: Space" }, + { 0, 5, 10, "Key: Right Alt" }, + { 0, 5, 11, "Logo" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ," }, +}; + +#define ORNATA_CHROMA_KEYMAP_SIZE (sizeof(ornata_chroma_keymap) / sizeof(ornata_chroma_keymap[0])) + +static const razer_key ornata_chroma_keymap[] = +{ + /*---------------------------------------------------------------------*\ + | Zone, Row, Column, Key | + \*---------------------------------------------------------------------*/ + { 0, 0, 1, "Key: Escape" }, + { 0, 0, 3, "Key: F1" }, + { 0, 0, 4, "Key: F2" }, + { 0, 0, 5, "Key: F3" }, + { 0, 0, 6, "Key: F4" }, + { 0, 0, 7, "Key: F5" }, + { 0, 0, 8, "Key: F6" }, + { 0, 0, 9, "Key: F7" }, + { 0, 0, 10, "Key: F8" }, + { 0, 0, 11, "Key: F9" }, + { 0, 0, 12, "Key: F10" }, + { 0, 0, 13, "Key: F11" }, + { 0, 0, 14, "Key: F12" }, + { 0, 0, 15, "Key: Print Screen" }, + { 0, 0, 16, "Key: Scroll Lock" }, + { 0, 0, 17, "Key: Pause/Break" }, + { 0, 1, 1, "Key: `" }, + { 0, 1, 2, "Key: 1" }, + { 0, 1, 3, "Key: 2" }, + { 0, 1, 4, "Key: 3" }, + { 0, 1, 5, "Key: 4" }, + { 0, 1, 6, "Key: 5" }, + { 0, 1, 7, "Key: 6" }, + { 0, 1, 8, "Key: 7" }, + { 0, 1, 9, "Key: 8" }, + { 0, 1, 10, "Key: 9" }, + { 0, 1, 11, "Key: 0" }, + { 0, 1, 12, "Key: -" }, + { 0, 1, 13, "Key: =" }, + { 0, 1, 14, "Key: Backspace" }, + { 0, 1, 15, "Key: Insert" }, + { 0, 1, 16, "Key: Home" }, + { 0, 1, 17, "Key: Page Up" }, + { 0, 1, 18, "Key: Num Lock" }, + { 0, 1, 19, "Key: Number Pad /" }, + { 0, 1, 20, "Key: Number Pad *" }, + { 0, 1, 21, "Key: Number Pad -" }, + { 0, 2, 1, "Key: Tab" }, + { 0, 2, 2, "Key: Q" }, + { 0, 2, 3, "Key: W" }, + { 0, 2, 4, "Key: E" }, + { 0, 2, 5, "Key: R" }, + { 0, 2, 6, "Key: T" }, + { 0, 2, 7, "Key: Y" }, + { 0, 2, 8, "Key: U" }, + { 0, 2, 9, "Key: I" }, + { 0, 2, 10, "Key: O" }, + { 0, 2, 11, "Key: P" }, + { 0, 2, 12, "Key: [" }, + { 0, 2, 13, "Key: ]" }, + { 0, 2, 14, "Key: \\ (ANSI)" }, + { 0, 2, 15, "Key: Delete" }, + { 0, 2, 16, "Key: End" }, + { 0, 2, 17, "Key: Page Down" }, + { 0, 2, 18, "Key: Number Pad 7" }, + { 0, 2, 19, "Key: Number Pad 8" }, + { 0, 2, 20, "Key: Number Pad 9" }, + { 0, 2, 21, "Key: Number Pad +" }, + { 0, 3, 1, "Key: Caps Lock" }, + { 0, 3, 2, "Key: A" }, + { 0, 3, 3, "Key: S" }, + { 0, 3, 4, "Key: D" }, + { 0, 3, 5, "Key: F" }, + { 0, 3, 6, "Key: G" }, + { 0, 3, 7, "Key: H" }, + { 0, 3, 8, "Key: J" }, + { 0, 3, 9, "Key: K" }, + { 0, 3, 10, "Key: L" }, + { 0, 3, 11, "Key: ;" }, + { 0, 3, 12, "Key: '" }, + { 0, 3, 13, "Key: #" }, + { 0, 3, 14, "Key: Enter" }, + { 0, 3, 18, "Key: Number Pad 4" }, + { 0, 3, 19, "Key: Number Pad 5" }, + { 0, 3, 20, "Key: Number Pad 6" }, + { 0, 4, 1, "Key: Left Shift" }, + { 0, 4, 2, "Key: \\ (ISO)" }, + { 0, 4, 3, "Key: Z" }, + { 0, 4, 4, "Key: X" }, + { 0, 4, 5, "Key: C" }, + { 0, 4, 6, "Key: V" }, + { 0, 4, 7, "Key: B" }, + { 0, 4, 8, "Key: N" }, + { 0, 4, 9, "Key: M" }, + { 0, 4, 10, "Key: ," }, + { 0, 4, 11, "Key: ." }, + { 0, 4, 12, "Key: /" }, + { 0, 4, 14, "Key: Right Shift" }, + { 0, 4, 16, "Key: Up Arrow" }, + { 0, 4, 18, "Key: Number Pad 1" }, + { 0, 4, 19, "Key: Number Pad 2" }, + { 0, 4, 20, "Key: Number Pad 3" }, + { 0, 4, 21, "Key: Number Pad Enter" }, + { 0, 5, 1, "Key: Left Control" }, + { 0, 5, 2, "Key: Left Windows" }, + { 0, 5, 3, "Key: Left Alt" }, + { 0, 5, 7, "Key: Space" }, + { 0, 5, 11, "Key: Right Alt" }, + { 0, 5, 12, "Key: Right Fn" }, + { 0, 5, 13, "Key: Menu" }, + { 0, 5, 14, "Key: Right Control" }, + { 0, 5, 15, "Key: Left Arrow" }, + { 0, 5, 16, "Key: Down Arrow" }, + { 0, 5, 17, "Key: Right Arrow" }, + { 0, 5, 19, "Key: Number Pad 0" }, + { 0, 5, 20, "Key: Number Pad ." }, +}; + +/*-------------------------------------------------------------------------*\ +| KEYBOARDS | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Blackwidow 2019 1532:0241 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_2019_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_2019_device = +{ + "Razer BlackWidow 2019", + RAZER_BLACKWIDOW_2019_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blackwidow_2019_keymap, + BLACKWIDOW_2019_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer BlackWidow Chroma | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_chroma_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_chroma_device = +{ + "Razer BlackWidow Chroma", + RAZER_BLACKWIDOW_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blackwidow_chroma_keymap, + BLACKWIDOW_CHROMA_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Blackwidow Chroma Overwatch 1532:0211 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_chroma_overwatch_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_chroma_overwatch_device = +{ + "Razer Blackwidow Chroma Overwatch", + RAZER_BLACKWIDOW_OVERWATCH_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_chroma_overwatch_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer BlackWidow Chroma Tournament Edition | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_chroma_te_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_chroma_te_device = +{ + "Razer BlackWidow Chroma Tournament Edition", + RAZER_BLACKWIDOW_CHROMA_TE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_chroma_te_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blackwidow_chroma_te_keymap, + BLACKWIDOW_CHROMA_TE_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Blackwidow Elite 1532:0228 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_elite_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_elite_device = +{ + "Razer BlackWidow Elite", + RAZER_BLACKWIDOW_ELITE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_elite_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blackwidow_elite_keymap, + BLACKWIDOW_ELITE_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Blackwidow Chroma V2 1532:0221 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_chroma_v2_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_chroma_v2_device = +{ + "Razer BlackWidow Chroma V2", + RAZER_BLACKWIDOW_CHROMA_V2_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_chroma_v2_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blackwidow X Chroma 1532:0216 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_x_chroma_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_x_chroma_device = +{ + "Razer BlackWidow X Chroma", + RAZER_BLACKWIDOW_X_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_x_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer BlackWidow X Chroma Tournament Edition 1532:021A | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blackwidow_x_chroma_te_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device blackwidow_x_chroma_te_device = +{ + "Razer BlackWidow X Chroma Tournament Edition", + RAZER_BLACKWIDOW_X_CHROMA_TE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &blackwidow_x_chroma_te_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Cynosa Chroma 1532:022A | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone cynosa_chroma_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device cynosa_chroma_device = +{ + "Razer Cynosa Chroma", + RAZER_CYNOSA_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &cynosa_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + cynosa_chroma_keymap, + CYNOSA_CHROMA_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Cynosa v2 1532:025E | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone cynosa_v2_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device cynosa_v2_device = +{ + "Razer Cynosa v2", + RAZER_CYNOSA_V2_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &cynosa_v2_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Cynosa Lite 1532:023F | +| | +| Zone "Keyboard" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone cynosa_lite_zone = +{ + "Keyboard", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device cynosa_lite_device = +{ + "Razer Cynosa Lite", + RAZER_CYNOSA_LITE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 1, + 1, + { + &cynosa_lite_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Ornata Chroma | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone ornata_chroma_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device ornata_chroma_device = +{ + "Razer Ornata Chroma", + RAZER_ORNATA_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &ornata_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + ornata_chroma_keymap, + ORNATA_CHROMA_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer DeathStalker Chroma | +| | +| Zone "Keyboard" | +| Linear | +| 12 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone deathstalker_chroma_zone = +{ + "Keyboard", + ZONE_TYPE_LINEAR, + 1, + 12 +}; + +static const razer_device deathstalker_chroma_device = +{ + "Razer DeathStalker Chroma", + RAZER_DEATHSTALKER_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 1, + 12, + { + &deathstalker_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Huntsman 1532:0227 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone huntsman_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_device huntsman_device = +{ + "Razer Huntsman", + RAZER_HUNTSMAN_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 22, + { + &huntsman_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + huntsman_keymap, + HUNTSMAN_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Huntsman Elite | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 22 Columns | +| | +| Zone "Underglow" | +| Matrix | +| 3 Rows, 22 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone huntsman_elite_keyboard_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 22 +}; + +static const razer_zone huntsman_elite_underglow_zone = +{ + "Underglow", + ZONE_TYPE_MATRIX, + 3, + 22 +}; + +static const razer_device huntsman_elite_device = +{ + "Razer Huntsman Elite", + RAZER_HUNTSMAN_ELITE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 9, + 22, + { + &huntsman_elite_keyboard_zone, + &huntsman_elite_underglow_zone, + NULL, + NULL, + NULL, + NULL + }, + huntsman_elite_keymap, + HUNTSMAN_ELITE_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Huntsman TE 1532:0243 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 18 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone huntsman_te_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 18 +}; + +static const razer_device huntsman_te_device = +{ + "Razer Huntsman Tournament Edition", + RAZER_HUNTSMAN_TE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 18, + { + &huntsman_te_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + huntsman_te_keymap, + HUNTSMAN_TE_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------------------*\ +| LAPTOPS | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_stealth_device = +{ + "Razer Blade Stealth", + RAZER_BLADE_STEALTH_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_stealth_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blade_stealth_keymap, + BLADE_STEALTH_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (Late 2016) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_late_2016_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_stealth_late_2016_device = +{ + "Razer Blade Stealth (Late 2016)", + RAZER_BLADE_STEALTH_LATE_2016_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_stealth_late_2016_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (Mid 2017) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_mid_2017_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_stealth_mid_2017_device = +{ + "Razer Blade Stealth (Mid 2017)", + RAZER_BLADE_STEALTH_MID_2017_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_stealth_mid_2017_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (Late 2017) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_late_2017_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_stealth_late_2017_device = +{ + "Razer Blade Stealth (Late 2017)", + RAZER_BLADE_STEALTH_LATE_2017_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_stealth_late_2017_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (2019) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_2019_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_stealth_2019_device = +{ + "Razer Blade Stealth (2019)", + RAZER_BLADE_STEALTH_2019_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_stealth_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (Late 2019) | +| | +| Zone "Keyboard" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_late_2019_zone = +{ + "Keyboard", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device blade_stealth_late_2019_device = +{ + "Razer Blade Stealth (Late 2019)", + RAZER_BLADE_STEALTH_LATE_2019_PID, + DEVICE_TYPE_KEYBOARD, + false, + 1, + 1, + { + &blade_stealth_late_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; +/*-------------------------------------------------------------*\ +| Razer Blade Stealth (Early 2020) 1532:0252 | +| | +| Zone "Keyboard" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone blade_stealth_early_2020_zone = +{ + "Keyboard", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device blade_stealth_early_2020_device = +{ + "Razer Blade Stealth (Early 2020)", + RAZER_BLADE_STEALTH_EARLY_2020_PID, + DEVICE_TYPE_KEYBOARD, + false, + 1, + 1, + { + &blade_stealth_late_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade (Late 2016) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_late_2016_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_late_2016_device = +{ + "Razer Blade (Late 2016)", + RAZER_BLADE_LATE_2016_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_late_2016_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade (QHD) | +| | +| Zone "Keyboard" | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_qhd_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_qhd_device = +{ + "Razer Blade (QHD)", + RAZER_BLADE_QHD_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_qhd_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (2018) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_2018_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_2018_device = +{ + "Razer Blade 15 (2018)", + RAZER_BLADE_2018_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_2018_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (2018) Mercury | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_2018_mercury_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_2018_mercury_device = +{ + "Razer Blade 15 (2018) Mercury", + RAZER_BLADE_2018_MERCURY_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_2018_mercury_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (2018) Base Model | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_2018_base_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_2018_base_device = +{ + "Razer Blade 15 (2018) Base Model", + RAZER_BLADE_2018_BASE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_2018_base_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (2019) Advanced | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_2019_advanced_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_2019_advanced_device = +{ + "Razer Blade 15 (2019) Advanced", + RAZER_BLADE_2019_ADV_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_2019_advanced_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (Mid 2019) Mercury | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_mid_2019_mercury_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_mid_2019_mercury_device = +{ + "Razer Blade 15 (Mid 2019) Mercury White", + RAZER_BLADE_MID_2019_MERCURY_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_mid_2019_mercury_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (Mid 2019) Base Model | +| | +| Zone "Keyboard" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_mid_2019_base_zone = +{ + "Keyboard", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device blade_15_mid_2019_base_device = +{ + "Razer Blade 15 (Mid 2019) Base Model", + RAZER_BLADE_2019_BASE_PID, + DEVICE_TYPE_KEYBOARD, + false, + 1, + 1, + { + &blade_15_mid_2019_base_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 (Early 2020) Base Model 1532:0255 | +| | +| Zone "Keyboard" | +| Linear | +| 1 Row, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_early_2020_base_zone = +{ + "Keyboard", + ZONE_TYPE_LINEAR, + 1, + 16 +}; + +static const razer_device blade_15_early_2020_base_device = +{ + "Razer Blade 15 Base (Early 2020)", + RAZER_BLADE_EARLY_2020_BASE_PID, + DEVICE_TYPE_KEYBOARD, + true, + 1, + 16, + { + &blade_15_early_2020_base_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade 15 Studio Edition (2019) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_studio_2019_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_studio_2019_device = +{ + "Razer Blade 15 Studio Edition (2019)", + RAZER_BLADE_STUDIO_EDITION_2019_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_studio_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Pro (Late 2016) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 25 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_pro_late_2016_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 25 +}; + +static const razer_device blade_pro_late_2016_device = +{ + "Razer Blade Pro (Late 2016)", + RAZER_BLADE_PRO_LATE_2016_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 25, + { + &blade_pro_late_2016_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Pro (2017) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 25 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_pro_2017_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 25 +}; + +static const razer_device blade_pro_2017_device = +{ + "Razer Blade Pro (2017)", + RAZER_BLADE_PRO_2017_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 25, + { + &blade_pro_2017_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + blade_pro_2017_keymap, + BLADE_PRO_2017_KEYMAP_SIZE +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Pro FullHD (2017) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 25 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_pro_2017_fullhd_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 25 +}; + +static const razer_device blade_pro_2017_fullhd_device = +{ + "Razer Blade Pro FullHD (2017)", + RAZER_BLADE_PRO_2017_FULLHD_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 25, + { + &blade_pro_2017_fullhd_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Pro 17 (2019) | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_pro_17_2019_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_pro_17_2019_device = +{ + "Razer Blade Pro 17 (2019)", + RAZER_BLADE_PRO_2019_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_pro_17_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Pro (Late 2019) | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_pro_late_2019_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_pro_late_2019_device = +{ + "Razer Blade Pro (Late 2019)", + RAZER_BLADE_PRO_LATE_2019_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_pro_late_2019_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Blade Advanced (2020) 1532:0253 | +| | +| Zone "Keyboard" | +| Matrix | +| 6 Rows, 16 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone blade_15_advanced_2020_zone = +{ + "Keyboard", + ZONE_TYPE_MATRIX, + 6, + 16 +}; + +static const razer_device blade_15_advanced_2020_device = +{ + "Razer Blade 15 Advanced (2020)", + RAZER_BLADE_15_ADV_2020_PID, + DEVICE_TYPE_KEYBOARD, + true, + 6, + 16, + { + &blade_15_advanced_2020_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| MICE | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Abyssus Elite DVa Edition 1532:006A | +| | +| Zone "Logo" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone abyssus_elite_dva_edition_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device abyssus_elite_dva_edition_device = +{ + "Razer Abyssus Elite DVa Edition", + RAZER_ABYSSUS_ELITE_DVA_EDITION_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 1, + { + &abyssus_elite_dva_edition_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Abyssus Essential 1532:006B | +| | +| Zone "Logo" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone abyssus_essential_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device abyssus_essential_device = +{ + "Razer Abyssus Essential", + RAZER_ABYSSUS_ESSENTIAL_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 1, + { + &abyssus_essential_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Basilisk 1532:0064 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone basilisk_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone basilisk_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device basilisk_device = +{ + "Razer Basilisk", + RAZER_BASILISK_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 2, + { + &basilisk_logo_zone, + &basilisk_scroll_wheel_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer DeathAdder Chroma | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone deathadder_chroma_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone deathadder_chroma_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device deathadder_chroma_device = +{ + "Razer DeathAdder Chroma", + RAZER_DEATHADDER_CHROMA_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 2, + { + &deathadder_chroma_logo_zone, + &deathadder_chroma_scroll_wheel_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Deathadder Elite | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone deathadder_elite_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone deathadder_elite_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device deathadder_elite_device = +{ + "Razer DeathAdder Elite", + RAZER_DEATHADDER_ELITE_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 2, + { + &deathadder_elite_logo_zone, + &deathadder_elite_scroll_wheel_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer DeathAdder V2 1532:0084 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone deathadder_v2_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone deathadder_v2_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device deathadder_v2_device = +{ + "Razer DeathAdder V2", + RAZER_DEATHADDER_V2_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 2, + { + &deathadder_v2_logo_zone, + &deathadder_v2_scroll_wheel_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Diamondback Chroma | +| | +| Zone "LED Strip" | +| Linear | +| 19 LEDs | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone diamondback_chroma_led_strip_zone = +{ + "LED Strip", + ZONE_TYPE_LINEAR, + 1, + 19 +}; + +static const razer_zone diamondback_chroma_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone diamondback_chroma_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device diamondback_chroma_device = +{ + "Razer Diamondback Chroma", + RAZER_DIAMONDBACK_CHROMA_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 21, + { + &diamondback_chroma_led_strip_zone, + &diamondback_chroma_logo_zone, + &diamondback_chroma_scroll_wheel_zone, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Lancehead Tournament Edition 1532:0060 | +| | +| Zone "Right" | +| Linear | +| 8 LEDs | +| | +| Zone "Left" | +| Linear | +| 8 LEDs | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone lancehead_te_right_zone = +{ + "Right LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_te_left_zone = +{ + "Left LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_te_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone lancehead_te_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device lancehead_te_device = +{ + "Razer Lancehead Tournament Edition", + RAZER_LANCEHEAD_TE_WIRED_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 18, + { + &lancehead_te_right_zone, + &lancehead_te_left_zone, + &lancehead_te_logo_zone, + &lancehead_te_scroll_wheel_zone, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Lancehead V2 (Wired) 1532:0070 | +| | +| Zone "Right" | +| Linear | +| 8 LEDs | +| | +| Zone "Left" | +| Linear | +| 8 LEDs | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone lancehead_v2_wired_right_zone = +{ + "Right LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_v2_wired_left_zone = +{ + "Left LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_v2_wired_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone lancehead_v2_wired_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device lancehead_v2_wired_device = +{ + "Razer Lancehead Wireless (Wired)", + RAZER_LANCEHEAD_WIRELESS_WIRED_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 18, + { + &lancehead_v2_wired_right_zone, + &lancehead_v2_wired_left_zone, + &lancehead_v2_wired_logo_zone, + &lancehead_v2_wired_scroll_wheel_zone, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Lancehead V2 (Wireless) 1532:006F | +| | +| Zone "Right" | +| Linear | +| 8 LEDs | +| | +| Zone "Left" | +| Linear | +| 8 LEDs | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone lancehead_v2_wireless_right_zone = +{ + "Right LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_v2_wireless_left_zone = +{ + "Left LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone lancehead_v2_wireless_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone lancehead_v2_wireless_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device lancehead_v2_wireless_device = +{ + "Razer Lancehead Wireless (Receiver)", + RAZER_LANCEHEAD_WIRELESS_RECEIVER_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 18, + { + &lancehead_v2_wireless_right_zone, + &lancehead_v2_wireless_left_zone, + &lancehead_v2_wireless_logo_zone, + &lancehead_v2_wireless_scroll_wheel_zone, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba 2012 (Wired) | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_2012_wired_zone = +{ + "Scroll Wheel", + ZONE_TYPE_LINEAR, + 1, + 1 +}; + +static const razer_device mamba_2012_wired_device = +{ + "Razer Mamba 2012 (Wired)", + RAZER_MAMBA_2012_WIRED_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 15, + { + &mamba_2012_wired_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba 2012 (Wireless) | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_2012_wireless_zone = +{ + "Scroll Wheel", + ZONE_TYPE_LINEAR, + 1, + 1 +}; + +static const razer_device mamba_2012_wireless_device = +{ + "Razer Mamba 2012 (Wireless)", + RAZER_MAMBA_2012_WIRELESS_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 15, + { + &mamba_2012_wireless_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba (Wired) | +| | +| Zone "Chroma Zone" | +| Single | +| 15 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_wired_zone = +{ + "Chroma Zone", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_device mamba_wired_device = +{ + "Razer Mamba (Wired)", + RAZER_MAMBA_WIRED_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 15, + { + &mamba_wired_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba (Wireless) | +| | +| Zone "Chroma Zone" | +| Single | +| 15 LED | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_wireless_zone = +{ + "Chroma Zone", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_device mamba_wireless_device = +{ + "Razer Mamba (Wireless)", + RAZER_MAMBA_WIRELESS_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 15, + { + &mamba_wireless_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba Elite | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Left" | +| Linear | +| 9 LEDs | +| | +| Zone "Right" | +| Linear | +| 9 LEDs | +| | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_elite_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone mamba_elite_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone mamba_elite_left_zone = +{ + "Left LED Strip", + ZONE_TYPE_LINEAR, + 1, + 9 +}; + +static const razer_zone mamba_elite_right_zone = +{ + "Right LED Strip", + ZONE_TYPE_LINEAR, + 1, + 9 +}; + +static const razer_device mamba_elite_device = +{ + "Razer Mamba Elite", + RAZER_MAMBA_ELITE_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 20, + { + &mamba_elite_scroll_wheel_zone, + &mamba_elite_logo_zone, + &mamba_elite_left_zone, + &mamba_elite_right_zone, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba Tournament Edition | +| | +| Zone "Left" | +| Linear | +| 7 LEDs | +| | +| Zone "Right" | +| Linear | +| 7 LEDs | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_te_left_zone = +{ + "Left LED Strip", + ZONE_TYPE_LINEAR, + 1, + 7 +}; + +static const razer_zone mamba_te_right_zone = +{ + "Right LED Strip", + ZONE_TYPE_LINEAR, + 1, + 7 +}; + +static const razer_zone mamba_te_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone mamba_te_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device mamba_te_device = +{ + "Razer Mamba Tournament Edition", + RAZER_MAMBA_TE_WIRED_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 16, + { + &mamba_te_left_zone, + &mamba_te_right_zone, + &mamba_te_logo_zone, + &mamba_te_scroll_wheel_zone, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba Wireless (2018) Wired 1532:0073 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone mamba_wireless_2018_wired_logo_zone = +{ + "Logo Zone", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone mamba_wireless_2018_wired_scroll_wheel_zone = +{ + "Scroll Wheel Zone", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device mamba_wireless_2018_wired_device = +{ + "Razer Mamba Wireless (Wired)", + RAZER_MAMBA_WIRELESS_WIRED_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 2, + { + &mamba_wireless_2018_wired_scroll_wheel_zone, + &mamba_wireless_2018_wired_logo_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Mamba Wireless (2018) Wireless 1532:0072 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ + +static const razer_zone mamba_wireless_2018_wireless_logo_zone = +{ + "Logo Zone", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone mamba_wireless_2018_wireless_scroll_wheel_zone = +{ + "Scroll Wheel Zone", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device mamba_wireless_2018_wireless_device = +{ + "Razer Mamba Wireless (Receiver)", + RAZER_MAMBA_WIRELESS_RECEIVER_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 2, + { + &mamba_wireless_2018_wireless_scroll_wheel_zone, + &mamba_wireless_2018_wireless_logo_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Naga Chroma | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +| | +| Zone "Numpad" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone naga_chroma_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_chroma_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_chroma_numpad_zone = +{ + "Numpad", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device naga_chroma_device = +{ + "Razer Naga Chroma", + RAZER_NAGA_CHROMA_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 3, + { + &naga_chroma_logo_zone, + &naga_chroma_scroll_wheel_zone, + &naga_chroma_numpad_zone, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Naga Hex V2 1532:0050 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +| | +| Zone "Numpad" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone naga_hex_v2_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_hex_v2_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_hex_v2_numpad_zone = +{ + "Numpad", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device naga_hex_v2_device = +{ + "Razer Naga Hex V2", + RAZER_NAGA_HEX_V2_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 3, + { + &naga_hex_v2_logo_zone, + &naga_hex_v2_scroll_wheel_zone, + &naga_hex_v2_numpad_zone, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Naga Trinity 1532:0067 | +| | +| Zone "Logo" | +| Single | +| 1 LED | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +| | +| Zone "Numpad" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone naga_trinity_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_trinity_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_trinity_numpad_zone = +{ + "Numpad", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device naga_trinity_device = +{ + "Razer Naga Trinity", + RAZER_NAGA_TRINITY_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 3, + { + &naga_trinity_logo_zone, + &naga_trinity_scroll_wheel_zone, + &naga_trinity_numpad_zone, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Viper Mini 1532:008A | +| | +| Zone "Logo" | +| Matrix | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone viper_mini_logo_zone = +{ + "Logo", //Matrix of one as per https://github.com/openrazer/openrazer/blob/master/daemon/openrazer_daemon/hardware/mouse.py#L27 + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device viper_mini_device = +{ + "Razer Viper Mini", + RAZER_VIPER_MINI_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 1, + { + &viper_mini_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Viper Ultimate Wired 1532:007A | +| | +| Zone "Logo" | +| Matrix | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone viper_ultimate_wired_logo_zone = +{ + "Logo", //Matrix of one as per https://github.com/openrazer/openrazer/blob/master/daemon/openrazer_daemon/hardware/mouse.py#L1690 + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device viper_ultimate_wired_device = +{ + "Razer Viper Ultimate (Wired)", + RAZER_VIPER_ULTIMATE_WIRED_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 1, + { + &viper_ultimate_wired_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Viper Ultimate Wireless 1532:007B | +| | +| Zone "Logo" | +| Matrix | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone viper_ultimate_wireless_logo_zone = +{ + "Logo", //Matrix of one as per https://github.com/openrazer/openrazer/blob/master/daemon/openrazer_daemon/hardware/mouse.py#L1690 + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device viper_ultimate_wireless_device = +{ + "Razer Viper Ultimate (Wireless)", + RAZER_VIPER_ULTIMATE_WIRELESS_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 1, + { + &viper_ultimate_wireless_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Viper 1532:0078 | +| | +| Zone "Logo" | +| Matrix | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone viper_logo_zone = +{ + "Logo", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device viper_device = +{ + "Razer Viper", + RAZER_VIPER_PID, + DEVICE_TYPE_MOUSE, + true, + 1, + 1, + { + &viper_logo_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Naga Epic Chroma | +| | +| Zone "Scroll Wheel" | +| Single | +| 1 LED | +| | +| Zone "Numpad" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone naga_epic_chroma_scroll_wheel_zone = +{ + "Scroll Wheel", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone naga_epic_chroma_numpad_zone = +{ + "Numpad", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device naga_epic_chroma_device = +{ + "Razer Naga Epic Chroma", + RAZER_NAGA_EPIC_CHROMA_PID, + DEVICE_TYPE_MOUSE, + false, + 1, + 2, + { + &naga_epic_chroma_scroll_wheel_zone, + &naga_epic_chroma_numpad_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| KEYPADS | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Orbweaver Chroma | +| | +| Zone "Keypad" | +| Matrix | +| 4 Rows, 5 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone orbweaver_chroma_zone = +{ + "Keypad", + ZONE_TYPE_MATRIX, + 4, + 5 +}; + +static const razer_device orbweaver_chroma_device = +{ + "Razer Orbweaver Chroma", + RAZER_ORBWEAVER_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 4, + 5, + { + &orbweaver_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Tartarus Chroma | +| | +| Zone "Keypad" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone tartarus_chroma_zone = +{ + "Keypad", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device tartarus_chroma_device = +{ + "Razer Tartarus Chroma", + RAZER_TARTARUS_CHROMA_PID, + DEVICE_TYPE_KEYBOARD, + true, + 1, + 1, + { + &tartarus_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Tartarus V2 1532:0208 | +| | +| Zone "Keypad" | +| Matrix | +| 4 Rows, 5 Columns | +\*-------------------------------------------------------------*/ +static const razer_zone tartarus_v2_zone = +{ + "Keypad", + ZONE_TYPE_MATRIX, + 4, + 5 +}; + +static const razer_device tartarus_v2_device = +{ + "Razer Tartarus V2", + RAZER_TARTARUS_V2_PID, + DEVICE_TYPE_KEYBOARD, + true, + 4, + 5, + { + &tartarus_v2_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| MOUSEMATS | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Firefly | +| | +| Zone "LED Strip" | +| Linear | +| 15 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone firefly_zone = +{ + "LED Strip", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_device firefly_device = +{ + "Razer Firefly", + RAZER_FIREFLY_PID, + DEVICE_TYPE_MOUSEMAT, + true, + 1, + 15, + { + &firefly_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Firefly Hyperflux | +| | +| Zone "LED Strip" | +| Linear | +| 1 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone firefly_hyperflux_zone = +{ + "LED Strip", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device firefly_hyperflux_device = +{ + "Razer Firefly Hyperflux", + RAZER_FIREFLY_HYPERFLUX_PID, + DEVICE_TYPE_MOUSEMAT, + true, + 1, + 1, + { + &firefly_hyperflux_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Goliathus | +| | +| Zone "LED Strip" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone goliathus_zone = +{ + "LED Strip", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device goliathus_device = +{ + "Razer Goliathus", + RAZER_GOLIATHUS_CHROMA_PID, + DEVICE_TYPE_MOUSEMAT, + true, + 1, + 1, + { + &goliathus_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Goliathus Extended | +| | +| Zone "LED Strip" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone goliathus_extended_zone = +{ + "LED Strip", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device goliathus_extended_device = +{ + "Razer Goliathus Extended", + RAZER_GOLIATHUS_CHROMA_EXTENDED_PID, + DEVICE_TYPE_MOUSEMAT, + true, + 1, + 1, + { + &goliathus_extended_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| HEADSETS | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Kraken 7.1 Chroma | +| | +| Zone "Headset" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone kraken_chroma_zone = +{ + "Headset", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device kraken_chroma_device = +{ + "Razer Kraken 7.1 Chroma", + RAZER_KRAKEN_PID, + DEVICE_TYPE_HEADSET, + true, + 1, + 1, + { + &kraken_chroma_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Kraken 7.1 V2 | +| | +| Zone "Headset" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone kraken_v2_zone = +{ + "Headset", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device kraken_v2_device = +{ + "Razer Kraken 7.1 V2", + RAZER_KRAKEN_V2_PID, + DEVICE_TYPE_HEADSET, + true, + 1, + 1, + { + &kraken_v2_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Kraken Ultimate 1532:0527 | +| | +| Zone "Headset" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone kraken_ultimate_zone = +{ + "Headset", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device kraken_ultimate_device = +{ + "Razer Kraken Ultimate", + RAZER_KRAKEN_ULTIMATE_PID, + DEVICE_TYPE_HEADSET, + true, + 1, + 1, + { + &kraken_ultimate_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Kraken Kitty Edition 1532:0F19 | +| | +| Zone "Headset" | +| Matrix | +| 4 LED | +\*-------------------------------------------------------------*/ +static const razer_zone kraken_kitty_zone = +{ + "Headset", + ZONE_TYPE_LINEAR, + 1, + 4 +}; + +static const razer_device kraken_kitty_device = +{ + "Razer Kraken Kitty Edition", + RAZER_KRAKEN_KITTY_EDITION_PID, + DEVICE_TYPE_HEADSET, + true, + 1, + 4, + { + &kraken_kitty_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Tiamat 7.1 V2 | +| | +| Zone "Controller" | +| Linear | +| 15 LEDs | +| | +| Zone "Headset Left" | +| Single | +| 1 LED | +| | +| Zone "Headset Right" | +| Single | +| 1 LED | +\*-------------------------------------------------------------*/ +static const razer_zone tiamat_71_v2_controller_zone = +{ + "Controller", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_zone tiamat_71_v2_headset_left_zone = +{ + "Headset Left", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone tiamat_71_v2_headset_right_zone = +{ + "Headset Right", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_device tiamat_71_v2_device = +{ + "Razer Tiamat 7.1 V2", + RAZER_TIAMAT_71_V2_PID, + DEVICE_TYPE_HEADSET, + true, + 1, + 17, + { + &tiamat_71_v2_controller_zone, + &tiamat_71_v2_headset_left_zone, + &tiamat_71_v2_headset_right_zone, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| OTHER | +\*-------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------*\ +| Razer Core | +| | +| Zone "Side Window Lights" | +| Single | +| 1 LED | +| | +| Zone "LED Strip" | +| Linear | +| 8 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone core_side_zone = +{ + "Side Window Lights", + ZONE_TYPE_SINGLE, + 1, + 1 +}; + +static const razer_zone core_led_strip_zone = +{ + "LED Strip", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_device core_device = +{ + "Razer Core", + RAZER_CORE_PID, + DEVICE_TYPE_UNKNOWN, + true, + 1, + 9, + { + &core_side_zone, + &core_led_strip_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Chroma Mug Holder | +| | +| Zone "LED Strip" | +| Linear | +| 15 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone mug_holder_zone = +{ + "LED Strip", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_device mug_holder_device = +{ + "Razer Chroma Mug Holder", + RAZER_CHROMA_MUG_PID, + DEVICE_TYPE_UNKNOWN, + true, + 1, + 15, + { + &mug_holder_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Chroma HDK | +| | +| Zone "LED Strip" | +| Linear | +| 16 LEDs | +| | +| Zone "LED Strip" | +| Linear | +| 16 LEDs | +| | +| Zone "LED Strip" | +| Linear | +| 16 LEDs | +| | +| Zone "LED Strip" | +| Linear | +| 16 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone chromahdk_zone_1 = +{ + "Channel 1", + ZONE_TYPE_LINEAR, + 1, + 16 +}; + +static const razer_zone chromahdk_zone_2 = +{ + "Channel 2", + ZONE_TYPE_LINEAR, + 1, + 16 +}; + +static const razer_zone chromahdk_zone_3 = +{ + "Channel 3", + ZONE_TYPE_LINEAR, + 1, + 16 +}; + +static const razer_zone chromahdk_zone_4 = +{ + "Channel 4", + ZONE_TYPE_LINEAR, + 1, + 16 +}; + +static const razer_device chromahdk_device = +{ + "Razer Chroma HDK", + RAZER_CHROMA_HDK_PID, + DEVICE_TYPE_LEDSTRIP, + true, + 4, + 16, + { + &chromahdk_zone_1, + &chromahdk_zone_2, + &chromahdk_zone_3, + &chromahdk_zone_4, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Base Station Chroma | +| | +| Zone "LED Strip" | +| Linear | +| 15 LEDs | +\*-------------------------------------------------------------*/ +static const razer_zone base_station_zone = +{ + "LED Strip", + ZONE_TYPE_LINEAR, + 1, + 15 +}; + +static const razer_device base_station_device = +{ + "Razer Base Station Chroma", + RAZER_CHROMA_BASE_PID, + DEVICE_TYPE_HEADSET_STAND, + true, + 1, + 15, + { + &base_station_zone, + NULL, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Nommo Pro | +| | +| Zone "Left Speaker" | +| Linear | +| 8 LEDs | +| | +| Zone "Right Speaker" | +| Linear | +| 8 LEDs | +| | +\*-------------------------------------------------------------*/ +static const razer_zone nommo_pro_left_zone = +{ + "Left Speaker", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_zone nommo_pro_right_zone = +{ + "Right Speaker", + ZONE_TYPE_LINEAR, + 1, + 8 +}; + +static const razer_device nommo_pro_device = +{ + "Razer Nommo Pro", + RAZER_NOMMO_PRO_PID, + DEVICE_TYPE_UNKNOWN, + true, + 2, + 8, + { + &nommo_pro_left_zone, + &nommo_pro_right_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------*\ +| Razer Nommo Chroma | +| | +| Zone "Right Speaker" | +| Linear | +| 8 LEDs | +| | +| Zone "Left Speaker" | +| Linear | +| 8 LEDs | +| | +\*-------------------------------------------------------------*/ +static const razer_zone nommo_chroma_right_zone = +{ + "Right Speaker", + ZONE_TYPE_LINEAR, + 1, + 24 +}; + +static const razer_zone nommo_chroma_left_zone = +{ + "Left Speaker", + ZONE_TYPE_LINEAR, + 1, + 24 +}; + +static const razer_device nommo_chroma_device = +{ + "Razer Nommo Chroma", + RAZER_NOMMO_CHROMA_PID, + DEVICE_TYPE_UNKNOWN, + true, + 2, + 24, + { + &nommo_chroma_right_zone, + &nommo_chroma_left_zone, + NULL, + NULL, + NULL, + NULL + }, + NULL, + 0 +}; + +/*-------------------------------------------------------------------------*\ +| DEVICE MASTER LIST | +\*-------------------------------------------------------------------------*/ +#define RAZER_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ])) + +static const razer_device* device_list[] = +{ +/*-----------------------------------------------------------------*\ +| KEYBOARDS | +\*-----------------------------------------------------------------*/ + &blackwidow_2019_device, + &blackwidow_chroma_device, + &blackwidow_chroma_overwatch_device, + &blackwidow_chroma_te_device, + &blackwidow_chroma_v2_device, + &blackwidow_elite_device, + &blackwidow_x_chroma_device, + &blackwidow_x_chroma_te_device, + &cynosa_chroma_device, + &cynosa_v2_device, + &cynosa_lite_device, + &deathstalker_chroma_device, + &huntsman_device, + &huntsman_elite_device, + &huntsman_te_device, + &ornata_chroma_device, +/*-----------------------------------------------------------------*\ +| LAPTOPS | +\*-----------------------------------------------------------------*/ + &blade_stealth_device, + &blade_stealth_late_2016_device, + &blade_stealth_mid_2017_device, + &blade_stealth_late_2017_device, + &blade_stealth_2019_device, + &blade_stealth_late_2019_device, + &blade_stealth_early_2020_device, + &blade_late_2016_device, + &blade_qhd_device, + &blade_15_2018_device, + &blade_15_2018_mercury_device, + &blade_15_2018_base_device, + &blade_15_2019_advanced_device, + &blade_15_mid_2019_mercury_device, + &blade_15_mid_2019_base_device, + &blade_15_early_2020_base_device, + &blade_15_studio_2019_device, + &blade_pro_late_2016_device, + &blade_pro_2017_device, + &blade_pro_2017_fullhd_device, + &blade_pro_17_2019_device, + &blade_pro_late_2019_device, + &blade_15_advanced_2020_device, +/*-----------------------------------------------------------------*\ +| MICE | +\*-----------------------------------------------------------------*/ + &abyssus_elite_dva_edition_device, + &abyssus_essential_device, + &basilisk_device, + &deathadder_chroma_device, + &deathadder_elite_device, + &deathadder_v2_device, + &diamondback_chroma_device, + &lancehead_te_device, + &lancehead_v2_wired_device, + &lancehead_v2_wireless_device, + &mamba_2012_wired_device, + &mamba_2012_wireless_device, + &mamba_wired_device, + &mamba_wireless_device, + &mamba_te_device, + &mamba_elite_device, + &mamba_wireless_2018_wired_device, + &mamba_wireless_2018_wireless_device, + &naga_chroma_device, + &naga_epic_chroma_device, + &naga_hex_v2_device, + &naga_trinity_device, + &viper_mini_device, + &viper_ultimate_wired_device, + &viper_ultimate_wireless_device, + &viper_device, +/*-----------------------------------------------------------------*\ +| KEYPADS | +\*-----------------------------------------------------------------*/ + &orbweaver_chroma_device, + &tartarus_chroma_device, + &tartarus_v2_device, +/*-----------------------------------------------------------------*\ +| MOUSEMATS | +\*-----------------------------------------------------------------*/ + &firefly_device, + &firefly_hyperflux_device, + &goliathus_device, + &goliathus_extended_device, +/*-----------------------------------------------------------------*\ +| HEADSETS | +\*-----------------------------------------------------------------*/ + &kraken_chroma_device, + &kraken_v2_device, + &kraken_ultimate_device, + &kraken_kitty_device, + &tiamat_71_v2_device, +/*-----------------------------------------------------------------*\ +| OTHER | +\*-----------------------------------------------------------------*/ + &core_device, + &mug_holder_device, + &chromahdk_device, + &base_station_device, + &nommo_pro_device, + &nommo_chroma_device +}; diff --git a/OpenRGB.pro b/OpenRGB.pro index 4f79eee3..a81f3190 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -96,6 +96,7 @@ INCLUDEPATH += Controllers/OpenRazerController/ \ Controllers/PatriotViperController/ \ Controllers/PhilipsWizController/ \ + Controllers/RazerController/ \ Controllers/RedragonController/ \ Controllers/RoccatController/ \ Controllers/SapphireGPUController/ \ @@ -260,6 +261,9 @@ HEADERS += Controllers/PatriotViperController/RGBController_PatriotViper.h \ Controllers/PhilipsWizController/PhilipsWizController.h \ Controllers/PhilipsWizController/RGBController_PhilipsWiz.h \ + Controllers/RazerController/RazerController.h \ + Controllers/RazerController/RazerDevices.h \ + Controllers/RazerController/RGBController_Razer.h \ Controllers/RedragonController/RedragonK556Controller.h \ Controllers/RedragonController/RedragonM711Controller.h \ Controllers/RedragonController/RGBController_RedragonK556.h \ @@ -489,6 +493,9 @@ SOURCES += Controllers/PhilipsWizController/PhilipsWizController.cpp \ Controllers/PhilipsWizController/PhilipsWizControllerDetect.cpp \ Controllers/PhilipsWizController/RGBController_PhilipsWiz.cpp \ + Controllers/RazerController/RazerController.cpp \ + Controllers/RazerController/RazerControllerDetect.cpp \ + Controllers/RazerController/RGBController_Razer.cpp \ Controllers/RedragonController/RedragonK556Controller.cpp \ Controllers/RedragonController/RedragonM711Controller.cpp \ Controllers/RedragonController/RedragonControllerDetect.cpp \