From 3da5a4f6ba06fd3283e740e96752f6d2d4937e86 Mon Sep 17 00:00:00 2001 From: edbgon Date: Fri, 7 Aug 2020 13:27:19 +0200 Subject: [PATCH] Update to add Apex Pro keyboard --- .../SteelSeriesApexController.cpp | 6 +++--- .../SteelSeriesApexController.h | 2 +- .../SteelSeriesControllerDetect.cpp | 6 ++++-- .../SteelSeriesController/SteelSeriesGeneric.h | 4 ++-- RGBController/RGBController_SteelSeriesApex.cpp | 12 ++++++------ 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Controllers/SteelSeriesController/SteelSeriesApexController.cpp b/Controllers/SteelSeriesController/SteelSeriesApexController.cpp index bbbd5b8dd..cbb800d48 100644 --- a/Controllers/SteelSeriesController/SteelSeriesApexController.cpp +++ b/Controllers/SteelSeriesController/SteelSeriesApexController.cpp @@ -61,7 +61,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector colors) unsigned char buf[643]; int num_keys = 0; - if(proto_type == APEX_7) + if(proto_type == APEX) { num_keys = sizeof(keys) / sizeof(*keys); } @@ -79,7 +79,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector colors) | Set up Direct packet | \*-----------------------------------------------------*/ buf[0x00] = 0; - buf[0x01] = APEX7_PACKET_ID_DIRECT; + buf[0x01] = APEX_PACKET_ID_DIRECT; buf[0x02] = num_keys; /*-----------------------------------------------------*\ @@ -87,7 +87,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector colors) \*-----------------------------------------------------*/ for(int i = 0; i < num_keys; i++) { - if(proto_type == APEX_7) + if(proto_type == APEX) { buf[(i*4)+3] = keys[i]; } diff --git a/Controllers/SteelSeriesController/SteelSeriesApexController.h b/Controllers/SteelSeriesController/SteelSeriesApexController.h index a2b541bd5..4a3eedf41 100644 --- a/Controllers/SteelSeriesController/SteelSeriesApexController.h +++ b/Controllers/SteelSeriesController/SteelSeriesApexController.h @@ -17,7 +17,7 @@ enum { - APEX7_PACKET_ID_DIRECT = 0x3a, /* Direct mode */ + APEX_PACKET_ID_DIRECT = 0x3a, /* Direct mode */ }; class SteelSeriesApexController diff --git a/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp b/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp index 92254ccfc..6f848617f 100644 --- a/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp +++ b/Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp @@ -38,6 +38,7 @@ \*-----------------------------------------------------*/ #define STEELSERIES_APEX_7_PID 0x1612 #define STEELSERIES_APEX_7_TKL_PID 0x1618 +#define STEELSERIES_APEX_PRO_PID 0x1610 typedef struct { @@ -75,8 +76,9 @@ static const steelseries_device device_list[] = /*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*\ | Keyboards | \*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*/ - { STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_7, "SteelSeries Apex 7" }, - { STEELSERIES_VID, STEELSERIES_APEX_7_TKL_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_7_TKL, "SteelSeries Apex 7 TKL" }, + { STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex 7" }, + { STEELSERIES_VID, STEELSERIES_APEX_7_TKL_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_TKL, "SteelSeries Apex 7 TKL" }, + { STEELSERIES_VID, STEELSERIES_APEX_PRO_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex Pro" }, }; /******************************************************************************************\ diff --git a/Controllers/SteelSeriesController/SteelSeriesGeneric.h b/Controllers/SteelSeriesController/SteelSeriesGeneric.h index c00f379e3..17765aefd 100644 --- a/Controllers/SteelSeriesController/SteelSeriesGeneric.h +++ b/Controllers/SteelSeriesController/SteelSeriesGeneric.h @@ -20,7 +20,7 @@ typedef enum RIVAL_100 = 0x00, RIVAL_300 = 0x01, SIBERIA_350 = 0x03, - APEX_7 = 0x04, - APEX_7_TKL = 0x05, + APEX = 0x04, + APEX_TKL = 0x05, } steelseries_type; diff --git a/RGBController/RGBController_SteelSeriesApex.cpp b/RGBController/RGBController_SteelSeriesApex.cpp index ecdff304b..f49b52105 100644 --- a/RGBController/RGBController_SteelSeriesApex.cpp +++ b/RGBController/RGBController_SteelSeriesApex.cpp @@ -263,9 +263,9 @@ RGBController_SteelSeriesApex::RGBController_SteelSeriesApex(SteelSeriesApexCont { steelseries = steelseries_ptr; - name = "SteelSeries Apex 7 RGB Keyboard"; + name = "SteelSeries Apex RGB Keyboard"; type = DEVICE_TYPE_KEYBOARD; - description = "SteelSeries Apex 7 RGB Device"; + description = "SteelSeries Apex RGB Device"; proto_type = steelseries->proto_type; @@ -297,7 +297,7 @@ void RGBController_SteelSeriesApex::SetupZones() new_zone.name = zone_names[zone_idx]; new_zone.type = zone_types[zone_idx]; - if(proto_type == APEX_7) + if(proto_type == APEX) { new_zone.leds_min = zone_sizes[zone_idx]; new_zone.leds_max = zone_sizes[zone_idx]; @@ -314,7 +314,7 @@ void RGBController_SteelSeriesApex::SetupZones() { new_zone.matrix_map = new matrix_map_type; new_zone.matrix_map->height = 6; - if(proto_type == APEX_7) + if(proto_type == APEX) { new_zone.matrix_map->width = 23; new_zone.matrix_map->map = (unsigned int *)&matrix_map; @@ -332,7 +332,7 @@ void RGBController_SteelSeriesApex::SetupZones() zones.push_back(new_zone); - if(proto_type == APEX_7) + if(proto_type == APEX) { total_led_count += zone_sizes[zone_idx]; } @@ -345,7 +345,7 @@ void RGBController_SteelSeriesApex::SetupZones() for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++) { led new_led; - if(proto_type == APEX_7) + if(proto_type == APEX) { new_led.name = led_names[led_idx]; }